file format options for applets

This should probably be in the newbie section.

What are the sound/music file format options for applets?

works without anything:
-wav
-aif
-au

needs a soundbank:
-mid
-rmf

available through additional libs:
-mod
-xm
-ogg
-mp3


I suggest starting with low quality wav files (11khz, 8bit, mono). I also recommand to use the same editor for cutting and saving the wavs. That way you avoid several problems and well it’s always a good idea to trimm em down.

If you have lots of sounds ogg would be a good option (lib overhead is about 80kb).

Tracker formats like mod and xm are nice for music.

Mp3 isn’t a free format - just don’t use it (use ogg instead - it’s better anyways).

Midi and rmf (beatnik) needs a soundbank, which is available in 3 sizes (ranging from 0.3 to 5mb)… so you can forget that option. Rmf is pretty cool, but you won’t find any free music in that format nor a free editor (there is only one which costs about $400). [Btw the SDK comes with a soundbank wheras the JRE doesn’t]

Thank you very much for the help.

I’m mostly concerned with ogg files. Where can I find the libraries?

The ogg lib is called jorbis and can be grabbed here:
http://www.jcraft.com/jorbis/

A pretty useful (and rather simple) class:
http://kaioa.com/src/SoundManager.java

addClip decodes the ogg file and stores it into ram

playSound plays one of those clips

That’s about it. Pretty simple stuff. Well, each clip consumes quite alot ram, because it’s stored as raw pcm in ram. So you shouldn’t use it for long music tracks (20-30 second clips are still ok with a memory usage of about 10mb).

It’s primary use is sound effects. If you ever need to playback longer tracks you’ll need to use streaming (the lib comes with some examples, which could be adopted).

Thank you very much.

How do you actaully import, play, etc. music in JAVA?