soundmemes / bot-crystal

Crystal-clean version of Soundmemes Bot
https://t.me/soundmemesbot
GNU General Public License v3.0
0 stars 0 forks source link

The bot unnecessarily reencodes audio files, making them too large #15

Open VitinhoCarneiro opened 6 years ago

VitinhoCarneiro commented 6 years ago

So, whenever I upload a file, it's reencoded to a 128kbps Opus audio stream. But it does this regardless of the audio codec and bitrate. I uploaded a 36kbps Opus audio file at only 48KB, and it got reencoded to Opus again, but at 128kbps, upping the file size to a whopping 180KB.

This is annoying. First of all, 128kbps is a pretty high bitrate for Opus audio, especially if it's just to send memes around. Second, I like to make my audio clips small so that even people with slow mobile connections can easily download them; but reencoding them at a high bitrate, apart from being unnecessary, is a real nuisance.

I'd suggest not reencoding Opus files unless their bitrate is too high. As for other formats, a simple linear bitrate mapping would be nice - for a 128kbps MP3 file, 72kbps Opus would be nice enough; for 96kbps AAC/Vorbis, I'd use 72kbps Opus as well; I really wouldn't use anything higher than 72kbps Opus just to send memes around.

vladfaust commented 6 years ago

Hello, @VitinhoCarneiro,

Thanks for pointing this out! Encoding system really needs a revamp, especially to partially fix #5. When I get around this (some day I'll have time and will), I will definitely look into other bit rates.

Thank you again! :heart: