forked from xiaozhi/xiaozhi-esp32
Allow 10 audio packets in recv queue
This commit is contained in:
@@ -392,7 +392,7 @@ void Application::Start() {
|
|||||||
Alert(Lang::Strings::ERROR, message.c_str(), "sad", Lang::Sounds::P3_EXCLAMATION);
|
Alert(Lang::Strings::ERROR, message.c_str(), "sad", Lang::Sounds::P3_EXCLAMATION);
|
||||||
});
|
});
|
||||||
protocol_->OnIncomingAudio([this](std::vector<uint8_t>&& data) {
|
protocol_->OnIncomingAudio([this](std::vector<uint8_t>&& data) {
|
||||||
const int max_packets_in_queue = 300 / OPUS_FRAME_DURATION_MS;
|
const int max_packets_in_queue = 600 / OPUS_FRAME_DURATION_MS;
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
std::lock_guard<std::mutex> lock(mutex_);
|
||||||
if (audio_decode_queue_.size() < max_packets_in_queue) {
|
if (audio_decode_queue_.size() < max_packets_in_queue) {
|
||||||
audio_decode_queue_.emplace_back(std::move(data));
|
audio_decode_queue_.emplace_back(std::move(data));
|
||||||
|
|||||||
Reference in New Issue
Block a user