transcribe_audio()

async Client.transcribe_audio()

Transcribe speech in a voice message or video note into text.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat.

  • message_id (int) – Identifier of the message containing the voice note or video note.

Returns:

TranscribedAudio – On success, the transcribed audio object is returned.

Example

# Transcribe speech in a voice note
transcription = await app.transcribe_audio(chat_id, message_id)
print(transcription.text)