   Ogg on my face
  Hi,I'm trying to write an ogg/vorbis music player but have fallen down at the first hurdle because I'm unused to the io. Can anyone explain why my call to ov_open always crashes? FILE *file;OggVorbis_File vorbis;if ((file=fopen("Music\\Tune.ogg", "rb"))!=NULL){_setmode( _fileno( file ), _O_BINARY );// Open data (the following line will crash!!!)failed=ov_open(file, &vorbis, NULL, 0);...Mark[edited by - Mark Sheeky on August 22, 2003 3:38:30 PM]
  You can use the fmod library at fmod.org.  I think it supports the ogg format ;  be sure to use the right libs, one of them crashed ov_open for me no matter what. ;  You don''t need to _setmode the file to binary since you already set it to "rb" when you call the fopen() function (the _setmode is in the example code because it uses stdin rather than fopen). Not sure why it would cause it to crash though. It could have to do with the libraries like billybob says.;  Nice title. Unfortunately I don''t have anything helpful to say, I just had to reply purely because of the title.   The following statement is true. The previous statement is false.Shameless promotion:FreePop: The GPL Populous II clone.;  (still miserable)What library should I be using? Currently I''m linking only vorbisfile.lib. I''ve tried others but get unresolved externals...Sending ov_open a NULL for the file pointer stops it crashing (but it fails with a ''format is not ogg'' error) so the call must be working on some level. The last logical conclusion is a bug in the API but I''d have thought that very unlikely.Thanks for the _setmode info (I guessed as much but when things start crashing it''s time to try everything you can think of).Mark ;  You will need to set your run time library settings to multithreaded dll (or debug multithreaded dll for debug) ;  Oggcelent! That did the trick Mark ;WARNING!The number of puns in this thread is approaching critical levels!WARNING!;quote:Original post by superpig  The number of puns in this thread is approaching critical levels!  You should know...  The following statement is true. The previous statement is false.Shameless promotion:FreePop: The GPL Populous II clone.