FVoiceProcessor
FVoiceProcessor — SpeexDSP's echo canceller and speech preprocessor around one voice capture stream, 20 ms frame in, 20 ms frame out.
- Module
- VoiceChat
- Header
#include "VoiceChat/FVoiceProcessor.h"- Namespace
Mowo
The far end the canceller subtracts is fed in by the caller, one frame per frame of voice it played; this processor keeps a short queue of them and takes one per captured frame, so small drift between the playback and capture clocks is absorbed rather than warned about. With nothing played there is nothing to cancel, and the canceller is skipped rather than run against silence.
Properties
| Type | Name | Description |
|---|---|---|
static constexpr uint32_t | kMaxFarEndFrames | Default 16. |
Constructors
| Signature | Name | Description |
|---|---|---|
FVoiceProcessor() | FVoiceProcessor | |
~FVoiceProcessor() | ~FVoiceProcessor | |
FVoiceProcessor(const FVoiceProcessor&) = delete | FVoiceProcessor |
Public functions
| Returns | Name | Description |
|---|---|---|
FVoiceProcessor& | operator= | |
bool | Configure | Rebuilds the states for a format; false when the format is unusable. |
void | Shutdown | |
void | Reset | Forgets what the canceller and the noise estimate have learned — after a device change the room and the microphone are different. |
bool | IsActive | |
const FVoiceProcessorSettings& | GetSettings | |
uint32_t | GetFrameSamples | |
uint32_t | GetSampleRate | |
void | PushFarEnd | One frame of what the speakers played. |
uint32_t | GetQueuedFarEnd | |
bool | Process | In place, on one captured frame. |
int32_t | GetAutoGainDb | What the automatic gain is currently adding, in dB, and the speech probability of the last frame, 0-100. |
int32_t | GetSpeechProbability | |
uint64_t | GetFramesProcessed | |
uint64_t | GetFramesEchoCancelled |
Function details
FVoiceProcessor
FVoiceProcessor()~FVoiceProcessor
~FVoiceProcessor()FVoiceProcessor
FVoiceProcessor(const FVoiceProcessor&) = deleteoperator=
FVoiceProcessor& operator=(const FVoiceProcessor&) = deleteConfigure
bool Configure(uint32_t sampleRate, uint32_t frameSamples, const FVoiceProcessorSettings& settings)Rebuilds the states for a format; false when the format is unusable. Every stage off leaves the processor inactive and Process a no-op.
Shutdown
void Shutdown()Reset
void Reset()Forgets what the canceller and the noise estimate have learned — after a device change the room and the microphone are different.
IsActive
bool IsActive() constGetSettings
const FVoiceProcessorSettings& GetSettings() constGetFrameSamples
uint32_t GetFrameSamples() constGetSampleRate
uint32_t GetSampleRate() constPushFarEnd
void PushFarEnd(const int16_t* samples, uint32_t count)One frame of what the speakers played. A frame of the wrong size is ignored.
GetQueuedFarEnd
uint32_t GetQueuedFarEnd() constProcess
bool Process(int16_t* frame, uint32_t count)In place, on one captured frame. False when the frame is the wrong size and was left alone.
GetAutoGainDb
int32_t GetAutoGainDb() constWhat the automatic gain is currently adding, in dB, and the speech probability of the last frame, 0-100.
GetSpeechProbability
int32_t GetSpeechProbability() constGetFramesProcessed
uint64_t GetFramesProcessed() constGetFramesEchoCancelled
uint64_t GetFramesEchoCancelled() const