Show / Hide Table of Contents

Class AudioProcessor

Inheritance
System.Object
AudioProcessor
Namespace: Speechly.Tools
Assembly: speechly-dotnet.dll
Syntax
public class AudioProcessor : object

Constructors

| Improve this Doc View Source

AudioProcessor(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 Source

OnSendAudio

Declaration
public AudioProcessor.SendAudioDelegate OnSendAudio
Field Value
Type Description
AudioProcessor.SendAudioDelegate
| Improve this Doc View Source

OnVadStateChange

Declaration
public AudioProcessor.VadChangeDelegate OnVadStateChange
Field Value
Type Description
AudioProcessor.VadChangeDelegate

Properties

| Improve this Doc View Source

Options

Declaration
public AudioProcessorOptions Options { get; }
Property Value
Type Description
AudioProcessorOptions
| Improve this Doc View Source

Output

Declaration
public AudioInfo Output { get; }
Property Value
Type Description
AudioInfo
| Improve this Doc View Source

Vad

Declaration
public EnergyThresholdVAD Vad { get; }
Property Value
Type Description
EnergyThresholdVAD

Methods

| Improve this Doc View Source

ProcessAudio(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: 0).

System.Int32 length

Length of audio to process in samples or -1 to process the whole array (default: -1).

System.Boolean forceSubFrameProcess

Forces processing of last subframe at end of audio stream (default: false).

| Improve this Doc View Source

Reset(Int32)

Declaration
public void Reset(int inputSampleRate = 0)
Parameters
Type Name Description
System.Int32 inputSampleRate
| Improve this Doc View Source

Start()

Declaration
public void Start()
| Improve this Doc View Source

Stop()

Declaration
public void Stop()
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX