add testing

This commit is contained in:
Terrence
2024-09-14 14:58:03 +08:00
parent 140ed56ee9
commit e46016b3fc
3 changed files with 107 additions and 31 deletions

View File

@@ -27,7 +27,8 @@ enum ChatState {
kChatStateConnecting,
kChatStateListening,
kChatStateSpeaking,
kChatStateWakeWordDetected
kChatStateWakeWordDetected,
kChatStateTesting
};
class Application {
@@ -76,6 +77,8 @@ private:
int opus_duration_ms_ = 60;
int opus_decode_sample_rate_ = CONFIG_AUDIO_OUTPUT_SAMPLE_RATE;
OpusResampler opus_resampler_;
OpusResampler test_resampler_;
std::vector<iovec> test_pcm_;
TaskHandle_t wake_word_encode_task_ = nullptr;
StaticTask_t wake_word_encode_task_buffer_;
@@ -91,7 +94,9 @@ private:
void StoreWakeWordData(uint8_t* data, size_t size);
void EncodeWakeWordData();
void SendWakeWordData();
void CheckTestButton();
void PlayTestAudio();
void AudioFeedTask();
void AudioDetectionTask();
void AudioCommunicationTask();