Saturday, November 24, 2012

Way to solve "could not create audio stream from input stream"


Similar to this link,

http://www.javaprogrammingforums.com/whats-wrong-my-code/9116-could-not-create-audio-stream-input-stream.html

I was also once confronted with the problem of "could not create audio stream from input stream"
"Exception in thread "main" java.io.IOException: could not create audio stream from input stream"
when trying to use TTS api of some website and playing the recorded .wav file.

After searching on the Internet for quite much time, I ultimately found out the way to solve this problem, which is as follows:

1.Download jl1.0.jar, jmf.jar, and mp3plugin.jar.

2.Copy the jar files to a folder like lib inside the java project.

3.Go to Configure Build Path→Libraries→Add Jars to add these jars.


With these steps, the problem is solved.


The reason behind this IOException is probably related to the file format. A .wav file may be encoded with an mp3 codec.