Appendix 2: sound.properties File


The Java Sound Configuration file, sound.properties, can be used to specify default service providers for javax.sound.sampled.AudioSystem and javax.sound.midi.MidiSystem.

Properties Keys

The following keys are recognized by AudioSystem methods:

javax.sound.sampled.Clip
javax.sound.sampled.Port
javax.sound.sampled.SourceDataLine
javax.sound.sampled.TargetDataLine

The following keys are recognized by MidiSystem methods:

javax.sound.midi.Sequencer
javax.sound.midi.Synthesizer
javax.sound.midi.Transmitter
javax.sound.midi.Receiver

The values should specify the full class name of the service provider and/or the device name.

sound.properties is located at $JAVAHOME/jre/lib in the Sun implementation.

For more details, see the class descriptions for AudioSystem and MidiSystem.

Examples

To use MyDeviceProvider as the default for SourceDataLine lines, set the following key:

javax.sound.sampled.SourceDataLine=com.xyz.MyDeviceProvider

To specify the default Synthesizer by its name InternalSynth, set the following key:

javax.sound.midi.Synthesizer=#InternalSynth

To specify the default Receiver by provider and name, set the following key:

javax.sound.midi.Receiver=com.sun.media.sound.MidiProvider#SunMIDI1