Member_2_2394978
asked on
audioplayer Play more than one sound at a time
Hi all,
I have a MATLAB programme which works perfectly fine and plays a sound with attached code. However, I would like to be able to run this programme three times, in three different MATLAB instances. It then seems they are fighting for control of the sound system as two of them display errors "Unable to open the audio device for playback: javax.sound.sampled.LineUn availableE xception: Audio Device Unavailable", while the other one plays its sound. I should note that each programme has a loop and plays a sound within the loop with some sleeping to allow for the sound to finish playing.
I get this error even with one programme running if some other programmes are using the sound system: I find and kill them with "lsof | grep snd" and "kill" respectively.
So, my question is whether its possible to play more than one sound at a time. If one programme is needed to play the sounds I could pipe the details from the three to this one, and then play ...
Cheers,
James
I have a MATLAB programme which works perfectly fine and plays a sound with attached code. However, I would like to be able to run this programme three times, in three different MATLAB instances. It then seems they are fighting for control of the sound system as two of them display errors "Unable to open the audio device for playback: javax.sound.sampled.LineUn
I get this error even with one programme running if some other programmes are using the sound system: I find and kill them with "lsof | grep snd" and "kill" respectively.
So, my question is whether its possible to play more than one sound at a time. If one programme is needed to play the sounds I could pipe the details from the three to this one, and then play ...
Cheers,
James
player = audioplayer(sound, f);
play(player);
ASKER
Thanks for a quick reply.
'Undefined variable "com" or class "com.mathworks.toolbox.aud io.JavaAut ioPlayer.'
OS, Ubuntu hardy, matlab 7.8.0
'Undefined variable "com" or class "com.mathworks.toolbox.aud
OS, Ubuntu hardy, matlab 7.8.0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Looks like an internal implementation of audioplayer, that it wants the complete control of audio system.
Not sure if it will help, but you can try to use Java version of audioplayer JavaAudioPlayer.
Open in new window