Events (2) Methods (9) Properties (4)
Namespace: CSCore.SoundIn

Syntax

public class WaveIn : ISoundIn

Implements

Summary

Captures audio from a audio device (through WaveIn Apis).

Uses

Events

DataAvailable

Occurs when new data got captured and is available.

public DataAvailable

Stopped

Occurs when the recording stopped.

public Stopped

Methods

WaveIn()

Initializes a new instance of the WaveIn class using the a default format (44.1kHz, 16 bit, 2 channels, pcm).

public void WaveIn()

WaveIn(WaveFormat waveFormat)

Initializes a new instance of the WaveIn class.

public void WaveIn(WaveFormat waveFormat)

Parameters

waveFormat

WaveFormat

The default format to use. The final format must not equal the specified waveFormat.

Exceptions

System.ArgumentNullException

waveFormat

CreateWaveInHandle(WaveFormat waveFormat)

Creates and returns the WaveOut handle.

protected virtual IntPtr CreateWaveInHandle(WaveFormat waveFormat)

Parameters

waveFormat

WaveFormat

The waveformat to use.

Returns

A valid WaveOut handle.

Dispose()

Disposes and stops the WaveIn instance.

public void Dispose()

Dispose(Boolean disposing)

Disposes and stops the WaveIn instance.

protected virtual void Dispose(Boolean disposing)

Parameters

disposing

Boolean

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Finalize()

Finalizes an instance of the WaveIn class.

protected void Finalize()

Initialize()

Initializes the WaveIn instance.

public void Initialize()

Exceptions

System.InvalidOperationException

RecordingState has to be Stopped. Call Stop to stop.

Start()

Starts recording.

public void Start()

Stop()

Stops recording.

public void Stop()

Properties

Device

Gets or sets the Device which should be used for capturing audio. The Device property has to be set before initializing. The systems default recording device is used as default value of the Device property.

public WaveInDevice Device { get; set; }

Exceptions

ArgumentNullException

The value must not be null.

Latency

Gets or sets the latency of the wavein specified in milliseconds. The Latency property has to be set before initializing.

public Int32 Latency { get; set; }

RecordingState

Gets the current RecordingState.

public RecordingState RecordingState { get; set; }

WaveFormat

Gets the format of the captured audio data.

public WaveFormat WaveFormat { get; set; }