|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMicrosoft.Xna.Framework.Audio.SoundEffectInstance
Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance
public final class DynamicSoundEffectInstance
Provides properties, methods, and events for play back of the audio buffer.
Field Summary | |
---|---|
Event<EventArgs> |
BufferNeeded
Event that occurs when the number of audio capture buffers awaiting playback is less than or equal to two. |
Fields inherited from class Microsoft.Xna.Framework.Audio.SoundEffectInstance |
---|
IsLooped |
Constructor Summary | |
---|---|
DynamicSoundEffectInstance(int sampleRate,
AudioChannels channels)
Initializes a new instance of this class, which creates a dynamic sound effect based on the specified sample rate and audio channel. |
Method Summary | |
---|---|
protected void |
Dispose(boolean disposing)
Releases the unmanaged resources held by this SoundEffectInstance, and optionally releases the managed resources. |
TimeSpan |
GetSampleDuration(int sizeInBytes)
Returns the sample duration based on the specified size of the audio buffer. |
int |
GetSampleSizeInBytes(TimeSpan duration)
Returns the size of the audio buffer required to contain audio samples based on the specified duration. |
void |
Play()
Begins or resumes audio playback. |
void |
SubmitBuffer(byte[] buffer)
Submits an audio buffer for playback. |
void |
SubmitBuffer(byte[] buffer,
int offset,
int count)
Submits an audio buffer for playback. |
Methods inherited from class Microsoft.Xna.Framework.Audio.SoundEffectInstance |
---|
Apply3D, Apply3D, Dispose, finalize, getPan, getPitch, getState, getVolume, IsDisposed, Pause, Resume, setPan, setPitch, setVolume, Stop, Stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Event<EventArgs> BufferNeeded
Constructor Detail |
---|
public DynamicSoundEffectInstance(int sampleRate, AudioChannels channels)
sampleRate
- Sample rate, in Hertz (Hz), of audio content.channels
- Number of channels in the audio data.Method Detail |
---|
protected void Dispose(boolean disposing)
SoundEffectInstance
Dispose
in class SoundEffectInstance
disposing
- Pass true to release both the managed and unmanaged resources for this SoundEffectInstance. Passing false releases only the unmanaged resources.public TimeSpan GetSampleDuration(int sizeInBytes)
sizeInBytes
- Size, in bytes, of the audio data.public int GetSampleSizeInBytes(TimeSpan duration)
duration
- TimeSpan object that contains the duration of the audio sample.public void Play()
Play
in class SoundEffectInstance
public void SubmitBuffer(byte[] buffer)
buffer
- Buffer that contains the audio data. The audio format must be PCM wave data.public void SubmitBuffer(byte[] buffer, int offset, int count)
buffer
- Buffer that contains the audio data. The audio format must be PCM wave data.offset
- Offset, in bytes, to the starting position of the data.count
- Amount, in bytes, of data sent.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |