C# 클래스 Accord.DirectSound.AudioCaptureDevice

Audio source for local audio capture device (i.e. a microphone).

This audio source captures audio data obtained from a local audio capture device such as the microphone. The audio is captured using DirectSound through SlimDX.

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

상속: IAudioSource, IDisposable
파일 보기 프로젝트 열기: accord-net/framework 1 사용 예제들

공개 메소드들

메소드 설명
AudioCaptureDevice ( ) : Accord.Audio

Initializes a new instance of the AudioCaptureDevice class.

AudioCaptureDevice ( AudioDeviceInfo device ) : Accord.Audio

Initializes a new instance of the AudioCaptureDevice class.

AudioCaptureDevice ( System.Guid device ) : Accord.Audio

Initializes a new instance of the AudioCaptureDevice class.

AudioCaptureDevice ( System.Guid device, string name ) : Accord.Audio

Initializes a new instance of the AudioCaptureDevice class.

Dispose ( ) : void

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

Seek ( int frameIndex ) : void

This source does not support seeking.

SignalToStop ( ) : void

Signals audio source to stop its work.

Signals audio source to stop its background thread, stop to provide new frames and free resources.

Start ( ) : void

Start audio source.

Starts audio source and return execution to caller. audio source object creates background thread and notifies about new frames with the help of NewFrame event.

Stop ( ) : void

Stop audio source.

Stops audio source aborting its thread.

Since the method aborts background thread, its usage is highly not preferred and should be done only if there are no other options. The correct way of stopping camera is signaling it stop and then waiting for background thread's completion.

WaitForStop ( ) : void

Wait for audio source has stopped.

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

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

OnNewFrame ( Array frame ) : void

Notifies client about new block of frames.

비공개 메소드들

메소드 설명
Free ( ) : void

Free resource.

WorkerThread ( ) : void

Worker thread.

메소드 상세

AudioCaptureDevice() 공개 메소드

Initializes a new instance of the AudioCaptureDevice class.
public AudioCaptureDevice ( ) : Accord.Audio
리턴 Accord.Audio

AudioCaptureDevice() 공개 메소드

Initializes a new instance of the AudioCaptureDevice class.
public AudioCaptureDevice ( AudioDeviceInfo device ) : Accord.Audio
device AudioDeviceInfo
리턴 Accord.Audio

AudioCaptureDevice() 공개 메소드

Initializes a new instance of the AudioCaptureDevice class.
public AudioCaptureDevice ( System.Guid device ) : Accord.Audio
device System.Guid Global identifier of the audio capture device.
리턴 Accord.Audio

AudioCaptureDevice() 공개 메소드

Initializes a new instance of the AudioCaptureDevice class.
public AudioCaptureDevice ( System.Guid device, string name ) : Accord.Audio
device System.Guid Global identifier of the audio capture device.
name string The device name or description string.
리턴 Accord.Audio

Dispose() 공개 메소드

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

Dispose() 보호된 메소드

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.
리턴 void

OnNewFrame() 보호된 메소드

Notifies client about new block of frames.
protected OnNewFrame ( Array frame ) : void
frame System.Array New frame's audio.
리턴 void

Seek() 공개 메소드

This source does not support seeking.
public Seek ( int frameIndex ) : void
frameIndex int
리턴 void

SignalToStop() 공개 메소드

Signals audio source to stop its work.
Signals audio source to stop its background thread, stop to provide new frames and free resources.
public SignalToStop ( ) : void
리턴 void

Start() 공개 메소드

Start audio source.
Starts audio source and return execution to caller. audio source object creates background thread and notifies about new frames with the help of NewFrame event.
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stop audio source.

Stops audio source aborting its thread.

Since the method aborts background thread, its usage is highly not preferred and should be done only if there are no other options. The correct way of stopping camera is signaling it stop and then waiting for background thread's completion.

public Stop ( ) : void
리턴 void

WaitForStop() 공개 메소드

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