forked from xiaozhi/xiaozhi-esp32
* 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
766 B
C++
27 lines
766 B
C++
#ifndef AUDIO_PROCESSOR_H
|
|
#define AUDIO_PROCESSOR_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <functional>
|
|
|
|
#include <model_path.h>
|
|
#include "audio_codec.h"
|
|
|
|
class AudioProcessor {
|
|
public:
|
|
virtual ~AudioProcessor() = default;
|
|
|
|
virtual void Initialize(AudioCodec* codec, int frame_duration_ms, srmodel_list_t* models_list) = 0;
|
|
virtual void Feed(std::vector<int16_t>&& data) = 0;
|
|
virtual void Start() = 0;
|
|
virtual void Stop() = 0;
|
|
virtual bool IsRunning() = 0;
|
|
virtual void OnOutput(std::function<void(std::vector<int16_t>&& data)> callback) = 0;
|
|
virtual void OnVadStateChange(std::function<void(bool speaking)> callback) = 0;
|
|
virtual size_t GetFeedSize() = 0;
|
|
virtual void EnableDeviceAec(bool enable) = 0;
|
|
};
|
|
|
|
#endif
|