Class AudioProcessor
Inheritance
System.Object
AudioProcessor
Namespace: Speechly.Tools
Assembly: speechly-dotnet.dll
Syntax
public class AudioProcessor : object
Constructors
| Improve this Doc View SourceAudioProcessor(AudioProcessorOptions, AudioInfo, Boolean)
Declaration
public AudioProcessor(AudioProcessorOptions options, AudioInfo output, bool debug = false)
Parameters
Type | Name | Description |
---|---|---|
AudioProcessorOptions | options | |
AudioInfo | output | |
System.Boolean | debug |
Fields
| Improve this Doc View SourceOnSendAudio
Declaration
public AudioProcessor.SendAudioDelegate OnSendAudio
Field Value
Type | Description |
---|---|
AudioProcessor.SendAudioDelegate |
OnVadStateChange
Declaration
public AudioProcessor.VadChangeDelegate OnVadStateChange
Field Value
Type | Description |
---|---|
AudioProcessor.VadChangeDelegate |
Properties
| Improve this Doc View SourceOptions
Declaration
public AudioProcessorOptions Options { get; }
Property Value
Type | Description |
---|---|
AudioProcessorOptions |
Output
Declaration
public AudioInfo Output { get; }
Property Value
Type | Description |
---|---|
AudioInfo |
Vad
Declaration
public EnergyThresholdVAD Vad { get; }
Property Value
Type | Description |
---|---|
EnergyThresholdVAD |
Methods
| Improve this Doc View SourceProcessAudio(Single[], Int32, Int32, Boolean)
Process speech audio samples from a microphone or other audio source.
It's recommended to constantly feed new audio as long as you want to use Speechly's SLU services.
You can control when to start and stop process speech either manually with Start() and Stop() or
automatically by providing a voice activity detection (VAD) field to
The audio is handled as follows:
- Downsample to 16kHz if needed
- Add to history ringbuffer
- Calculate energy (VAD)
- Automatic Start/Stop (VAD)
- Send utterance audio to a file
- Send utterance audio to Speechly SLU decoder
Declaration
public void ProcessAudio(float[] floats, int start = 0, int length = null, bool forceSubFrameProcess = false)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | floats | Array of float containing samples to feed to the audio pipeline. Each sample needs to be in range -1f..1f. |
System.Int32 | start | Start index of audio to process in samples (default: |
System.Int32 | length | Length of audio to process in samples or |
System.Boolean | forceSubFrameProcess | Forces processing of last subframe at end of audio stream (default: |
Reset(Int32)
Declaration
public void Reset(int inputSampleRate = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | inputSampleRate |
Start()
Declaration
public void Start()
Stop()
Declaration
public void Stop()