I've got this exception when I tryed to play some *.wav file:
java.io.IOException: mark/reset not supported
at java.io.InputStream.reset(InputStream.java:331)
at java.io.FilterInputStream.reset(FilterInputStream.java:204)
at com.sun.media.sound.AiffFileReader.getCOMM(AiffFileReader.java:250)
at com.sun.media.sound.AiffFileReader.getAudioInputStream(AiffFileReader.java:165)
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1094)
at com.mymegaproject.app.gui.sound.SoundPlayback.run(SoundPlayback.java:467)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
The way which I used to is in the code below.
try
{
final FileInputStream fis = new FileInputStream(waveFile);
final AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(fis);
play(audioInputStream);
}
catch(final Exception e)
{
Log.logException(e);
}
private void play(final AudioInputStream audioInputStream)
{
...
closeClip();
clip = (Clip)AudioSystem.getLine(clipInfo);
clip.open(audioInputStream);
clip.start();
clip.drain();
...
}
I'm not strong enough in sound formats and codecs.
Does anybody has run into this problem or maybe know where is the problem?
Edited by: xCh3Dx on Sep 10, 2009 5:05 AM