| | |
| | | void OnOfflineCommandDetected(std::function<void(const std::string& command)> callback); |
| | | void Start(); |
| | | void Stop(); |
| | | void ReleaseRuntime() override; |
| | | bool EnsureRuntime() override; |
| | | void ClearWakeBuffers() override; |
| | | void AbortWakeWordEncode() override; |
| | | size_t GetFeedSize(); |
| | | void EncodeWakeWordData(); |
| | | bool GetWakeWordOpus(std::vector<uint8_t>& opus); |
| | |
| | | TaskHandle_t wake_word_encode_task_ = nullptr; |
| | | StaticTask_t* wake_word_encode_task_buffer_ = nullptr; |
| | | StackType_t* wake_word_encode_task_stack_ = nullptr; |
| | | TaskHandle_t detection_task_handle_ = nullptr; |
| | | StaticTask_t* detection_task_buffer_ = nullptr; |
| | | StackType_t* detection_task_stack_ = nullptr; |
| | | std::deque<std::vector<int16_t>> wake_word_pcm_; |
| | | std::deque<std::vector<uint8_t>> wake_word_opus_; |
| | | std::mutex wake_word_mutex_; |
| | | std::condition_variable wake_word_cv_; |
| | | |
| | | bool detection_task_started_ = false; |
| | | |
| | | bool CreateAfe(); |
| | | bool EnsureDetectionTask(); |
| | | void StoreWakeWordData(const int16_t* data, size_t size); |
| | | void AudioDetectionTask(); |
| | | }; |