feat(voice): migrate to push2talk and serialize websocket text sends
This commit is contained in:
@@ -27,6 +27,7 @@ void voice_uplink_task(void *arg) {
|
||||
bool connected = false;
|
||||
bool started = false;
|
||||
bool tap_active = false;
|
||||
bool speech_active = false;
|
||||
bool listening = false;
|
||||
|
||||
if (voice_lock(VOICE_STATUS_LOCK_TIMEOUT_MS)) {
|
||||
@@ -34,6 +35,7 @@ void voice_uplink_task(void *arg) {
|
||||
connected = s_voice.ws_connected;
|
||||
started = s_voice.started;
|
||||
tap_active = s_voice.tap_active;
|
||||
speech_active = s_voice.speech_active;
|
||||
listening = (s_voice.dialog_state == VOICE_DIALOG_STATE_LISTENING);
|
||||
voice_unlock();
|
||||
}
|
||||
@@ -42,7 +44,7 @@ void voice_uplink_task(void *arg) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(connected && started && listening && tap_active)) {
|
||||
if (!(connected && started && listening && tap_active && speech_active)) {
|
||||
vTaskDelay(pdMS_TO_TICKS(20));
|
||||
continue;
|
||||
}
|
||||
@@ -83,6 +85,7 @@ void voice_uplink_task(void *arg) {
|
||||
s_voice.ws_connected = false;
|
||||
s_voice.started = false;
|
||||
s_voice.tap_active = false;
|
||||
s_voice.speech_active = false;
|
||||
s_voice.dialog_state = VOICE_DIALOG_STATE_IDLE;
|
||||
s_voice.last_event_ms = voice_now_ms();
|
||||
ESP_LOGW(TAG, "[stage] uplink_detected_ws_disconnected");
|
||||
|
||||
Reference in New Issue
Block a user