Allow 10 audio packets in recv queue

This commit is contained in:
Terrence
2025-04-28 11:19:28 +08:00
parent a8ba7e75fe
commit 6fbf272613

View File

@@ -392,7 +392,7 @@ void Application::Start() {
Alert(Lang::Strings::ERROR, message.c_str(), "sad", Lang::Sounds::P3_EXCLAMATION);
});
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_);
if (audio_decode_queue_.size() < max_packets_in_queue) {
audio_decode_queue_.emplace_back(std::move(data));