tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

Add support for additional music codecs using ffmpeg.

Open aletschfirn opened this issue 2 months ago • 6 comments

Is your feature request related to a problem?

There isn't any issue about this, but you can't play any .wav (DSD) or .ape ("Monkey's Audio") lossless files using Telegram, as it recognizes such files as regular files (like .tar.gz or .7z files), and not music (see image below).

.dsf and .ape files being recognized as regular files, and not music files

Describe the solution you'd like

Since Telegram Desktop has ffmpeg as dependency and uses it with media_audio (here, possibly?), it might be used for DSD convert to PCM and then passed to OpenAL for playback? It indeed might be a bit of CPU intensive, but it is not that bad and is quite close to how much flac consumes on playback.

Describe alternatives you've considered

Using other media players, such as foobar2000 or cmus(with ffmpeg support) for playback. Also I could convert .wav to .flac with compressing and downsampling to make Telegram recognize such files. (as easy as ffmpeg -i in.wav -o out.flac)

Additional context

I might look more into how Telegram actually plays music and why it ever limits usage to specific codecs, but I'm not sure I'll be able to make support alone, xd

aletschfirn avatar Oct 11 '25 12:10 aletschfirn

The reason for codec limit is binary size and consistency with other official clients (mainly mobile ones)

ilya-fedin avatar Oct 11 '25 13:10 ilya-fedin

@ilya-fedin hello,If I want to improve hardware decoding, where should I start?

FishOrBear avatar Nov 04 '25 06:11 FishOrBear

@FishOrBear I have no idea how hardware decoding could be improved. If you have concrete ideas how to improve it and which code you need, I could try to point to it.

ilya-fedin avatar Nov 04 '25 13:11 ilya-fedin

The reason for codec limit is binary size

Use shared linking.

and consistency with other official clients (mainly mobile ones)

So this enhancement wish goes to all official Telegram clients in parallel.

dreirund avatar Nov 06 '25 13:11 dreirund

Use shared linking.

That will make size only bigger since static linking strips unused parts.

So this enhancement wish goes to all official Telegram clients in parallel.

No, this issue tracker is only for tdesktop-specific issues, unofficial and is read only by tdesktop devs and community.

ilya-fedin avatar Nov 06 '25 14:11 ilya-fedin

TDesktop isn't able to send .wav files as "audio type"; when you try to send it, it will be sent as a normal document type.

I don't think the issue is related to codec at all because when I send .wav files with other clients, tdesktop (and all other clients) can play it just fine but when I send a file with tdesktop itself, it just doesn't send it as audio message type

ALiwoto avatar Nov 07 '25 07:11 ALiwoto