How can I efficiently play a sound (under Linux)
I have tryed using a fork() and exec() to run esound but this method is very slow and I am curious if anybody know of any functions/libraries that can be used to play a sound efficiently and not have to wait half a second for esound to load up and play.
thanks JW |
If you have aplay installed, type in aplay /path/to/sound/file
That should work for root and users. Later :D :D :D |
Thats not really the point I was getting at... heh
you see, typing in a command such as aplay, or esdplay, is done by calling that program to run - essemtially it is a command line. To do this, in programming, you do a fork() and then a form of exec() to run that file. There is about a 1/4 of a second delay for this method to finally kick in and the sound to start playing... Thats bad for what I want it to do. Now, I could use OpenAL, but, what I was getting at, is there an easy way to get it to play a sound file without having to go through some elaborate API/SDK??? In windows, you could just include windows.h and do a PlaySound() function, simple as that. In linux, is there a similar methodology without having to do the slow fork/exec?? Thanks for the reply tho, JW |
|
http://www.fmod.org/ and all sound world is in your hands
|
All times are GMT -5. The time now is 11:37 PM. |