From 3525c32a6f50f005e3945254fac55c1059cf0c1d Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Tue, 7 Apr 2026 02:48:32 -0700 Subject: [PATCH 1/2] fix: use file name instead of "a voice message" for non-voice audio Only use "a voice message" as the fallback body text when the audio actually has waveform data (i.e., it was recorded as a voice message). Regular audio files (music, etc.) now fall back to the file name instead. Fixes #543 --- src/app/features/room/msgContent.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/features/room/msgContent.ts b/src/app/features/room/msgContent.ts index 0cec05a57..c4547deca 100644 --- a/src/app/features/room/msgContent.ts +++ b/src/app/features/room/msgContent.ts @@ -147,10 +147,12 @@ export type AudioMsgContent = IContent & { export const getAudioMsgContent = (item: TUploadItem, mxc: string): AudioMsgContent => { const { file, encInfo, metadata } = item; const { waveform, audioDuration, markedAsSpoiler } = metadata; + const isVoice = waveform !== undefined && waveform.length > 0; + const fallbackBody = isVoice ? 'a voice message' : file.name; let content: IContent = { msgtype: MsgType.Audio, filename: file.name, - body: item.body && item.body.length > 0 ? item.body : 'a voice message', + body: item.body && item.body.length > 0 ? item.body : fallbackBody, info: { mimetype: file.type, size: file.size, @@ -162,7 +164,7 @@ export const getAudioMsgContent = (item: TUploadItem, mxc: string): AudioMsgCont waveform: waveform?.map((v) => Math.round(v * 1024)), duration: markedAsSpoiler || !audioDuration ? 0 : audioDuration * 1000, }, - 'org.matrix.msc1767.text': item.body && item.body.length > 0 ? item.body : 'a voice message', + 'org.matrix.msc1767.text': item.body && item.body.length > 0 ? item.body : fallbackBody, 'org.matrix.msc3245.voice.v2': { duration: markedAsSpoiler || !audioDuration ? 0 : audioDuration, waveform: waveform?.map((v) => Math.round(v * 1024)), From ea59ca2395ecf8a38c709b58261da4a10556b553 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Tue, 7 Apr 2026 12:26:06 -0700 Subject: [PATCH 2/2] docs: add changeset for audio description fix --- .changeset/fix-audio-file-description.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-audio-file-description.md diff --git a/.changeset/fix-audio-file-description.md b/.changeset/fix-audio-file-description.md new file mode 100644 index 000000000..89710332a --- /dev/null +++ b/.changeset/fix-audio-file-description.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Use file name instead of "a voice message" for non-voice audio files.