I'm developing a Telegram bot and I have a question about sendvoice API to send voice (audio) messages.
I push a OGG file converting from a MP3 source file, using ffmpeg for conversion, with the command:
$ ffmpeg -loglevel panic -i \
/path/to/la_piattaforma_telegram_è_perfetta.mp3 \
-c:a libopus -compression_level 10 -frame_duration 60 -vbr on -application voip \
/path/to/la_piattaforma_telegram_è_perfetta.ogg -y
BTW, the MIME type appears correct:
$ file --mime-type -b \
/path/to/la_piattaforma_telegram_è_perfetta.ogg
audio/ogg
The audio file is correctly played as expected, but the (minor) problem I have is that Telegram client (desktop/android/any) doesn't show the "waveform" (audio spectogram, as that in the blue widget in the image below), instead the waveform is visualized as a single line.
Any idea about how to show the waveform graphic? There is any specific OPUS format required to allow nice visualization?
$ mediainfo /path/to/la_piattaforma_telegram_è_perfetta.ogg
General
Complete name : /path/to/la_piattaforma_telegram_è_perfetta.ogg
Format : Ogg
File size : 5.37 KiB
Duration : 2 s 79 ms
Overall bit rate : 21.2 kb/s
Audio
ID : 1485113069 (0x588506ED)
Format : Opus
Duration : 2 s 79 ms
Channel(s) : 1 channel
Channel positions : Front: C
Sampling rate : 16.0 kHz
Compression mode : Lossy
Writing library : libopus unknown-fixed
The lack of the waveform visualization could be because the audio track is mono (1 channel)?