C# Class Accord.DirectSound.AudioOutputDevice

Audio output device for local audio playback (i.e. a sound card port).

This audio output sends audio data to a local output device such as a sound card. The audio is reproduced using DirectSound through SlimDX.

For instructions on how to list output devices, please see the AudioDeviceCollection documentation page.

Inheritance: IAudioOutput, IDisposable
Mostra file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
AudioOutputDevice ( System.Guid device, IntPtr owner, int samplingRate, int channels ) : Accord.Audio

Constructs a new Audio Output Device.

AudioOutputDevice ( IntPtr owner, int samplingRate, int channels ) : Accord.Audio

Constructs a new Audio Output Device.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Play ( ) : void

Starts playing the current buffer.

Play ( float samples ) : void

Starts playing the current buffer.

SignalToStop ( ) : void

Signals audio output to stop its work.

Signals audio output to stop its background thread, stop to ask for new frames and free resources.

Stop ( ) : void

Stops playing the current buffer.

WaitForStop ( ) : void

Wait for audio output has stopped.

Waits for output stopping after it was signaled to stop using SignalToStop method.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

Private Methods

Method Description
OnFramePlayingStarted ( PlayFrameEventArgs e ) : void
OnStopped ( EventArgs e ) : void
WorkerThread ( ) : void

Worker thread.

Method Details

AudioOutputDevice() public method

Constructs a new Audio Output Device.
public AudioOutputDevice ( System.Guid device, IntPtr owner, int samplingRate, int channels ) : Accord.Audio
device System.Guid Global identifier of the audio output device.
owner System.IntPtr The owner window handle.
samplingRate int The sampling rate of the device.
channels int The number of channels of the device.
return Accord.Audio

AudioOutputDevice() public method

Constructs a new Audio Output Device.
public AudioOutputDevice ( IntPtr owner, int samplingRate, int channels ) : Accord.Audio
owner System.IntPtr The owner window handle.
samplingRate int The sampling rate of the device.
channels int The number of channels of the device.
return Accord.Audio

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged /// resources; false to release only unmanaged resources.
return void

Play() public method

Starts playing the current buffer.
public Play ( ) : void
return void

Play() public method

Starts playing the current buffer.
public Play ( float samples ) : void
samples float
return void

SignalToStop() public method

Signals audio output to stop its work.
Signals audio output to stop its background thread, stop to ask for new frames and free resources.
public SignalToStop ( ) : void
return void

Stop() public method

Stops playing the current buffer.
public Stop ( ) : void
return void

WaitForStop() public method

Wait for audio output has stopped.
Waits for output stopping after it was signaled to stop using SignalToStop method.
public WaitForStop ( ) : void
return void