diff --git a/frontend/react/src/audio/texttospeechsource.ts b/frontend/react/src/audio/texttospeechsource.ts index a53651f7..a1aeeef2 100644 --- a/frontend/react/src/audio/texttospeechsource.ts +++ b/frontend/react/src/audio/texttospeechsource.ts @@ -72,6 +72,7 @@ export class TextToSpeechSource extends AudioSource { /* Start playing the file at the selected position */ this.#source.start(0, this.#currentPosition); this.#playing = true; + this.getConnectedTo().forEach((sink) => sink.setPtt(true)); const now = Date.now() / 1000; this.#lastUpdateTime = now; @@ -102,6 +103,7 @@ export class TextToSpeechSource extends AudioSource { this.#source.stop(); this.#source.disconnect(); this.#playing = false; + this.getConnectedTo().forEach((sink) => sink.setPtt(false)); const now = Date.now() / 1000; this.#currentPosition += now - this.#lastUpdateTime; diff --git a/frontend/react/src/ui/panels/components/unitsinkpanel.tsx b/frontend/react/src/ui/panels/components/unitsinkpanel.tsx index 22ecb7e5..0dcf60e7 100644 --- a/frontend/react/src/ui/panels/components/unitsinkpanel.tsx +++ b/frontend/react/src/ui/panels/components/unitsinkpanel.tsx @@ -80,12 +80,8 @@ export const UnitSinkPanel = forwardRef((props: { sink: UnitSink; shortcutKeys: {}} - onMouseDown={() => { - props.sink.setPtt(true); - }} - onMouseUp={() => { - props.sink.setPtt(false); + onClick={() => { + props.sink.setPtt(!props.sink.getPtt()); }} tooltip="Talk on frequency" >