Jump to content
  • Advertisement
Sign in to follow this  
FlaiseSaffron

[java] Getting a Clip for a java sound SPI

This topic is 3187 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to use the Tritonus plugins to load and play music saved in a compressed file format (.ogg and .wav compressed with the GSM 06.10 schema). The SPI appears to link to my program and load the file properly, but I don't know how to acquire a clip that will play the loaded music stream. Relevant code:
stream = AudioSystem.getAudioInputStream(url);
format = stream.getFormat();
frameLength = (int)stream.getFrameLength();
clip = AudioSystem.getClip();
clip.open(new AudioInputStream(stream, format, frameLength)); // Throws the below exception

Output:
javax.sound.sampled.LineUnavailableException: line with format VORBIS 44100.0 Hz, unknown bits per sample, stereo, unknown frame size, unknown frame rate,  not supported.
	at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(Unknown Source)
	at com.sun.media.sound.DirectAudioDevice$DirectClip.implOpen(Unknown Source)
	at com.sun.media.sound.AbstractDataLine.open(Unknown Source)
	at com.sun.media.sound.DirectAudioDevice$DirectClip.open(Unknown Source)
	at com.sun.media.sound.DirectAudioDevice$DirectClip.open(Unknown Source)
	at (my code...)

Can anyone help?

Share this post


Link to post
Share on other sites
Advertisement
Surely someone can at least give me a hint. I don't care exactly which plugin I end up using as long as it can be made to decode compressed audio without crashing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!