Add vad clear api for better performance (#366)
* Add vad clear api for better performance * rename to make naming consistent and remove macro * Fix linker error * Fix Vad.kt
This commit is contained in:
@@ -76,6 +76,8 @@ class VoiceActivityDetector::Impl {
|
||||
|
||||
void Pop() { segments_.pop(); }
|
||||
|
||||
void Clear() { std::queue<SpeechSegment>().swap(segments_); }
|
||||
|
||||
const SpeechSegment &Front() const { return segments_.front(); }
|
||||
|
||||
void Reset() {
|
||||
@@ -121,6 +123,8 @@ bool VoiceActivityDetector::Empty() const { return impl_->Empty(); }
|
||||
|
||||
void VoiceActivityDetector::Pop() { impl_->Pop(); }
|
||||
|
||||
void VoiceActivityDetector::Clear() { impl_->Clear(); }
|
||||
|
||||
const SpeechSegment &VoiceActivityDetector::Front() const {
|
||||
return impl_->Front();
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ class VoiceActivityDetector {
|
||||
void AcceptWaveform(const float *samples, int32_t n);
|
||||
bool Empty() const;
|
||||
void Pop();
|
||||
void Clear();
|
||||
const SpeechSegment &Front() const;
|
||||
|
||||
bool IsSpeechDetected() const;
|
||||
|
||||
Reference in New Issue
Block a user