Hi Remi,
I am integrating Telegram voice messages with a LiveHelperChat bot and OpenAI transcription.
The current voice bot documentation says that supported audio formats include mp3, wav, ogg, m4a:
https://doc.livehelperchat.com/docs/bot/voice-message-bot-integration
However, Telegram voice messages are received by LHC as audio/ogg, but the saved/uploaded filename uses the .oga extension. Example from the LHC REST API log:
{
"mime": "audio/ogg",
"postname": "file_2393.oga"
}
When this file is sent to OpenAI transcription using gpt-4o-mini-transcribe, OpenAI rejects it:
{
"error": {
"message": "Unsupported file format oga",
"type": "invalid_request_error",
"param": "file",
"code": "unsupported_value"
}
}
The same setup works with whisper-1, but that model is more expensive. The cheaper/newer transcription model accepts ogg, but rejects oga, even though the actual MIME type is audio/ogg.
Current workaround:
- Use
whisper-1; or
- Add an extra custom REST API step before transcription to rename the LHC file from
.oga to .ogg.
Expected behavior:
Telegram voice messages should be usable with OpenAI transcription models that support ogg.
Possible fixes:
- Normalize Telegram voice filenames from
.oga to .ogg when saving incoming webhook files.
- Add
oga as an alias for audio/ogg, but save/send it with an .ogg filename where needed.
- Allow incoming webhook file name override to support static/template values, e.g.
voice_{{message.voice.file_unique_id}}.ogg, because Telegram message.voice does not provide a normal file_name field.
Relevant area:
lhc_web/lib/core/lhchat/lhchatwebhookincomming.php
Why this matters:
Without this normalization, Telegram voice messages cannot be transcribed with cheaper OpenAI transcription models like gpt-4o-mini-transcribe, and users are forced to use whisper-1 or build extra workaround steps.
Thanks.
Hi Remi,
I am integrating Telegram voice messages with a LiveHelperChat bot and OpenAI transcription.
The current voice bot documentation says that supported audio formats include
mp3,wav,ogg,m4a:https://doc.livehelperchat.com/docs/bot/voice-message-bot-integration
However, Telegram voice messages are received by LHC as
audio/ogg, but the saved/uploaded filename uses the.ogaextension. Example from the LHC REST API log:{ "mime": "audio/ogg", "postname": "file_2393.oga" }When this file is sent to OpenAI transcription using
gpt-4o-mini-transcribe, OpenAI rejects it:{ "error": { "message": "Unsupported file format oga", "type": "invalid_request_error", "param": "file", "code": "unsupported_value" } }The same setup works with
whisper-1, but that model is more expensive. The cheaper/newer transcription model acceptsogg, but rejectsoga, even though the actual MIME type isaudio/ogg.Current workaround:
whisper-1; or.ogato.ogg.Expected behavior:
Telegram voice messages should be usable with OpenAI transcription models that support
ogg.Possible fixes:
.ogato.oggwhen saving incoming webhook files.ogaas an alias foraudio/ogg, but save/send it with an.oggfilename where needed.voice_{{message.voice.file_unique_id}}.ogg, because Telegrammessage.voicedoes not provide a normalfile_namefield.Relevant area:
lhc_web/lib/core/lhchat/lhchatwebhookincomming.phpWhy this matters:
Without this normalization, Telegram voice messages cannot be transcribed with cheaper OpenAI transcription models like
gpt-4o-mini-transcribe, and users are forced to usewhisper-1or build extra workaround steps.Thanks.