Свойство | Тип | Описание | |
---|---|---|---|
CreateBuffers | void | ||
Dispose | void | ||
GetPooledInstance | SoundEffectInstance | ||
PlatformInitialize | void | ||
PlatformLoadAudioStream | void | ||
PlatformLoadAudioStream | void | ||
PlatformSetMasterVolume | void | ||
SoundEffect | System | ||
SoundEffect | System |
Метод | Описание | |
---|---|---|
CreateInstance ( ) : |
Creates a new SoundEffectInstance for this SoundEffect. Creating a SoundEffectInstance before calling SoundEffectInstance.Play() allows you to access advanced playback features, such as volume, pitch, and 3D positioning. |
|
Dispose ( ) : void |
Releases the resources held by this Microsoft.Xna.Framework.Audio.SoundEffect.
|
|
FromStream ( Stream s ) : SoundEffect |
Creates a SoundEffect object based on the specified data stream. The Stream object must point to the head of a valid PCM wave file. Also, this wave file must be in the RIFF bitstream format. |
|
GetSampleDuration ( int sizeInBytes, int sampleRate, AudioChannels channels ) : TimeSpan |
Gets the TimeSpan representation of a single sample.
|
|
GetSampleSizeInBytes ( TimeSpan duration, int sampleRate, AudioChannels channels ) : int |
Gets the size of a sample from a TimeSpan.
|
|
PlatformInitialize ( byte buffer, int sampleRate, AudioChannels channels ) : void | ||
Play ( ) : bool |
Gets an internal SoundEffectInstance and plays it. Play returns false if more SoundEffectInstances are currently playing then the platform allows. To loop a sound or apply 3D effects, call SoundEffect.CreateInstance() and SoundEffectInstance.Play() instead. SoundEffectInstances used by SoundEffect.Play() are pooled internally. |
|
Play ( float volume, float pitch, float pan ) : bool |
Gets an internal SoundEffectInstance and plays it with the specified volume, pitch, and panning. Play returns false if more SoundEffectInstances are currently playing then the platform allows. To apply looping or simulate 3D audio, call SoundEffect.CreateInstance() and SoundEffectInstance.Play() instead. SoundEffectInstances used by SoundEffect.Play() are pooled internally. |
|
SoundEffect ( byte buffer, int sampleRate, AudioChannels channels ) : System | ||
SoundEffect ( byte buffer, int offset, int count, int sampleRate, AudioChannels channels, int loopStart, int loopLength ) : System | Use SoundEffect.GetSampleDuration() to convert time to samples. |
Метод | Описание | |
---|---|---|
CreateBuffers ( WaveFormat format, DataStream dataStream, int loopStart, int loopLength ) : void | ||
Dispose ( bool disposing ) : void |
Releases the resources held by this Microsoft.Xna.Framework.Audio.SoundEffect. If the disposing parameter is true, the Dispose method was called explicitly. This means that managed objects referenced by this instance should be disposed or released as required. If the disposing parameter is false, Dispose was called by the finalizer and no managed objects should be touched because we do not know if they are still valid or not at that time. Unmanaged resources should always be released. |
|
GetPooledInstance ( bool forXAct ) : SoundEffectInstance |
Returns a sound effect instance from the pool or null if none are available.
|
|
PlatformInitialize ( byte buffer, int offset, int count, int sampleRate, AudioChannels channels, int loopStart, int loopLength ) : void | ||
PlatformLoadAudioStream ( Stream s ) : void | ||
PlatformLoadAudioStream ( |
||
PlatformSetMasterVolume ( ) : void | ||
SoundEffect ( ) : System | ||
SoundEffect ( string fileName ) : System |
public CreateInstance ( ) : |
||
Результат |
public static FromStream ( Stream s ) : SoundEffect | ||
s | Stream | Stream object containing PCM wave data. |
Результат | SoundEffect |
public static GetSampleDuration ( int sizeInBytes, int sampleRate, AudioChannels channels ) : TimeSpan | ||
sizeInBytes | int | Size, in bytes, of audio data. |
sampleRate | int | Sample rate, in Hertz (Hz). Must be between 8000 Hz and 48000 Hz |
channels | AudioChannels | Number of channels in the audio data. |
Результат | TimeSpan |
public static GetSampleSizeInBytes ( TimeSpan duration, int sampleRate, AudioChannels channels ) : int | ||
duration | TimeSpan | TimeSpan object that contains the sample duration. |
sampleRate | int | Sample rate, in Hertz (Hz), of audio data. Must be between 8,000 and 48,000 Hz. |
channels | AudioChannels | Number of channels in the audio data. |
Результат | int |
public PlatformInitialize ( byte buffer, int sampleRate, AudioChannels channels ) : void | ||
buffer | byte | |
sampleRate | int | |
channels | AudioChannels | |
Результат | void |
public Play ( float volume, float pitch, float pan ) : bool | ||
volume | float | Volume, ranging from 0.0 (silence) to 1.0 (full volume). Volume during playback is scaled by SoundEffect.MasterVolume. |
pitch | float | Pitch adjustment, ranging from -1.0 (down an octave) to 0.0 (no change) to 1.0 (up an octave). |
pan | float | Panning, ranging from -1.0 (left speaker) to 0.0 (centered), 1.0 (right speaker). |
Результат | bool |
public SoundEffect ( byte buffer, int sampleRate, AudioChannels channels ) : System | ||
buffer | byte | Buffer containing PCM wave data. |
sampleRate | int | Sample rate, in Hertz (Hz) |
channels | AudioChannels | Number of channels (mono or stereo). |
Результат | System |
public SoundEffect ( byte buffer, int offset, int count, int sampleRate, AudioChannels channels, int loopStart, int loopLength ) : System | ||
buffer | byte | Buffer containing PCM wave data. |
offset | int | Offset, in bytes, to the starting position of the audio data. |
count | int | Amount, in bytes, of audio data. |
sampleRate | int | Sample rate, in Hertz (Hz) |
channels | AudioChannels | Number of channels (mono or stereo). |
loopStart | int | The position, in samples, where the audio should begin looping. |
loopLength | int | The duration, in samples, that audio should loop over. |
Результат | System |