Hi all
I'm trying to build an application that supports loading as many different WAV-formats as possible (primarily different bit-depths and number of channels). I found, that when focussing on PCM-encoded files only, the variety of formats is still big. Actually, i'd like the application to auto-recognize the number of channels of loaded files. Since [readanysf~] doesn't do that, i use also [ext13/wavinfo] to gather some data about the files. Unfortunately, this externals doesn't read files with a so-called 'broadcast' format. But this is a different story. Then i encountered, that there is something called 'interleaved' format. Those multi-channel files are read fine by [readsf~], but not by [readanysf~]. I have a 8-channel-interleaved file, which [readanysf~] seems to play (according to the right most outlet), but all output channels are mute. However, 8-channel-files i created myself, seem to work well with both, [readsf~] and [readanysf~]. I have another 6-channel interleaved files, which only 5 are played from by [readanysf~]. Now, i wonder what is the magic behind those 'interleaved' files and also, if there is a way to play them in Pd _AND_ have a 'seek' option as [readanysf~] offers?
Roman
On Tue, 2009-12-15 at 00:13 +0100, Roman Haefeli wrote:
Hi all
I'm trying to build an application that supports loading as many different WAV-formats as possible (primarily different bit-depths and number of channels). I found, that when focussing on PCM-encoded files only, the variety of formats is still big. Actually, i'd like the application to auto-recognize the number of channels of loaded files. Since [readanysf~] doesn't do that, i use also [ext13/wavinfo] to gather some data about the files. Unfortunately, this externals doesn't read files with a so-called 'broadcast' format. But this is a different story. Then i encountered, that there is something called 'interleaved' format. Those multi-channel files are read fine by [readsf~], but not by [readanysf~]. I have a 8-channel-interleaved file, which [readanysf~] seems to play (according to the right most outlet), but all output channels are mute. However, 8-channel-files i created myself, seem to work well with both, [readsf~] and [readanysf~]. I have another 6-channel interleaved files, which only 5 are played from by [readanysf~]. Now, i wonder what is the magic behind those 'interleaved' files and also, if there is a way to play them in Pd _AND_ have a 'seek' option as [readanysf~] offers?
Googling some more makes me believe, that 'interleaved' does mean nothing more than just 'many audio channels interleaved into one single file'. So actually both my 8-channel WAV-files are interleaved. Both are 8ch 16bit 44100Hz PCM files and still they are different in that only one of them is read correctly by [readanysf~].
Roman
On Tue, 2009-12-15 at 00:13 +0100, Roman Haefeli wrote:
Hi all
I'm trying to build an application that supports loading as many different WAV-formats as possible (primarily different bit-depths and number of channels). I found, that when focussing on PCM-encoded files only, the variety of formats is still big. Actually, i'd like the application to auto-recognize the number of channels of loaded files. Since [readanysf~] doesn't do that, i use also [ext13/wavinfo] to gather some data about the files. Unfortunately, this externals doesn't read files with a so-called 'broadcast' format. But this is a different story. Then i encountered, that there is something called 'interleaved' format. Those multi-channel files are read fine by [readsf~], but not by [readanysf~]. I have a 8-channel-interleaved file, which [readanysf~] seems to play (according to the right most outlet), but all output channels are mute. However, 8-channel-files i created myself, seem to work well with both, [readsf~] and [readanysf~]. I have another 6-channel interleaved files, which only 5 are played from by [readanysf~]. Now, i wonder what is the magic behind those 'interleaved' files and also, if there is a way to play them in Pd _AND_ have a 'seek' option as [readanysf~] offers?
Googling some more makes me believe, that 'interleaved' does mean nothing more than just 'many audio channels interleaved into one single file'. So actually both my 8-channel WAV-files are interleaved. Both are 8ch 16bit 44100Hz PCM files and still they are different in that only one of them is read correctly by [readanysf~].
- How can i get info about PCM-WAV files in Pd?
- How can i reliably play them back (with the ability to seek)?
Can you put the files online somewhere so I can download them and test them?
-august.
On Tue, 2009-12-15 at 15:33 +0100, august wrote:
Can you put the files online somewhere so I can download them and test them?
Of course:
this plays fine: http://romanhaefeli.net/8ch_does_play.wav
this plays, but no sound: <don't know if i can post that link on the list>
BTW: Is there some documentation about how [readanysf~] (or the underlying layer) tries to assign the channels, when the number of channels created and the number of channels of the loaded file do not match?
Thanks for having a look.
Roman
Can you put the files online somewhere so I can download them and test them?
Of course:
this plays fine: http://romanhaefeli.net/8ch_does_play.wav
this plays, but no sound: <don't know if i can post that link on the list>
Why does that link not go through to the list? hmm.
Anyway, if you set up readanysf~ with 8 channel output, both DO play just fine. The second one is playing, but is VERY soft....just jack up the amplitude multiplication on it. Readanysf~ doesn't normalize your audio for you.
BTW: Is there some documentation about how [readanysf~] (or the underlying layer) tries to assign the channels, when the number of channels created and the number of channels of the loaded file do not match?
no. this is all undefined as it comes from gavl. Thank you for bringing it up though. I am now in discussion with the developer about making an arbitrary mix matrix for mixing channels. I also found a bug in gavl that makes readanysf~ crash if you start it with, say, 4 channels, but feed it an 8 channel audio.
So, this will have to change for the next version.
Here is what I plan...let me know what y'all think.
Because of how PD works, I can only define the number of out channels at object creation. (right?) I cannot match the output number of channels to the input number of channels for any given file.
The way I would like it to work by default is:
for mono output: * for all input except stereo, just the first channel is played * for stereo input, it is downmixed
for stereo output:
* mono input will be upmixed to stereo
* 3 or more channel input will just drop the channels after the
first two
for 2+ channel output: * mono input is upmixed to stereo, remaining channels are empty * if input has less channels than output, all input channels are sent to output in order. any remaining output channels are left empty * if input has more channels thant output, all output channels are filled with corresponding input channel. the remaining input channels are not sent to output.
I don't know if it makes sense to have special default cases for mono and stereo.
-august.
Am 16.12.09 14:53 schrieb "august" unter august@alien.mur.at:
Can you put the files online somewhere so I can download them and test them?
Of course:
this plays fine: http://romanhaefeli.net/8ch_does_play.wav
this plays, but no sound: <don't know if i can post that link on the list>
Why does that link not go through to the list? hmm.
I didn't want to post a file publicly that is not mine.
Anyway, if you set up readanysf~ with 8 channel output, both DO play just fine. The second one is playing, but is VERY soft....just jack up the amplitude multiplication on it. Readanysf~ doesn't normalize your audio for you.
My test patch used [env~]-[nbx] for testing and it showed '0' on all channels, while it definitely showed some output when playing using [readsf~ 8]. I cannot test again right now, but it is already good to know, that it works for you. Am i right in thinking, that this probably gavl related and not [readanysf~] specifally?
Thanks for testing the file.
BTW: Is there some documentation about how [readanysf~] (or the underlying layer) tries to assign the channels, when the number of channels created and the number of channels of the loaded file do not match?
no. this is all undefined as it comes from gavl. Thank you for bringing it up though. I am now in discussion with the developer about making an arbitrary mix matrix for mixing channels. I also found a bug in gavl that makes readanysf~ crash if you start it with, say, 4 channels, but feed it an 8 channel audio.
Yeah, discovered that as well. I haven't figured out, which setups are 'allowed' and which not. Here loading a 6-channel file to [readanysf~ 8] crashes.
So, this will have to change for the next version.
Thanks a lot for your work. Keep us informed.
Roman
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
Anyway, if you set up readanysf~ with 8 channel output, both DO play just fine. The second one is playing, but is VERY soft....just jack up the amplitude multiplication on it. Readanysf~ doesn't normalize your audio for you.
My test patch used [env~]-[nbx] for testing and it showed '0' on all channels, while it definitely showed some output when playing using [readsf~ 8]. I cannot test again right now, but it is already good to know, that it works for you. Am i right in thinking, that this probably gavl related and not [readanysf~] specifally?
yes, I am finding out that gavl design is heavily influenced by 5.1 DVD definitions. In the background, it is trying to do a lot of guesswork on channel definitions and will crash if you feed it something it doesn't know.
It will take me a while to get this worked out with the gavl developer.
Sorry I cannot do better at the moment. I am swamped with other work.
best -august.
My test patch used [env~]-[nbx] for testing and it showed '0' on all channels, while it definitely showed some output when playing using [readsf~ 8]. I cannot test again right now, but it is already good to know, that it works for you. Am i right in thinking, that this probably gavl related and not [readanysf~] specifally?
Yes, it seems it was completely gavl related. But, thanks to your reports and effort, I think we now have the problem licked.
Please check out the latest gavl from cvs and let me know if that helps.
best -august.
On Mon, 2009-12-21 at 17:07 +0100, august wrote:
My test patch used [env~]-[nbx] for testing and it showed '0' on all channels, while it definitely showed some output when playing using [readsf~ 8]. I cannot test again right now, but it is already good to know, that it works for you. Am i right in thinking, that this probably gavl related and not [readanysf~] specifally?
Yes, it seems it was completely gavl related. But, thanks to your reports and effort, I think we now have the problem licked.
Please check out the latest gavl from cvs and let me know if that helps.
I tried that _before_ Christmas and it was the same. Now, after cvs updating gavl _after_ Christmas, [readanysf~] plays all channels fine.
Thanks a lot for that Christmas gift ;-)
Roman
On Mon, 2009-12-21 at 17:07 +0100, august wrote:
My test patch used [env~]-[nbx] for testing and it showed '0' on all channels, while it definitely showed some output when playing using [readsf~ 8]. I cannot test again right now, but it is already good to know, that it works for you. Am i right in thinking, that this probably gavl related and not [readanysf~] specifally?
Yes, it seems it was completely gavl related. But, thanks to your reports and effort, I think we now have the problem licked.
Please check out the latest gavl from cvs and let me know if that helps.
I tried that _before_ Christmas and it was the same. Now, after cvs updating gavl _after_ Christmas, [readanysf~] plays all channels fine.
Thanks a lot for that Christmas gift ;-)
Cool. Glad it worked.
Perhaps Burkhard made some fine tuning in the mean time. These kinds of reports with example files really help debug and make software better.