PDA

View Full Version : Ogg vorbis problem: ov_open(...)


kungfoomasta
07-05-2005, 09:40 PM
Following the tutorial "OpenAL Lesson 8: OggVorbis Streaming Using The Source Queue" I get an error in the "open( string path )" function.

The portion of code where it fails is:

if(!(oggFile = fopen(path.c_str(), "rb")))
throw string("Could not open Ogg file.");
if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0)
{
fclose(oggFile);
throw string("Could not open Ogg stream. ") + errorString(result);
}


More specifically, it's the ov_open function call. The program immediately halts when trying to execute the function, meaning the if is never even evaulated. The first line "fopen(...)" works, and I don't know what the problem could be. Here is my code, similar to the tutorials:


if(!(oggFile = fopen("Track_12-New.ogg", "rb")))
{
std::cout << "hi";
}

result = ov_open( oggFile, &oggStream, NULL, 0);


I'm working in .NET 2003 7.1, and in debug mode when I execute the last line I get the error message:
"Unhandled exception at 0x7c918fea in MyGame.exe: 0xC0000005: Access violation writing location 0x00000010."

The cursor also jumps to the file "open.c" pointing to the following code:

__try {
retval = _tsopen_lk( &unlock_flag,
&fh,
path,
oflag,
shflag,
pmode );
}


Any help is appreciated, I'm sure it's a noob mistake on my part..

mario++
07-06-2005, 07:21 PM
:wink: Hi, I need more info about your problem.
was the fopen open the correct file?

Please send me more info.