Share via


DynamicSoundEffectInstance Constructor

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

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

Syntax

public DynamicSoundEffectInstance (
         int sampleRate,
         AudioChannels channels
)

Parameters

  • sampleRate
    Sample rate, in Hertz (Hz), of audio content.
  • channels
    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.

See Also

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

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7