- java.lang.Object
-
- javax.sound.midi.SoundbankResource
-
- Direct Known Subclasses:
- Instrument
public abstract class SoundbankResource extends Object
ASoundbankResource
represents any audio resource stored in a
. Common soundbank resources include:Soundbank
- Instruments. An instrument may be specified in a variety of
ways. However, all soundbanks have some mechanism for defining
instruments. In doing so, they may reference other resources
stored in the soundbank. Each instrument has a
Patch
which specifies the MIDI program and bank by which it may be referenced in MIDI messages. Instrument information may be stored in
objects.Instrument
- Audio samples. A sample typically is a sampled audio waveform
which contains a short sound recording whose duration is a fraction of
a second, or at most a few seconds. These audio samples may be
used by a
to synthesize sound in response to MIDI commands, or extracted for use by an application. (The terminology reflects musicians' use of the word "sample" to refer collectively to a series of contiguous audio samples or frames, rather than to a single, instantaneous sample.) The data class for an audio sample will be an object that encapsulates the audio sample data itself and information about how to interpret it (the format of the audio data), such as anSynthesizer
.AudioInputStream
- Embedded sequences. A sound bank may contain built-in
song data stored in a data object such as a
.Sequence
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 aSoundbank
. A singleInstrument
can use multiple SoundbankResources (typically for notes of dissimilar pitch or brightness). Also, more than oneInstrument
can use the same sample.
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
SoundbankResource(Soundbank soundBank, String name, Class<?> dataClass)
Constructs a newSoundbankResource
from the given sound bank and wavetable index.
-
Method Summary
Methods Modifier and Type Method and Description abstract Object
getData()
Obtains the sampled audio that is stored in thisSoundbankResource
.Class<?>
getDataClass()
Obtains the class used by this sample to represent its data.String
getName()
Obtains the name of the resource.Soundbank
getSoundbank()
Obtains the sound bank that contains thisSoundbankResource
.
-
-
-
Constructor Detail
-
SoundbankResource
protected SoundbankResource(Soundbank soundBank, String name, Class<?> dataClass)
Constructs a newSoundbankResource
from the given sound bank and wavetable index. (Setting theSoundbankResource's
name, sampled audio data, and instruments is a subclass responsibility.)- Parameters:
soundBank
- the sound bank containing thisSoundbankResource
name
- the name of the sampledataClass
- the class used to represent the sample's data- See Also:
getSoundbank()
,getName()
,getDataClass()
,getData()
-
-
Method Detail
-
getSoundbank
public Soundbank getSoundbank()
Obtains the sound bank that contains thisSoundbankResource
.- Returns:
- the sound bank in which this
SoundbankResource
is stored
-
getName
public String getName()
Obtains the name of the resource. This should generally be a string descriptive of the resource.- Returns:
- the instrument's name
-
getDataClass
public Class<?> getDataClass()
Obtains the class used by this sample to represent its data. The object returned bygetData
will be of this class. If thisSoundbankResource
object does not support direct access to its data, returnsnull
.- Returns:
- the class used to represent the sample's data, or null if the data is not accessible
-
getData
public abstract Object getData()
Obtains the sampled audio that is stored in thisSoundbankResource
. The type of object returned depends on the implementation of the concrete class, and may be queried usinggetDataClass
.- Returns:
- an object containing the sampled audio data
- See Also:
getDataClass()
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/11/2024 03:39:19 Cette version de la page est en cache (à la date du 22/11/2024 03:39:19) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/sound/midi/SoundbankResource.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.