Bagikan melalui


DynamicSoundEffectInstance Constructor

Initializes a new instance of this class, which creates a dynamic sound effect based on the specified sample rate and audio channel.

Syntax

'Declaration
Public Sub New ( _
         sampleRate As Integer, _
         channels As AudioChannels _
)
public DynamicSoundEffectInstance (
         int sampleRate,
         AudioChannels channels
)
public:
DynamicSoundEffectInstance(
         int sampleRate,
         AudioChannels channels
)

Parameters

  • sampleRate
    Type: Int32
    Sample rate, in Hertz (Hz), of audio content.
  • channels
    Type: AudioChannels
    Number of channels in the audio data.

Remarks

The sampleRate parameter must between 8000 Hz and 48000 Hz.

Exceptions

Exception type Condition
ArgumentOutOfRangeException The value specified for sampleRate is less than 8000 Hz or greater than 48000 Hz. The value specified for channels is something other than mono or stereo.

Requirements

Namespace: Microsoft.Xna.Framework.Audio

Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

See Also

DynamicSoundEffectInstance Class
DynamicSoundEffectInstance Members
Microsoft.Xna.Framework.Audio Namespace

Platforms

Windows Phone