public class WaveOut : ISoundOut
Provides audioplayback through the WaveOut api.
Stopped
Occurs when the playback stops.
public Stopped
WaveOut()
Initializes a new instance of the WaveOut class with a latency of 100 ms.
public void WaveOut()
WaveOut(Int32 latency)
Initializes a new instance of the WaveOut class.
public void WaveOut(Int32 latency)
Parameters
latency
Int32Latency of the playback specified in milliseconds.
Exceptions
System.ArgumentOutOfRangeException
latency must not be less or equal to zero.
CreateWaveOutHandle(WaveFormat waveFormat)
Creates and returns the WaveOut handle.
protected virtual IntPtr CreateWaveOutHandle(WaveFormat waveFormat)
Parameters
waveFormat
WaveFormatThe waveformat to use.
Returns
A valid WaveOut handle.
Dispose()
Stops the playback (if playing) and cleans up all used resources.
public void Dispose()
Dispose(Boolean disposing)
Disposes and stops the WaveOut instance.
protected virtual void Dispose(Boolean disposing)
Parameters
disposing
BooleanTrue to release both managed and unmanaged resources; false to release only unmanaged resources.
Finalize()
Finalizes an instance of the WaveOut class.
protected void Finalize()
Initialize(IWaveSource source)
Initializes WaveOut instance and prepares all resources for playback. Note that properties like Device, Latency,... won't affect WaveOut after calling Initialize.
Pause()
Pauses the playback.
public void Pause()
Play()
Starts the playback. Note: Initialize has to get called before calling Play. If PlaybackState is Paused, Resume will be called automatically.
public void Play()
Resume()
Resumes the paused playback.
public void Resume()
Stop()
Stops the playback and frees most of allocated resources.
public void Stop()
Device
Gets or sets the Device which should be used for playback. The Device property has to be set before initializing. The systems default playback device is used as default value of the Device property.
public WaveOutDevice Device { get; set; }
Exceptions
ArgumentNullException
The value must not be null.
Latency
Gets or sets the latency of the playback specified in milliseconds. The Latency property has to be set before initializing.
public Int32 Latency { get; set; }
PlaybackState
Gets the current PlaybackState of the playback.
public PlaybackState PlaybackState { get; }
UseChannelMixingMatrices
Gets or sets a value indicating whether WaveOut should try to use all available channels.
public Boolean UseChannelMixingMatrices { get; set; }
Volume
Gets or sets the volume of the playback. Valid values are in the range from 0.0 (0%) to 1.0 (100%).
public Single Volume { get; set; }
WaveSource
The currently initialized source. To change the WaveSource property, call Initialize.
public IWaveSource WaveSource { get; }
Remarks
The value of the WaveSource might not be the value which was passed to the Initialize method, because WaveOut uses the VolumeSource class to control the volume of the playback.