Class DirectSoundOut
NativeDirectSoundOut using DirectSound COM interop. Contact author: Alexandre Mutel - alexandre_mutel at yahoo.fr Modified by: Graham "Gee" Plumb
public class DirectSoundOut : IWavePlayer, IDisposable
- Inheritance
-
DirectSoundOut
- Implements
- Inherited Members
- Extension Methods
Constructors
DirectSoundOut()
Initializes a new instance of the DirectSoundOut class.
public DirectSoundOut()
DirectSoundOut(Guid)
Initializes a new instance of the DirectSoundOut class.
public DirectSoundOut(Guid device)
Parameters
device
Guid
DirectSoundOut(Guid, int)
Initializes a new instance of the DirectSoundOut class. (40ms seems to work under Vista).
public DirectSoundOut(Guid device, int latency)
Parameters
DirectSoundOut(int)
Initializes a new instance of the DirectSoundOut class.
public DirectSoundOut(int latency)
Parameters
latency
int
Fields
DSDEVID_DefaultCapture
DirectSound default capture device GUID
public static readonly Guid DSDEVID_DefaultCapture
Field Value
DSDEVID_DefaultPlayback
DirectSound default playback device GUID
public static readonly Guid DSDEVID_DefaultPlayback
Field Value
DSDEVID_DefaultVoiceCapture
DirectSound default device for voice capture
public static readonly Guid DSDEVID_DefaultVoiceCapture
Field Value
DSDEVID_DefaultVoicePlayback
DirectSound default device for voice playback
public static readonly Guid DSDEVID_DefaultVoicePlayback
Field Value
Properties
Devices
Gets the DirectSound output devices in the system
public static IEnumerable<DirectSoundDeviceInfo> Devices { get; }
Property Value
OutputWaveFormat
public WaveFormat OutputWaveFormat { get; }
Property Value
PlaybackPosition
Gets the current position from the wave output device.
public TimeSpan PlaybackPosition { get; }
Property Value
PlaybackState
Current playback state
public PlaybackState PlaybackState { get; }
Property Value
Volume
The volume 1.0 is full scale
public float Volume { get; set; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
~DirectSoundOut()
Releases unmanaged resources and performs other cleanup operations before the DirectSoundOut is reclaimed by garbage collection.
protected ~DirectSoundOut()
GetPosition()
Gets the current position in bytes from the wave output device. (n.b. this is not the same thing as the position within your reader stream)
public long GetPosition()
Returns
- long
Position in bytes
Init(IWaveProvider)
Initialise playback
public void Init(IWaveProvider waveProvider)
Parameters
waveProvider
IWaveProviderThe waveprovider to be played
Pause()
Pause Playback
public void Pause()
Play()
Begin playback
public void Play()
Stop()
Stop playback
public void Stop()
Events
PlaybackStopped
Playback Stopped
public event EventHandler<StoppedEventArgs> PlaybackStopped