DSPRelated.com
Forums

32 bit integer WAV file writer?

Started by Mikial Chubarov September 24, 2007
Stefan Reuther wrote:

> Actually, Windows Media Player refuses to open WAV files I wrote > although I think I conform to the specs.
This is why you should use a library like http://www.mega-nerd.com/libsndfile/ (of which I am the main author).
> Didn't get around debugging > that, though: I use them for temporary storage only, and Audacity, Sound > Recorder and sox read them just fine :-)
Audacity for instance uses libsndfile. I suspect that the reason WMP doesn't like your WAV file is that you have one of more of the following: - more than 2 channels - PCM bitwidths > 16 for which WMP insists on the WAVFORMATEXTENSIBLE style WAV files. Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- " Baldie is such a wonderful villain The Linux/OSS community could not possibly ask for a better villain than our man Baldie. He is absolutely perfect for the part. Just look at his creds: 1) Physically repulsive; 2) Morally bankrupt; 3) Megalomaniacal; 4) Possessed of a truly nasty, abusive disposition; 5) Prone to Hitlerian ranting; 6) Stalinesque paranoia... The list just goes on and on. The man has the gift of true despicability, no doubt about it. If it weren't for Baldie we'd be stuck with Bilgatus' merely vacuuous and creepy persona for an anthropomorphization of the Evil Empire -- tepid at best." -- Matthew Alton in LinuxToday.com on Steve Balmer
Erik de Castro Lopo wrote:
> This is why you should use a library like > > http://www.mega-nerd.com/libsndfile/ > > (of which I am the main author). >
Well _THANKS_ for your library, it saved me a LOT of time -- Clyde
>Erik de Castro Lopo wrote: >> This is why you should use a library like
>Well _THANKS_ for your library, it saved me a LOT of time
Same here :) Cheers Markus
mnentwig wrote:

>>Erik de Castro Lopo wrote: >>> This is why you should use a library like > >>Well _THANKS_ for your library, it saved me a LOT of time > > Same here :)
Thanks for the thanks. Now if I could just get all these people who insist on writing their own WAV file writers, my life would be somewhat easier :-). Erik (who has spent far too much time working around broken WAV file headers). -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "I'm not even an atheist so much as I am an antitheist; I not only maintain that all religions are versions of the same untruth, but I hold that the influence of churches, and the effect of religious belief, is positively harmful." -- Christopher Hitchens in "Letters to a Young Contrarian" 2001
Erik de Castro Lopo wrote:
> Stefan Reuther wrote: >>Actually, Windows Media Player refuses to open WAV files I wrote >>although I think I conform to the specs. > > This is why you should use a library like > http://www.mega-nerd.com/libsndfile/ > (of which I am the main author).
If I would redo my toolchain from scratch, I would probably do that. My WAV I/O is part of a codec/filter test framework I started few years ago, grew in little steps to 100x its originally intended size, and is in production use although never intended to - but each evolution step small enough that I said "just writing this little thing down is much less effort than researching for an existing solution". I think you all know this game :-)
> I suspect that the reason WMP doesn't like your WAV file is that > you have one of more of the following: > > - more than 2 channels > - PCM bitwidths > 16
Nope (2x16 bit is the maximum I handle). But actually I don't really care. I mainly read others' WAVs, which works fine. If Audacity can read my temporary files, that's nice because I don't have to write a custom editor (like my terminal program saving its transcripts in HTML so I don't need a custom viewer), but not a prime objective. Stefan