Skip to content

Telegram voice messages are saved as .oga, blocking cheaper OpenAI transcription models #2382

Description

@mysubcult

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:

  1. Normalize Telegram voice filenames from .oga to .ogg when saving incoming webhook files.
  2. Add oga as an alias for audio/ogg, but save/send it with an .ogg filename where needed.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions