UnsupportedAudioFileException: could not get audio input stream from input URL

3,031 views
Skip to first unread message

Raymond Domingo

unread,
Sep 10, 2009, 10:34:20 AM9/10/09
to mobicents-public
Hello,

I just tryed the media-playback-servlet example and confirmed that is
is working.

After this I changed just one line:
// java.io.File speech = new File("speech.wav");
java.io.File speech = new File("/home/raymond/Music/wav/
BrookBentonMyWay.wav");

(I tried different wav files, all playing correct on my ubuntu
firefox)
But I keep getting :

16:32:37,288 ERROR [AudioPlayer] Exception in file
file:///home/raymond/Music/wav/BrookBentonMyWay.wav
javax.sound.sampled.UnsupportedAudioFileException: could not get audio
input stream from input URL
at javax.sound.sampled.AudioSystem.getAudioInputStream
(AudioSystem.java:1136)
at org.mobicents.media.server.impl.events.announcement.AudioPlayer
$StartCommand.run(AudioPlayer.java:293)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:
441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

Any suggestions ?

Raymond Domingo

unread,
Sep 10, 2009, 10:52:29 AM9/10/09
to mobicents-public
The conference-demo also fails to work.
When I select some wave file and press Play file no music is played...
I also get the same exception:

16:51:47,129 INFO [Conference] Adding
user ..onIntheMistyMoonlight.wav
16:51:47,130 INFO [AnnouncementConferenceParticipant] Linking media/
trunk/Conference/9 to ANN sip-servlets-conference
16:51:47,130 INFO [AnnouncementConferenceParticipant] link created
org.mobicents.mscontrol.impl.MsLinkEventImpl@55e63e33
16:51:47,130 INFO [AnnouncementConferenceParticipant] CONF-ANN link
connected media/trunk/Conference/9 media/trunk/Announcement/17
16:51:47,133 ERROR [AudioPlayer] Exception in file
file:///home/raymond/Music/wav/BrookBentonIntheMistyMoonlight.wav
javax.sound.sampled.UnsupportedAudioFileException: could not get audio
input stream from input URL
at javax.sound.sampled.AudioSystem.getAudioInputStream
(AudioSystem.java:1136)
at org.mobicents.media.server.impl.events.announcement.AudioPlayer
$StartCommand.run(AudioPlayer.java:293)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:
441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)


Raymond Domingo

unread,
Sep 10, 2009, 10:54:58 AM9/10/09
to mobicents-public
even the provided wave file (plays in firefox but) doesn't work in the
examples like I discribed in my previous posts:

/mobicents/servers/sip-servlets/sip-servlets-examples/shopping-demo/
web/src/main/webapp/audio/OrderApproved.wav

Vladimir Ralev

unread,
Sep 10, 2009, 1:22:58 PM9/10/09
to mobicent...@googlegroups.com
The problem is mostly likely that we support only certain kinds of WAV files. You should convert your wav to 8khz, 16 bit, mono, PCM (uncompressed). If you dont have other software for conversion you could use Audacity. Generally follow this tutorial, but adjust the sampling rate too http://bgetutorials.wordpress.com/2007/12/02/converting-stereo-wav-to-mono-wav/

Amit Bhayani

unread,
Sep 10, 2009, 10:55:45 PM9/10/09
to mobicent...@googlegroups.com
As pointed out by Vladimir, in Mobicents Media Player 1.x.y the Audio Player has support only for 8khz, 16 bit mono PCM Format. However from 2.x.y we support

Linear 44100, 16bit, mono
Linear 44100, 16bit, stereo
PCMA
PCMU
Speex
GSM
and Linear like in old one


Is it possible for you to move to 2.x.y? There is no MSC API in 2.x.y but either use MGCP or JSR-309

R.Domingo

unread,
Sep 11, 2009, 3:17:28 AM9/11/09
to mobicent...@googlegroups.com

Thank you all for responding.

I converted some wav files and now it is working ! J

 

I’m looking forward to the 2.x.y version. I probably give it a try in future, but for now I don’t have the time to set it up L

 

 

 

 


Reply all
Reply to author
Forward
0 new messages