public interface

AudioSynthesizer

implements Synthesizer
com.sun.media.sound.AudioSynthesizer
Known Indirect Subclasses

Class Overview

AudioSynthesizer is a Synthesizer which renders it's output audio into SourceDataLine or AudioInputStream.

See Also

Summary

Public Methods
abstract AudioFormat getFormat()
Obtains the current format (encoding, sample rate, number of channels, etc.) of the synthesizer audio data.
abstract AudioSynthesizerPropertyInfo[] getPropertyInfo(Map<StringObject> info)
Gets information about the possible properties for the synthesizer.
abstract void open(SourceDataLine line, Map<StringObject> info)
Opens the synthesizer and starts rendering audio into SourceDataLine.
abstract AudioInputStream openStream(AudioFormat targetFormat, Map<StringObject> info)
Opens the synthesizer and renders audio into returned AudioInputStream.
[Expand]
Inherited Methods
From interface javax.sound.midi.MidiDevice
From interface javax.sound.midi.Synthesizer

Public Methods

public abstract AudioFormat getFormat ()

Obtains the current format (encoding, sample rate, number of channels, etc.) of the synthesizer audio data.

If the synthesizer is not open and has never been opened, it returns the default format.

Returns
  • current audio data format
See Also

public abstract AudioSynthesizerPropertyInfo[] getPropertyInfo (Map<StringObject> info)

Gets information about the possible properties for the synthesizer.

Parameters
info a proposed list of tag/value pairs that will be sent on open.
Returns
  • an array of AudioSynthesizerPropertyInfo objects describing possible properties. This array may be an empty array if no properties are required.

public abstract void open (SourceDataLine line, Map<StringObject> info)

Opens the synthesizer and starts rendering audio into SourceDataLine.

An application opening a synthesizer explicitly with this call has to close the synthesizer by calling close(). This is necessary to release system resources and allow applications to exit cleanly.

Note that some synthesizers, once closed, cannot be reopened. Attempts to reopen such a synthesizer will always result in a MidiUnavailableException.

Parameters
line which AudioSynthesizer writes output audio into. If line is null, then line from system default mixer is used.
info a Map object containing properties for additional configuration supported by synthesizer. If info is null then default settings are used.
Throws
MidiUnavailableException thrown if the synthesizer cannot be opened due to resource restrictions.
SecurityException thrown if the synthesizer cannot be opened due to security restrictions.
See Also

public abstract AudioInputStream openStream (AudioFormat targetFormat, Map<StringObject> info)

Opens the synthesizer and renders audio into returned AudioInputStream.

An application opening a synthesizer explicitly with this call has to close the synthesizer by calling close(). This is necessary to release system resources and allow applications to exit cleanly.

Note that some synthesizers, once closed, cannot be reopened. Attempts to reopen such a synthesizer will always result in a MidiUnavailableException.

Parameters
targetFormat specifies the AudioFormat used in returned AudioInputStream.
info a Map object containing properties for additional configuration supported by synthesizer. If info is null then default settings are used.
Throws
MidiUnavailableException thrown if the synthesizer cannot be opened due to resource restrictions.
SecurityException thrown if the synthesizer cannot be opened due to security restrictions.
See Also