javax.sound.midi
Class SoundbankResource

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.sound.midi.SoundbankResource
Direct Known Subclasses:
Instrument sample code for javax.sound.midi.Instrument definition code for javax.sound.midi.Instrument

public abstract class SoundbankResource
extends Object sample code for java.lang.Object definition code for java.lang.Object

A SoundbankResource represents any audio resource stored in a Soundbank sample code for javax.sound.midi.Soundbank definition code for javax.sound.midi.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.


Constructor Summary
protected SoundbankResource sample code for javax.sound.midi.SoundbankResource.SoundbankResource(javax.sound.midi.Soundbank, java.lang.String, java.lang.Class) definition code for javax.sound.midi.SoundbankResource.SoundbankResource(javax.sound.midi.Soundbank, java.lang.String, java.lang.Class) (Soundbank sample code for javax.sound.midi.Soundbank definition code for javax.sound.midi.Soundbank  soundBank, String sample code for java.lang.String definition code for java.lang.String  name, Class sample code for java.lang.Class definition code for java.lang.Class <?> dataClass)
          Constructs a new SoundbankResource from the given sound bank and wavetable index.
 
Method Summary
abstract  Object sample code for java.lang.Object definition code for java.lang.Object getData sample code for javax.sound.midi.SoundbankResource.getData() definition code for javax.sound.midi.SoundbankResource.getData() ()
          Obtains the sampled audio that is stored in this SoundbankResource.
 Class sample code for java.lang.Class definition code for java.lang.Class <?> getDataClass sample code for javax.sound.midi.SoundbankResource.getDataClass() definition code for javax.sound.midi.SoundbankResource.getDataClass() ()
          Obtains the class used by this sample to represent its data.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for javax.sound.midi.SoundbankResource.getName() definition code for javax.sound.midi.SoundbankResource.getName() ()
          Obtains the name of the resource.
 Soundbank sample code for javax.sound.midi.Soundbank definition code for javax.sound.midi.Soundbank getSoundbank sample code for javax.sound.midi.SoundbankResource.getSoundbank() definition code for javax.sound.midi.SoundbankResource.getSoundbank() ()
          Obtains the sound bank that contains this SoundbankResource.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

SoundbankResource sample code for javax.sound.midi.SoundbankResource(javax.sound.midi.Soundbank, java.lang.String, java.lang.Class<?>) definition code for javax.sound.midi.SoundbankResource(javax.sound.midi.Soundbank, java.lang.String, java.lang.Class<?>)

protected SoundbankResource(Soundbank sample code for javax.sound.midi.Soundbank definition code for javax.sound.midi.Soundbank  soundBank,
                            String sample code for java.lang.String definition code for java.lang.String  name,
                            Class sample code for java.lang.Class definition code for java.lang.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 - the sound bank containing this SoundbankResource
name - the name of the sample
dataClass - the class used to represent the sample's data
See Also:
getSoundbank() sample code for javax.sound.midi.SoundbankResource.getSoundbank() definition code for javax.sound.midi.SoundbankResource.getSoundbank() , getName() sample code for javax.sound.midi.SoundbankResource.getName() definition code for javax.sound.midi.SoundbankResource.getName() , getDataClass() sample code for javax.sound.midi.SoundbankResource.getDataClass() definition code for javax.sound.midi.SoundbankResource.getDataClass() , getData() sample code for javax.sound.midi.SoundbankResource.getData() definition code for javax.sound.midi.SoundbankResource.getData()
Method Detail

getSoundbank sample code for javax.sound.midi.SoundbankResource.getSoundbank() definition code for javax.sound.midi.SoundbankResource.getSoundbank()

public Soundbank sample code for javax.sound.midi.Soundbank definition code for javax.sound.midi.Soundbank  getSoundbank()
Obtains the sound bank that contains this SoundbankResource.

Returns:
the sound bank in which this SoundbankResource is stored

getName sample code for javax.sound.midi.SoundbankResource.getName() definition code for javax.sound.midi.SoundbankResource.getName()

public String sample code for java.lang.String definition code for java.lang.String  getName()
Obtains the name of the resource. This should generally be a string descriptive of the resource.

Returns:
the instrument's name

getDataClass sample code for javax.sound.midi.SoundbankResource.getDataClass() definition code for javax.sound.midi.SoundbankResource.getDataClass()

public Class sample code for java.lang.Class definition code for java.lang.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:
the class used to represent the sample's data, or null if the data is not accessible

getData sample code for javax.sound.midi.SoundbankResource.getData() definition code for javax.sound.midi.SoundbankResource.getData()

public abstract Object sample code for java.lang.Object definition code for java.lang.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:
an object containing the sampled audio data
See Also:
getDataClass() sample code for javax.sound.midi.SoundbankResource.getDataClass() definition code for javax.sound.midi.SoundbankResource.getDataClass()