I'm new to this list so... Hello everyone :)
Anyway, I want to use Ogg in my Windows-based game but am having trouble
figureing out how to get the library to work. I downloaded the "Windows
SDK" snapshot and included all the relevant files in my MSVC++ 6.0 project
on Windows 2000, but the examples do not run due to memory overruns. Here
is some code I tried to run, which is, as far as I can tell from the
documentation, correct. If anyone can tell me what I'm doing wrong, please
do.
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <memory.h>
#include "vorbis/codec.h"
#include "vorbis/vorbisfile.h"
int main()
{
// Open the Ogg file
FILE * OggFile;
OggFile = fopen("Yoshi Speak.ogg", "r");
if (OggFile == NULL)
{
cout << "Error Opening file";
return 0;
}
// Make the file into a Vorbis file
OggVorbis_File vf;
memset(&vf, 0, sizeof(OggVorbis_File));
<p> if (ov_open(OggFile, &vf, NULL, 0) < 0)
{
cout << "Input does not appear to be an Ogg
bitstream.\n";
return 0;
}
<p> // Clear the Vorbis file (which also closes it)
ov_clear(&vf);
// return success
return 1;
}
The error occurs the moment I call a the ov_open function. Commenting it
out supresses the error. The error reads:
Ogg.exe has generated errors and will be closed by WIndowsw You will need
to restart the program. An error log is being created. [OK]
If it occurs in debug mode, the error reads:
Unhandled exception in Ogg.exe (NTDLL.DLL): 0x0000005: Access Violation [OK]
And the execution point is shown to be within the assembly code of NTDLL.
Thanks again!
--Shon F.
<p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to
'vorbis-request@xiph.org'
containing only the word 'unsubscribe' in the body. No subject is
needed.
Unsubscribe messages sent to the list will be ignored/filtered.