Skip to content

Commit 328792d

Browse files
committed
fix: show spinner when microphone is calibrating
AdminForth/1806/add-spinner-when-agent-is-cali
1 parent 6a5c5e5 commit 328792d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

custom/speech_recognition_frontend/MicrophoneButon.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
:isRecording="microphoneButtonMode === 'listen'"
2828
:amplitude="audioAmplitude"
2929
/>
30+
<Spinner v-if="isPolling" class="ml-2 w-4 h-4 text-lightButtonsText dark:text-darkButtonsText fill-lightButtonsBackground dark:fill-darkPrimary" />
3031
</div>
3132
<div v-else-if="microphoneButtonMode === 'generating'" class="flex items-center justify-center gap-2 text-white text-sm">
3233
<span class="w-3 h-3 bg-white rounded-sm" />
@@ -65,6 +66,7 @@ const hideAnimationDebounced = debounce(() => {
6566
const sendUserRecordDebounced = debounce(() => {
6667
sendRecordForTranscription();
6768
}, 500);
69+
const isPolling = ref(false);
6870
6971
const isAudioChatMode = computed(() => agentStore.isAudioChatMode);
7072
@@ -116,8 +118,10 @@ function toggleChatMode() {
116118
}
117119
118120
async function onStartRecording() {
121+
isPolling.value = true;
119122
await unlockAudio();
120123
await requestMicAndStartVAD(saidSomething, stopRecording, onAnySound);
124+
isPolling.value = false;
121125
microphoneButtonMode.value = 'listen';
122126
agentAudio.playBeep(1000);
123127
}

0 commit comments

Comments
 (0)