Discord error 50161: Voice messages must have supporting metadata
Last verified against Discord Developer Docs - Opcodes and status codes
Voice messages must have supporting metadata.What error 50161 means
The voice message's audio attachment is missing the metadata Discord uses to display it. Voice message attachments carry two extra fields: duration_secs, the length of the audio in seconds, and waveform, a base64-encoded byte array used to draw the waveform in the client.
Bots that add the IS_VOICE_MESSAGE flag to an ordinary audio upload, without filling in those attachment fields, get 50161. Discord does not compute them for you from the file.
The values should describe the actual audio. Compute the duration from the file with an audio library, and derive the waveform by sampling the audio's amplitude into a short array of bytes. Audio that has no readable duration at all fails with a separate code, 50192.
What it looks like
{
"message": "Voice messages must have supporting metadata.",
"code": 50161
}Why it happens
- Attachment object missing duration_secs
- Attachment object missing waveform
- Metadata placed on the message instead of the attachment object
- Library version that does not support voice message fields
- Duration computed from a different file than the one uploaded, for example before transcoding
How to fix Discord error 50161
- 1Add duration_secs and waveform to the attachment entry in payload_json
- 2Compute duration from the audio file rather than hard-coding it
- 3Encode the waveform bytes as base64
- 4Retry and confirm the client shows a waveform and duration
- 5If you transcode audio, compute metadata from the final file you upload
How to stop it recurring
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
- 50160: Voice messages must have a single audio attachmentVoice messages must have a single audio attachment.
- 50159: Voice messages do not support additional contentVoice messages do not support additional content.
- 50173: Cannot send voice messages in this channelYou cannot send voice messages in this channel.
- 50035: Invalid form bodyInvalid form body (returned for both application/json and multipart/form-data…
Error 50161 - quick answers
What does Discord error 50161 mean?
The voice message's audio attachment is missing the metadata Discord uses to display it. Voice message attachments carry two extra fields: duration_secs , the length of the audio in seconds, and waveform , a base64-encoded byte array used to draw the waveform in the client. Bots that add the IS_VOICE_MESSAGE flag to an ordinary audio upload, without filling in those attachment fields, get 50161.
How do I fix Discord error 50161?
1. Add duration_secs and waveform to the attachment entry in payload_json 2. Compute duration from the audio file rather than hard-coding it 3. Encode the waveform bytes as base64 4. Retry and confirm the client shows a waveform and duration 5. If you transcode audio, compute metadata from the final file you upload
Should I retry after error 50161?
No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.
Stop debugging Discord by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.