Class SpeexDSPPreprocessor
Speexdsp preprocessor.
Inherited Members
Namespace: SpeexDSPSharp.Core
Assembly: SpeexDSPSharp.Core.dll
Syntax
public class SpeexDSPPreprocessor
Constructors
| Edit this page View SourceSpeexDSPPreprocessor(int, int)
Creates a new speexdsp echo canceler.
Declaration
public SpeexDSPPreprocessor(int frame_size, int sample_rate)
Parameters
Type | Name | Description |
---|---|---|
int | frame_size | Number of samples to process at one time (should correspond to 10-20 ms). Must be the same value as that used for the echo canceller for residual echo cancellation to work. |
int | sample_rate | Sampling rate used for the input. |
Fields
| Edit this page View Source_handler
Direct safe handle for the SpeexDSPPreprocessor. IT IS NOT RECOMMENDED TO CLOSE THE HANDLE DIRECTLY! Instead use Dispose(bool) to dispose the handle and object safely.
Declaration
protected readonly SpeexDSPPreprocessStateSafeHandler _handler
Field Value
Type | Description |
---|---|
SpeexDSPPreprocessStateSafeHandler |
Methods
| Edit this page View SourceCheckError(int)
Checks if there is a speexdsp error and throws if the error is a negative value.
Declaration
protected static void CheckError(int error)
Parameters
Type | Name | Description |
---|---|---|
int | error | The error code to input. |
Exceptions
Type | Condition |
---|---|
SpeexDSPException |
Ctl<T>(PreprocessorCtl, ref T)
Performs a ctl request.
Declaration
public int Ctl<T>(PreprocessorCtl request, ref T value) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
PreprocessorCtl | request | The request you want to specify. |
T | value | The input/output value. |
Returns
Type | Description |
---|---|
int |
Type Parameters
Name | Description |
---|---|
T | The type you want to input/output. |
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Dispose logic.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | Set to true if fully disposing. |
EstimateUpdate(byte[])
Update preprocessor state, but do not compute the output.
Declaration
public void EstimateUpdate(byte[] x)
Parameters
Type | Name | Description |
---|---|---|
byte[] | x | Audio sample vector (in only). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
EstimateUpdate(short[])
Update preprocessor state, but do not compute the output.
Declaration
public void EstimateUpdate(short[] x)
Parameters
Type | Name | Description |
---|---|---|
short[] | x | Audio sample vector (in only). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
EstimateUpdate(float[])
Update preprocessor state, but do not compute the output.
Declaration
public void EstimateUpdate(float[] x)
Parameters
Type | Name | Description |
---|---|---|
float[] | x | Audio sample vector (in only). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
EstimateUpdate(Span<byte>)
Update preprocessor state, but do not compute the output.
Declaration
public void EstimateUpdate(Span<byte> x)
Parameters
Type | Name | Description |
---|---|---|
Span<byte> | x | Audio sample vector (in only). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
EstimateUpdate(Span<short>)
Update preprocessor state, but do not compute the output.
Declaration
public void EstimateUpdate(Span<short> x)
Parameters
Type | Name | Description |
---|---|---|
Span<short> | x | Audio sample vector (in only). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
EstimateUpdate(Span<float>)
Update preprocessor state, but do not compute the output.
Declaration
public void EstimateUpdate(Span<float> x)
Parameters
Type | Name | Description |
---|---|---|
Span<float> | x | Audio sample vector (in only). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
~SpeexDSPPreprocessor()
Speexdsp preprocessor destructor.
Declaration
protected ~SpeexDSPPreprocessor()
Run(byte[])
Preprocess a frame.
Declaration
public int Run(byte[] x)
Parameters
Type | Name | Description |
---|---|---|
byte[] | x | Audio sample vector (in and out). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
Returns
Type | Description |
---|---|
int | Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on. |
Run(short[])
Preprocess a frame.
Declaration
public int Run(short[] x)
Parameters
Type | Name | Description |
---|---|---|
short[] | x | Audio sample vector (in and out). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
Returns
Type | Description |
---|---|
int | Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on. |
Run(float[])
Preprocess a frame.
Declaration
public int Run(float[] x)
Parameters
Type | Name | Description |
---|---|---|
float[] | x | Audio sample vector (in and out). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
Returns
Type | Description |
---|---|
int | Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on. |
Run(Span<byte>)
Preprocess a frame.
Declaration
public int Run(Span<byte> x)
Parameters
Type | Name | Description |
---|---|---|
Span<byte> | x | Audio sample vector (in and out). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
Returns
Type | Description |
---|---|
int | Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on. |
Run(Span<short>)
Preprocess a frame.
Declaration
public int Run(Span<short> x)
Parameters
Type | Name | Description |
---|---|---|
Span<short> | x | Audio sample vector (in and out). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
Returns
Type | Description |
---|---|
int | Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on. |
Run(Span<float>)
Preprocess a frame.
Declaration
public int Run(Span<float> x)
Parameters
Type | Name | Description |
---|---|---|
Span<float> | x | Audio sample vector (in and out). Must be same size as specified in SpeexDSPPreprocessor(int, int). |
Returns
Type | Description |
---|---|
int | Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on. |
ThrowIfDisposed()
Throws an exception if this object is disposed or the handler is closed.
Declaration
protected virtual void ThrowIfDisposed()
Exceptions
Type | Condition |
---|---|
ObjectDisposedException |