From bf1d270263809ed659dffbd74891c44ec4fa2909 Mon Sep 17 00:00:00 2001 From: Remi <73385395+itsrubberduck@users.noreply.github.com> Date: Fri, 19 Sep 2025 13:52:46 +0200 Subject: [PATCH] Add ATC speech speed control --- app/pages/pm.vue | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/app/pages/pm.vue b/app/pages/pm.vue index 7e8b4a4..8ab2748 100644 --- a/app/pages/pm.vue +++ b/app/pages/pm.vue @@ -857,6 +857,24 @@ /> +
+
+ + {{ speechSpeedLabel }} +
+ +
+
{ return { color: 'error', text: 'WEAK' } }) +const speechSpeedLabel = computed(() => `${speechSpeed.value.toFixed(2)}x`) + const completedPilotSteps = computed(() => simulationTrace.value.filter(entry => entry.kind === 'pilot').length) const atisFrequencyEntry = computed(() => airportFrequencies.value.find(entry => entry.type === 'ATIS')) @@ -1437,11 +1458,12 @@ const playAudioWithEffects = async (base64: string, mime = 'audio/wav') => { const speakPrepared = async (prepared: PreparedSpeech, options: SpeechOptions = {}) => { try { + const speed = options.speed ?? speechSpeed.value const response = await api.post('/api/atc/say', { text: options.useNormalizedForTTS === false ? prepared.plain : prepared.normalized, level: signalStrength.value, voice: options.voice || 'alloy', - speed: 0.95, + speed, moduleId: 'pilot-monitoring', lessonId: currentState.value?.id || 'general', tag: options.tag || 'controller-reply' @@ -1475,7 +1497,7 @@ const speakPlainText = (text: string, options: SpeechOptions = {}) => { return Promise.resolve() } - const speed = options.speed ?? 0.95 + const speed = options.speed ?? speechSpeed.value const lessonId = options.lessonId || currentState.value?.id || 'general' return enqueueSpeech(async () => {