<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
I'm not sure about the number of channels, however there is a slightly round-about way to get the number of samples from a file. <div><br></div><div>Write to an array using [soundfiler] with the -resize flag. Then use [arraysize] to find the size of the array. Et voila, the number of samples in your file. </div><div><br></div><div>Hope that helps<br><br>> From: reduzierer@yahoo.de<br>> To: pd-list@iem.at<br>> Date: Thu, 28 Jan 2010 23:30:53 +0100<br>> Subject: [PD] acquiring information about wav files<br>> <br>> Hi all<br>> <br>> I am looking for a way to get information about WAV files in Pd,<br>> specifically the number of channels and the number of frames. I know<br>> [wavinfo], but it does not seem to work on windows ("error: could not<br>> read WAV-header" with any file I could find) and on linux it seems to<br>> read only a subset of WAV formats. It does not read from widely used<br>> broadcast format WAV files. The target platform is windows AND linux<br>> anyway in this case, so I need a portable solution.<br>> <br>> The most troubling fact is, that some Pd-vanilla classes ([soundfiler],<br>> [readsf~]) actually do retrieve the information I need, they read both,<br>> the number of frames and the number of channels correctly, with all pcm<br>> encoded wav files I tried, but - what a pity - they don't expose this<br>> information to the patch level. <br>> <br>> Hopefully I am overseeing the obvious here. Hints are very welcome.<br>> <br>> Roman<br>> <br>> <br>> <br>> <br>> _______________________________________________<br>> Pd-list@iem.at mailing list<br>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list<br></div>                                            <br /><hr />Got a cool Hotmail story? <a href='http://clk.atdmt.com/UKM/go/195013117/direct/01/' target='_new'>Tell us now</a></body>
</html>