Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.media.sound
Class SoftSynthesizer

    java.lang.Object
      com.sun.media.sound.SoftSynthesizer

All Implemented Interfaces:
  AudioSynthesizer, com.sun.media.sound.ReferenceCountingDevice, javax.sound.midi.MidiDevice, javax.sound.midi.Synthesizer

    public class SoftSynthesizer

extends java.lang.Object
implements AudioSynthesizer, com.sun.media.sound.ReferenceCountingDevice

The software synthesizer class.

Author:
  Karl Helgason

Constructor Summary
`SoftSynthesizer()`

Method Summary
`void` | `close()`
`javax.sound.midi.Instrument[]` | `getAvailableInstruments()`
`javax.sound.midi.MidiChannel[]` | `getChannels()`
`javax.sound.midi.Soundbank` | `getDefaultSoundbank()`
`javax.sound.midi.MidiDevice.Info` | `getDeviceInfo()`
`javax.sound.sampled.AudioFormat` | `getFormat()` Obtains the current format (encoding, sample rate, number of channels, etc.) of the synthesizer audio data.
`long` | `getLatency()`
`javax.sound.midi.Instrument[]` | `getLoadedInstruments()`
`int` | `getMaxPolyphony()`
`int` | `getMaxReceivers()`
`int` | `getMaxTransmitters()`
`long` | `getMicrosecondPosition()`
`AudioSynthesizerPropertyInfo[]` | `getPropertyInfo(java.util.Map<java.lang.String,java.lang.Object> info)` Gets information about the possible properties for the synthesizer.
`javax.sound.midi.Receiver` | `getReceiver()`
`javax.sound.midi.Receiver` | `getReceiverReferenceCounting()`
`java.util.List<javax.sound.midi.Receiver>` | `getReceivers()`
`javax.sound.midi.Transmitter` | `getTransmitter()`
`javax.sound.midi.Transmitter` | `getTransmitterReferenceCounting()`
`java.util.List<javax.sound.midi.Transmitter>` | `getTransmitters()`
`javax.sound.midi.VoiceStatus[]` | `getVoiceStatus()`
`boolean` | `isOpen()`
`boolean` | `isSoundbankSupported(javax.sound.midi.Soundbank soundbank)`
`boolean` | `loadAllInstruments(javax.sound.midi.Soundbank soundbank)`
`boolean` | `loadInstrument(javax.sound.midi.Instrument instrument)`
`boolean` | `loadInstruments(javax.sound.midi.Soundbank soundbank, javax.sound.midi.Patch[] patchList)`
`void` | `open()`
`void` | `open(javax.sound.sampled.SourceDataLine line, java.util.Map<java.lang.String,java.lang.Object> info)` Opens the synthesizer and starts rendering audio into `SourceDataLine`.
`javax.sound.sampled.AudioInputStream` | `openStream(javax.sound.sampled.AudioFormat targetFormat, java.util.Map<java.lang.String,java.lang.Object> info)` Opens the synthesizer and renders audio into returned `AudioInputStream`.
`boolean` | `remapInstrument(javax.sound.midi.Instrument from, javax.sound.midi.Instrument to)`
`void` | `unloadAllInstruments(javax.sound.midi.Soundbank soundbank)`
`void` | `unloadInstrument(javax.sound.midi.Instrument instrument)`
`void` | `unloadInstruments(javax.sound.midi.Soundbank soundbank, javax.sound.midi.Patch[] patchList)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SoftSynthesizer

    public SoftSynthesizer()

Method Detail

### getLatency

    public long getLatency()

  Specified by:
    `getLatency` in interface `javax.sound.midi.Synthesizer`

### getFormat

    public javax.sound.sampled.AudioFormat getFormat()

  Description copied from interface: `AudioSynthesizer`
  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.

  Specified by:
    `getFormat` in interface `AudioSynthesizer`
  Returns:
    current audio data format
  See Also:
    `AudioFormat`

### getMaxPolyphony

    public int getMaxPolyphony()

  Specified by:
    `getMaxPolyphony` in interface `javax.sound.midi.Synthesizer`

### getChannels

    public javax.sound.midi.MidiChannel[] getChannels()

  Specified by:
    `getChannels` in interface `javax.sound.midi.Synthesizer`

### getVoiceStatus

    public javax.sound.midi.VoiceStatus[] getVoiceStatus()

  Specified by:
    `getVoiceStatus` in interface `javax.sound.midi.Synthesizer`

### isSoundbankSupported

    public boolean isSoundbankSupported(javax.sound.midi.Soundbank soundbank)

  Specified by:
    `isSoundbankSupported` in interface `javax.sound.midi.Synthesizer`

### loadInstrument

    public boolean loadInstrument(javax.sound.midi.Instrument instrument)

  Specified by:
    `loadInstrument` in interface `javax.sound.midi.Synthesizer`

### unloadInstrument

    public void unloadInstrument(javax.sound.midi.Instrument instrument)

  Specified by:
    `unloadInstrument` in interface `javax.sound.midi.Synthesizer`

### remapInstrument

    public boolean remapInstrument(javax.sound.midi.Instrument from,
                                   javax.sound.midi.Instrument to)

  Specified by:
    `remapInstrument` in interface `javax.sound.midi.Synthesizer`

### getDefaultSoundbank

    public javax.sound.midi.Soundbank getDefaultSoundbank()

  Specified by:
    `getDefaultSoundbank` in interface `javax.sound.midi.Synthesizer`

### getAvailableInstruments

    public javax.sound.midi.Instrument[] getAvailableInstruments()

  Specified by:
    `getAvailableInstruments` in interface `javax.sound.midi.Synthesizer`

### getLoadedInstruments

    public javax.sound.midi.Instrument[] getLoadedInstruments()

  Specified by:
    `getLoadedInstruments` in interface `javax.sound.midi.Synthesizer`

### loadAllInstruments

    public boolean loadAllInstruments(javax.sound.midi.Soundbank soundbank)

  Specified by:
    `loadAllInstruments` in interface `javax.sound.midi.Synthesizer`

### unloadAllInstruments

    public void unloadAllInstruments(javax.sound.midi.Soundbank soundbank)

  Specified by:
    `unloadAllInstruments` in interface `javax.sound.midi.Synthesizer`

### loadInstruments

    public boolean loadInstruments(javax.sound.midi.Soundbank soundbank,
                                   javax.sound.midi.Patch[] patchList)

  Specified by:
    `loadInstruments` in interface `javax.sound.midi.Synthesizer`

### unloadInstruments

    public void unloadInstruments(javax.sound.midi.Soundbank soundbank,
                                  javax.sound.midi.Patch[] patchList)

  Specified by:
    `unloadInstruments` in interface `javax.sound.midi.Synthesizer`

### getDeviceInfo

    public javax.sound.midi.MidiDevice.Info getDeviceInfo()

  Specified by:
    `getDeviceInfo` in interface `javax.sound.midi.MidiDevice`

### getPropertyInfo

    public AudioSynthesizerPropertyInfo[] getPropertyInfo(java.util.Map<java.lang.String,java.lang.Object> info)

  Description copied from interface: `AudioSynthesizer`
  Gets information about the possible properties for the synthesizer.

  Specified by:
    `getPropertyInfo` in interface `AudioSynthesizer`
  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.

### open

    public void open()
              throws javax.sound.midi.MidiUnavailableException

  Specified by:
    `open` in interface `javax.sound.midi.MidiDevice`
  Throws:
    `javax.sound.midi.MidiUnavailableException`

### open

    public void open(javax.sound.sampled.SourceDataLine line,
                     java.util.Map<java.lang.String,java.lang.Object> info)
              throws javax.sound.midi.MidiUnavailableException

  Description copied from interface: `AudioSynthesizer`
  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 `MidiDevice.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`.

  Specified by:
    `open` in interface `AudioSynthesizer`
  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:
    `javax.sound.midi.MidiUnavailableException` - thrown if the synthesizer cannot be opened due to resource restrictions.
  See Also:
    `MidiDevice.close()`, `MidiDevice.isOpen()`

### openStream

    public javax.sound.sampled.AudioInputStream openStream(javax.sound.sampled.AudioFormat targetFormat,
                                                           java.util.Map<java.lang.String,java.lang.Object> info)
                                                    throws javax.sound.midi.MidiUnavailableException

  Description copied from interface: `AudioSynthesizer`
  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 `MidiDevice.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`.``

  Specified by:
    `openStream` in interface `AudioSynthesizer`
  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:
    `javax.sound.midi.MidiUnavailableException` - thrown if the synthesizer cannot be opened due to resource restrictions.
  See Also:
    `MidiDevice.close()`, `MidiDevice.isOpen()`

### close

    public void close()

  Specified by:
    `close` in interface `javax.sound.midi.MidiDevice`

### isOpen

    public boolean isOpen()

  Specified by:
    `isOpen` in interface `javax.sound.midi.MidiDevice`

### getMicrosecondPosition

    public long getMicrosecondPosition()

  Specified by:
    `getMicrosecondPosition` in interface `javax.sound.midi.MidiDevice`

### getMaxReceivers

    public int getMaxReceivers()

  Specified by:
    `getMaxReceivers` in interface `javax.sound.midi.MidiDevice`

### getMaxTransmitters

    public int getMaxTransmitters()

  Specified by:
    `getMaxTransmitters` in interface `javax.sound.midi.MidiDevice`

### getReceiver

    public javax.sound.midi.Receiver getReceiver()
                                          throws javax.sound.midi.MidiUnavailableException

  Specified by:
    `getReceiver` in interface `javax.sound.midi.MidiDevice`
  Throws:
    `javax.sound.midi.MidiUnavailableException`

### getReceivers

    public java.util.List<javax.sound.midi.Receiver> getReceivers()

  Specified by:
    `getReceivers` in interface `javax.sound.midi.MidiDevice`

### getTransmitter

    public javax.sound.midi.Transmitter getTransmitter()
                                                throws javax.sound.midi.MidiUnavailableException

  Specified by:
    `getTransmitter` in interface `javax.sound.midi.MidiDevice`
  Throws:
    `javax.sound.midi.MidiUnavailableException`

### getTransmitters

    public java.util.List<javax.sound.midi.Transmitter> getTransmitters()

  Specified by:
    `getTransmitters` in interface `javax.sound.midi.MidiDevice`

### getReceiverReferenceCounting

    public javax.sound.midi.Receiver getReceiverReferenceCounting()
                                                           throws javax.sound.midi.MidiUnavailableException

  Specified by:
    `getReceiverReferenceCounting` in interface `com.sun.media.sound.ReferenceCountingDevice`
  Throws:
    `javax.sound.midi.MidiUnavailableException`

### getTransmitterReferenceCounting

    public javax.sound.midi.Transmitter getTransmitterReferenceCounting()
                                                                 throws javax.sound.midi.MidiUnavailableException

  Specified by:
    `getTransmitterReferenceCounting` in interface `com.sun.media.sound.ReferenceCountingDevice`
  Throws:
    `javax.sound.midi.MidiUnavailableException`

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD