forked from xiaozhi/xiaozhi-esp32
Add wake word to xmini-c3 (#730)
* esp-hi: MCP protocol is not ready yet * Add wake word to xmini-c3
This commit is contained in:
26
main/audio_processing/wake_word.h
Normal file
26
main/audio_processing/wake_word.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef WAKE_WORD_H
|
||||
#define WAKE_WORD_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
#include "audio_codec.h"
|
||||
|
||||
class WakeWord {
|
||||
public:
|
||||
virtual ~WakeWord() = default;
|
||||
|
||||
virtual void Initialize(AudioCodec* codec) = 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 StartDetection() = 0;
|
||||
virtual void StopDetection() = 0;
|
||||
virtual bool IsDetectionRunning() = 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
|
||||
Reference in New Issue
Block a user