diff --git a/res/media/error.mp3 b/res/media/error.mp3 new file mode 100644 index 00000000000..14c710595b5 Binary files /dev/null and b/res/media/error.mp3 differ diff --git a/res/media/error.ogg b/res/media/error.ogg new file mode 100644 index 00000000000..00a3ebc775a Binary files /dev/null and b/res/media/error.ogg differ diff --git a/src/voice-broadcast/models/VoiceBroadcastRecording.ts b/src/voice-broadcast/models/VoiceBroadcastRecording.ts index af69b7b710c..53ab42a1852 100644 --- a/src/voice-broadcast/models/VoiceBroadcastRecording.ts +++ b/src/voice-broadcast/models/VoiceBroadcastRecording.ts @@ -46,6 +46,7 @@ import { ActionPayload } from "../../dispatcher/payloads"; import { VoiceBroadcastChunkEvents } from "../utils/VoiceBroadcastChunkEvents"; import { RelationsHelper, RelationsHelperEvent } from "../../events/RelationsHelper"; import { createReconnectedListener } from "../../utils/connection"; +import { localNotificationsAreSilenced } from "../../utils/notifications"; export enum VoiceBroadcastRecordingEvent { StateChanged = "liveness_changed", @@ -333,10 +334,29 @@ export class VoiceBroadcastRecording * It sets the connection error state and stops the recorder. */ private async onConnectionError(): Promise { + this.playConnectionErrorAudioNotification().catch(() => { + // Error logged in playConnectionErrorAudioNotification(). + }); await this.stopRecorder(false); this.setState("connection_error"); } + private async playConnectionErrorAudioNotification(): Promise { + if (localNotificationsAreSilenced(this.client)) { + return; + } + + // Audio files are added to the document in Element Web. + // See