[PD] how to know if a file has more than one channel?

Martin Peach martin.peach at sympatico.ca
Sat May 18 17:09:23 CEST 2013


On 2013-05-18 09:57, altern wrote:
> hi
>
> I would like to be able to distinguish between mono and stereo files at
> loading time. I am loading the sound with soundfiler using this messages
> which works both for stereo and mono files
>
> read -resize path_to_file table1 table2
>
> any suggestions? maybe there is some way to check if the second table is
> full with zeros?


You could first read the file into [iemlib/soundfile_info] and take the 
fifth item in the output list, which is the number of channels.

Martin




More information about the Pd-list mailing list