SFML community forums
Help => Audio => Topic started by: m33plays on January 10, 2012, 05:36:09 pm
-
Hello everyone,
I'm really new to SFML and game programming, fairly new with Ubuntu, and just decent with C programming (C++ work in progress).
I installed SFML on my Ubuntu 10.10 and I successfully manage to run some tests and create my first basic version of Pong. Now...I tried to add sounds to my game simply adding after the initialization
if(!introMusic.OpenFromFile("music.ogg")){
return;
}
introMusic.Play();
When I compile I have no errors, but when I run the program the music doesn't start and I get the following message in the terminal
AL lib: oss.c:169: Could not open /dev/dsp: No such file or directory
I googled it and looked around for a solution but I couldn't find one...
The thing is that there is no /dev/dsp in my PC, so my guess is that the program is trying to open the wrong device. Maybe I didn't installed properly libsndfile and/or openal, so I tried reinstall them via Synaptic Package Manager.
Ah..all the other sounds work on my computer
Thank you in advance for any help you can give me!
Happy programming to everyone!
-
I have no idea.
Have you tried to install PulseAudio and/or ALSA?
-
I checked PulseAudio and it seems it's installed correctly...as soon as I can I'll try to update ALSA, I've seen that I don't have the latest version...I don't know if this can be the issue but I'll try and I'll see what happens!
-
I reinstalled everything but the problem persists unfortunately...
Does anyone have other ideas? Anything I can try?
-
For anyone interested, I found a solution:
For some reasons OpenAL tries to use OSS instead of ALSA (even if it generally uses ALSA and I don't have OSS support). The solution I found on this link here http://www.finiderire.com/post/2008/07/14/SFML-%3A-tout-voir-et-rien-installer is to use the alsa-oss wrapper that force the use of ALSA whenever OSS is called instead (another solution would be to recompile the kernel with the support for OSS).
Now I have a new problem though: I can launch the executable from terminal using the command
aoss ./name_program
but I can't find a way to set Eclipse to use the aoss command, in order to save time. Does anyone know if it is possible?
No, wait! I just managed to do it: in the launch configuration window, select the "Environment" table and create a new variable called LD_PRELOAD with a Value /usr/lib/libaoss.so
Everything's fine now ;)
But don't worry I think I'll need your help again pretty soon!