Ogg Vorbis OV_EBADHEADER

Started by
6 comments, last by PyroBoy 22 years, 3 months ago
Anyone know what causes the vorbisfile library function ov_open to return OV_EBADHEADER? The docs list it as meaning "Invalid Vorbis bitstream header", but they don''t say what can be done about it. Is this caused by something being wrong with the .ogg file I''m trying to load? The file plays just fine via winamp''s vorbis decoder, so I''m thinking it might be something in my code... Here''s the relevant section: //Open file FILE *filePoint = fopen(fileName.data(), "r"); //Init vorbisfile lib OggVorbis_File vorbisFile; ZeroMemory(&vorbisFile, sizeof(OggVorbis_File)); int ret = ov_open(filePoint, &vorbisFile, NULL, 0); ov_open returns the OV_EBADHEADER error value. I''ve tried multiple ogg files. They all give the same error. Anyone run into this before?
Advertisement
anyone?

quote:Original post by PyroBoy
Anyone run into this before?

Nope. I''ve never had any problems with any OGG Vorbis files that I made or that other people made when using VorbisFile.

[Resist Windows XP''s Invasive Production Activation Technology!]
I read somewhere that OpenAL supports the OGG Vorbis format. You can try that as an alternative and more robust API then using Ogg Vorbis directly.
hell....

ov_open isn''t exactly the most complex call in the world. There''s really only the one way to call it in most instances, and the SDK example does it the same way. I''m using the same .lib as everyone else, so what gives?

Could it be something to do with the fopen? Another mode perhaps?

quote:Original post by PyroBoy
Anyone know what causes the vorbisfile library function ov_open to return OV_EBADHEADER? The docs list it as meaning "Invalid Vorbis bitstream header", but they don''t say what can be done about it.
Is this caused by something being wrong with the .ogg file I''m trying to load? The file plays just fine via winamp''s vorbis decoder, so I''m thinking it might be something in my code... Here''s the relevant section:

//Open file
FILE *filePoint = fopen(fileName.data(), "r");

//Init vorbisfile lib
OggVorbis_File vorbisFile;
ZeroMemory(&vorbisFile, sizeof(OggVorbis_File));
int ret = ov_open(filePoint, &vorbisFile, NULL, 0);

ov_open returns the OV_EBADHEADER error value.

I''ve tried multiple ogg files. They all give the same error. Anyone run into this before?



make it... ''b'' = binary mode which YOU REALLY NEED <.<

FILE *filePoint = fopen(fileName.data(), "rb");




quote:Original post by Ranger_One
make it... ''b'' = binary mode which YOU REALLY NEED <.<

Yes, you''re right, Windows needs to be specifically told to use binary mode or it mangles the data. Good idea, I forgot all about Windows .

[Resist Windows XP''s Invasive Production Activation Technology!]
That did it! Thanks a lot!

Come to think of it, the example *did* make a big deal about binary mode in win32, but it used stdin to read the stream, not fopen. I guess I should have figured it would be the same deal.

This topic is closed to new replies.

Advertisement