• Advertisement
Sign in to follow this  

Ogg Vorbis Issue

This topic is 4979 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am using openAL with ogg vorbis for the sound in my engine, I wrote all of the classes and they compile fine, but when I run the alOpen() method the program crashes. Here is the class:
bool COpenALManager::alOpen(std::string alFileName)
{
//Open music file
	if(!(oggFile = fopen(alFileName.c_str(), "rb")))
		return false;

//Open stream
ov_open(oggFile, &oggStream, NULL, 0);



//Based on the number of channels the file has, format it accordingly
//to either mono (1) or stereo (2+)

	if(vorbisInfo->channels == 1)
	format = AL_FORMAT_MONO16;
	else
	format = AL_FORMAT_STEREO16;

	//Set basic values for openAL
    alGenBuffers(2, buffers);
	alGenSources(1, &source);
	*/
return true;
}
I call the method in main.cpp like so:
	COpenALManager openalManager;
	openalManager.alOpen("test.ogg");
Thank you for any help :)

Share this post


Link to post
Share on other sites
Advertisement
Are you using Visual C++ ?

There are some problems of using OggVorbis with Visual C++. You have to do static linking to all OggVorbis lib files.

Share this post


Link to post
Share on other sites
Ok... You didn't say which line it crashed on. However, I'll take a quick stab at this (since I have been playing around with ogg's lately -theora and vorbis)...

Make sure you zeroize your oggStream structure first... The ogg lib doesn't usually do that for you. Also, where do you get vorbisInfo from? Is it a valid pointer?

Share this post


Link to post
Share on other sites
It crashes on the ov_open line.

For some reason the vorbisInfo was not copy/pasted, but it is in there right after ov_open as such:

vorbisInfo = ov_info(&oggStream, -1);

Also, what do you mean by:

Make sure you zeroize your oggStream structure first

As for compiler, I am using Microsoft Visual C++ 2003, I have my libraries set-up like so:

#pragma comment(lib, "ogg_static.lib" )
#pragma comment(lib, "vorbisfile.lib" )

And then included in the Linker, what else do I need?

Thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by brcolow
As for compiler, I am using Microsoft Visual C++ 2003, I have my libraries set-up like so:

#pragma comment(lib, "ogg_static.lib" )
#pragma comment(lib, "vorbisfile.lib" )

And then included in the Linker, what else do I need?

Thanks

I did it like this:

#ifdef _DEBUG
#pragma comment( lib, "vorbisfile_static_d.lib" )
#pragma comment( lib, "vorbis_static_d.lib" )
#pragma comment( lib, "ogg_static_d.lib" )
#else
#pragma comment( lib, "vorbisfile_static.lib" )
#pragma comment( lib, "vorbis_static.lib" )
#pragma comment( lib, "ogg_static.lib" )
#endif

I also set it to Multi-threaded, I don't remember why. This is an old project. You might want to try it.

Share this post


Link to post
Share on other sites
I did that, and now it runs without crashing but I get 23 warnings:

Linking...
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
vorbisfile_static_d.lib(vorbisfile.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(window.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(synthesis.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(smallft.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(sharedbook.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(res0.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(registry.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(psy.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(mdct.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(mapping0.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(lsp.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(lpc.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(info.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(floor1.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(floor0.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(envelope.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(codebook.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(block.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(bitrate.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
vorbisfile_static_d.lib(analysis.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\vorbisfile_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
ogg_static_d.lib(bitwise.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\ogg_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info
ogg_static_d.lib(framing.obj) : warning LNK4099: PDB 'vc60.pdb' was not found with 'C:\Documents and Settings\Owner\My Documents\OggVorbis-win32sdk-1.0.1\oggvorbis-win32sdk-1.0.1\lib\ogg_static_d.lib' or at 'c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\vc60.pdb'; linking object as if no debug info

Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\OninWars\Debug\BuildLog.htm"
OninWars - 0 error(s), 23 warning(s)

Any idea what that is about?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement