SoundEffect.GetSampleDuration Method (Microsoft.Xna.Framework.Audio)
Returns the duration for 16-bit PCM audio.
Namespace: Microsoft.Xna.Framework.Audio
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.1082)
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.1082)
- C#
- VB
- F#
public static TimeSpan GetSampleDuration( int sizeInBytes, int sampleRate, AudioChannels channels )
Syntax for VB is not yet implemented.
Syntax for F# is not yet implemented.
Parameters
- sizeInBytes
-
Type: System.Int32
The length of the audio data in bytes.
- sampleRate
-
Type: System.Int32
Sample rate, in Hertz (Hz). Must be between 8000 Hz and 48000 Hz
- channels
-
Type: Microsoft.Xna.Framework.Audio.AudioChannels
Number of channels in the audio data.
Return Value
Type: System.TimeSpanThe duration of the audio data.
Supported in:
Windows DirectX Desktop
Linux Desktop
Windows OpenGL Desktop
Web
Windows DirectX Desktop
Linux Desktop
Windows OpenGL Desktop
Web