separate encoder for detect word

This commit is contained in:
Terrence
2024-09-04 13:36:20 +08:00
parent 10574dd2bc
commit bad888e3ec
3 changed files with 30 additions and 12 deletions

View File

@@ -16,8 +16,10 @@ public:
~OpusEncoder();
void Configure(int sample_rate, int channels, int duration_ms = 60);
void SetComplexity(int complexity);
void Encode(const iovec pcm, std::function<void(const iovec opus)> handler);
bool IsBufferEmpty() const { return in_buffer_.empty(); }
void ResetState();
private:
struct OpusEncoder* audio_enc_ = nullptr;