}
}
+ int burst_count = 0;
while (!(mStopStreamingThread.load())) {
int ret = -1;
int cnt = 0;
/* waiting */
while (!(mStopStreamingThread.load())) {
+ burst_count = 0;
this_thread::sleep_for(chrono::milliseconds(10));
if (index < interface->get_utterance_data_count()) {
MWR_LOGD("[INFO] Resume thread");
}
}
#endif
+ const int sleep_duration_in_millis = 10;
+ const int max_burst_count = 3;
+ if (++burst_count >= max_burst_count) {
+ burst_count = 0;
+ this_thread::sleep_for(chrono::milliseconds(sleep_duration_in_millis));
+ MWR_LOGI("[INFO] Streaming data burst transmission detected, forcing sleep");
+ }
for (const auto& observer : mObservers) {
if (observer) {
if (!observer->on_streaming_audio_data(