mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-01-13 16:57:17 +08:00
* Adapt boards to v2 partition tables * fix esp log error * fix display style * reset emotion after download assets * fix compiling * update assets default url * Add user only tools * Add image cache * smaller cache and buffer, more heap * use MAIN_EVENT_CLOCK_TICK to avoid audio glitches * bump to 2.0.0 * fix compiling errors --------- Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
27 lines
743 B
C++
27 lines
743 B
C++
#ifndef WAKE_WORD_H
|
|
#define WAKE_WORD_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <functional>
|
|
|
|
#include <model_path.h>
|
|
#include "audio_codec.h"
|
|
|
|
class WakeWord {
|
|
public:
|
|
virtual ~WakeWord() = default;
|
|
|
|
virtual bool Initialize(AudioCodec* codec, srmodel_list_t* models_list) = 0;
|
|
virtual void Feed(const std::vector<int16_t>& data) = 0;
|
|
virtual void OnWakeWordDetected(std::function<void(const std::string& wake_word)> callback) = 0;
|
|
virtual void Start() = 0;
|
|
virtual void Stop() = 0;
|
|
virtual size_t GetFeedSize() = 0;
|
|
virtual void EncodeWakeWordData() = 0;
|
|
virtual bool GetWakeWordOpus(std::vector<uint8_t>& opus) = 0;
|
|
virtual const std::string& GetLastDetectedWakeWord() const = 0;
|
|
};
|
|
|
|
#endif
|