Erik de Castro Lopo wrote:> David Siebert wrote: > >> Anyone know of some example code that shows storing speex audio into a >> WAV? For a lot of reasons a WAV is a better choice than ogg for my >> application. > > If you have decoded the speex data to PCM, the easiest way to get > it to WAV is to use libsndfile: > > http://www.mega-nerd.com/libsndfile/ > > Yes, it runs on *nix, windows and mac. Pre-compiled windows binaries > are available at the above URL. > > ErikActually I was hoping to store speex compressed audio into a wav container. Not to trans code it.
David Siebert wrote:> Actually I was hoping to store speex compressed audio into a wav > container. Not to trans code it.To the best of my knowledge, that is not possible. Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- C++ : an octopus made by nailing extra legs onto a dog.
> To the best of my knowledge, that is not possible.In theory, you could add a RIFF fmt tag descriptor for the speex codec, and store the data into the data chunk the way MP3-in-WAV works. But I'm not sure anyone but you would be able to do anything with the file unless you found a way to register a "Compression Code" value for Speex. Maybe you can register a handler for a given compression code with some Registry devilry. See http://www.sonicspot.com/guide/wavefiles.html#fmt for specifics on this field. =R=
Erik de Castro Lopo wrote:> David Siebert wrote: > >> Actually I was hoping to store speex compressed audio into a wav >> container. Not to trans code it. > > To the best of my knowledge, that is not possible.Well, it's possible to put compressed data into the WAV file instead of PCM audio data, and set the compression-type format flag to some made-up value, but it wouldn't work on any WAV player. You could use the RIFF format (which I guess is sort of comparable to the OGG format) and make up a format identifier like SPXX or something. Reed