APIdia Launch Partner
Top Description Fields Constructors Methods
javax.sound.midi

public abstract Class SoundbankResource

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.media.sound.DLSSample, com.sun.media.sound.SF2Layer, com.sun.media.sound.SF2Sample, javax.sound.midi.Instrument
Imports
javax.sound.sampled.AudioInputStream

A SoundbankResource represents any audio resource stored in a Soundbank. Common soundbank resources include: Synthesizers that use wavetable synthesis or related techniques play back the audio in a sample when synthesizing notes, often when emulating the real-world instrument that was originally recorded. However, there is not necessarily a one-to-one correspondence between the Instruments and samples in a Soundbank. A single Instrument can use multiple SoundbankResources (typically for notes of dissimilar pitch or brightness). Also, more than one Instrument can use the same sample.
Author
Kara Kytle

Field Summary

Modifier and TypeField and Description
private final Class<?>
dataClass

The class used to represent the sample's data.

private final String
name

The name of the SoundbankResource.

private final Soundbank
soundBank

The sound bank that contains the SoundbankResources.

Constructor Summary

AccessConstructor and Description
protected
SoundbankResource(Soundbank
the sound bank containing this SoundbankResource
soundBank
,
String
the name of the sample
name
,
Class<?>
the class used to represent the sample's data
dataClass
)

Constructs a new SoundbankResource from the given sound bank and wavetable index.

Method Summary

Modifier and TypeMethod and Description
public abstract Object

Returns:

an object containing the sampled audio data
getData
()

Obtains the sampled audio that is stored in this SoundbankResource.

public Class<?>

Returns:

the class used to represent the sample's data, or null if the data is not accessible
getDataClass
()

Obtains the class used by this sample to represent its data.

public String

Returns:

the instrument's name
getName
()

Obtains the name of the resource.

public Soundbank

Returns:

the sound bank in which this SoundbankResource is stored
getSoundbank
()

Obtains the sound bank that contains this SoundbankResource.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dataClassback to summary
private final Class<?> dataClass

The class used to represent the sample's data.

nameback to summary
private final String name

The name of the SoundbankResource.

soundBankback to summary
private final Soundbank soundBank

The sound bank that contains the SoundbankResources.

Constructor Detail

SoundbankResourceback to summary
protected SoundbankResource(Soundbank soundBank, String name, Class<?> dataClass)

Constructs a new SoundbankResource from the given sound bank and wavetable index. (Setting the SoundbankResource's name, sampled audio data, and instruments is a subclass responsibility.)

Parameters
soundBank:Soundbank

the sound bank containing this SoundbankResource

name:String

the name of the sample

dataClass:Class<?>

the class used to represent the sample's data

See Also
getSoundbank, getName, getDataClass, getData

Method Detail

getDataback to summary
public abstract Object getData()

Obtains the sampled audio that is stored in this SoundbankResource. The type of object returned depends on the implementation of the concrete class, and may be queried using getDataClass.

Returns:Object

an object containing the sampled audio data

See Also
getDataClass
getDataClassback to summary
public Class<?> getDataClass()

Obtains the class used by this sample to represent its data. The object returned by getData will be of this class. If this SoundbankResource object does not support direct access to its data, returns null.

Returns:Class<?>

the class used to represent the sample's data, or null if the data is not accessible

getNameback to summary
public String getName()

Obtains the name of the resource. This should generally be a string descriptive of the resource.

Returns:String

the instrument's name

getSoundbankback to summary
public Soundbank getSoundbank()

Obtains the sound bank that contains this SoundbankResource.

Returns:Soundbank

the sound bank in which this SoundbankResource is stored