OpenAL - No Sound ? + OF: OF_LOG_ERROR: ofOpenALSoundPlayer: couldnt read [file]

Is there a way to not use FMOD for FFT/Spectrum retrieval i.e. “ofSoundGetSpectrum”, if so, how do I switch from FMOD to any other free for commercial use library, like OpenAL, for which I already think is integrated in OF, but there’s a pre-processor definition that prevents it to be used as a primary sound library ?

  • Title updated… again. -

–To-Latest-Problem–

openAL is the default for linux but you can change ofConstants.h to use openAL instead of fmod but you’ll need to compile openAL, kiss (the library used for fft) libsndfile ( the one for reading sound files) and in case you want to use mp3 mpg123.

you’ll need also to recompile OF after that

Thanks for your reply, I did what you suggested, and successfully compiled OF with the changed sound engine, and now I have some linker errors giving me problems that I can’t seem to solve:

  
1>Link:  
1>     Creating library bin\soundPlayerFFTExample.lib and object bin\soundPlayerFFTExample.exp  
1>openframeworksLib.lib(ofSoundPlayer.obj) : error LNK2019: unresolved external symbol "public: static float * __cdecl ofOpenALSoundPlayer::getSystemSpectrum(int)" (?getSystemSpectrum@ofOpenALSoundPlayer@@SAPAMH@Z) referenced in function "float * __cdecl ofSoundGetSpectrum(int)" (?ofSoundGetSpectrum@@YAPAMH@Z)  
1>openframeworksLib.lib(ofSoundPlayer.obj) : error LNK2019: unresolved external symbol "public: __thiscall ofOpenALSoundPlayer::ofOpenALSoundPlayer(void)" (??0ofOpenALSoundPlayer@@QAE@XZ) referenced in function "public: __thiscall ofSoundPlayer::ofSoundPlayer(void)" (??0ofSoundPlayer@@QAE@XZ)  
1>bin\soundPlayerFFTExample.exe : fatal error LNK1120: 2 unresolved externals  

I’m linking against:

  
openframeworksLib.lib  
cairo-static.lib  
pixman-1.lib  
msimg32.lib  
OpenGL32.lib  
GLu32.lib  
kernel32.lib  
setupapi.lib  
glut32.lib  
rtAudio.lib  
videoInput.lib  
libfreetype.lib  
FreeImage.lib  
qtmlClient.lib  
dsound.lib  
user32.lib  
gdi32.lib  
winspool.lib  
comdlg32.lib  
advapi32.lib  
shell32.lib  
ole32.lib  
oleaut32.lib  
uuid.lib  
glew32s.lib  
fmodex_vc.lib  
glu32.lib  
PocoFoundationmd.lib  
PocoNetmd.lib  
PocoUtilmd.lib  
PocoXMLmd.lib  
tess2.lib  
OgreMain.lib  
OIS.lib  
openal32.lib  

Am I missing something ?

I’m using the 0.7 pre-release version from the downloads page, I just changed what you suggested and recompiled, other than that I did nothing to the original source though.

Also those functions that the linker seems to miss, do actually exist in the ofOpenALSoundPlayer.h/cpp.

I don’t remember linking OpenFrameworks to OpenAL, could that cause the problem ?

Update:

The problem was that ofOpenALSoundPlayer.h/cpp weren’t compiled with the OF project, so I added them, and the libraries that weren’t already compiled (kissfft was the only one I think), and now that that’s done, it compiles and runs fine, but I don’t hear anything, and it can’t play MP3s for some reason, so I converted my file to wav, and still nothing… Any ideas ? Here’s how I’m trying to do it:

  
	ofSoundPlayer al;  
	al.loadSound("D:\\song.wav");  
	al.play();  

And the specific error for MP3:

  
OF: OF_LOG_ERROR: ofOpenALSoundPlayer: couldnt read D:\song.mp3  

Is there any guide to compile OpenFrameworks with OpenAL ? I’m really having trouble with this for some reason…

hi Mind Calamity …

i’m willing to use also openAL and i’m facing similar problems as you did …
did you solved them ? have you been able to use openAL for playing sounds ?

i’m on osx, could you tell me 4 words on how to :

compile openAL ?
compile kiss ?
compile libsndfile ?
compile mpg123 ?

i know you’ve done trough all this “stuff” so i’d appreciate a little route map on what’s the best way to do all this and of course to get to know if at the “end” of this pain, openAL was working ?

any idea, url or words will help :wink:

thanks !

e*