kepka
kepka copied to clipboard
Improve audio playback
So this is going to be something painful but I've done everything I can to prove this issue. If you don't have a good headphones, you're not helpful here. Basically, the issue title says it all: the sound quality is terrible, music is distorted, and, considering that thousands of people are using Telegram mobile client for music and Kepka is going to be cross-compilable, it's not just issue, it's a nightmare of any contributor.
Steps to reproduce
The easy way
Just download any music piece and compare sound that comes out of Telegram with sound from any other software.
The hard way
Here I'm actually going to explain my analysis. I've done it with MP3 for the first time, just for fun, but in this case I'm going to use a song from Monstercat FLAC pack. For obvious reasons, I can't post it fully, but if you have a FLAC record, the song name is Muzzy - Spectrum
, and here's SHA512 sum: d2f04f81c8bfd51fb8eb9d6b05cebfce58a3781b648e2324edc02b8341cab2fa40856aa4784463a9b4eb945a420602085110a1664048ad45fd293f866e70cc72
AUDIOCHECKER report:
AUDIOCHECKER v2.0 beta (build 457) - by Dester - [email protected]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Path: ...\2017 - [MCEP113] - Muzzy - Spectrum EP
01 -=- 01. Muzzy - Spectrum.flac -=- CDDA (100%)
02 -=- 02. Muzzy - Lost Forever.flac -=- CDDA (100%)
03 -=- 03. Muzzy - Break Away (feat. Priority One).flac -=- CDDA (99%)
04 -=- 04. Muzzy - Outsiders (feat. Charlotte Haining).flac -=- CDDA (100%)
Summary: 99,75% CDDA
105067060
Music is distorted on ANY OS, but following procedure is correct only for Linux.
- You need PulseAudio and Audacity. It's also advised to use following configuration for crystal clear sound.
resample-method = src-sinc-best-quality
default-sample-format = s24le
- Turn off your mic and set monitor of your output device as a default recording device, here's what Google gave me if you're banned
- Download any music piece (FLAC advised), load it into Telegram. Launch Audacity. While recording, Audacity should now listen for sounds from PulseAudio output, i.e. sound from your computer. Make sure volume in all software you're gonna test is equal or almost equal.
- Record piece by playing it from any music software
- Stop recording, mute track so it will not be played while recording next time
- Repeat from 4 for all software used, including telegram
- Profit. Now you have several tracks that you can analyse in any way you want: visually, mathematically or just by listening to each track and thinking.
The differences in volume and the meaning of "volume" itself for each software piece may differ, so that may harden further analysis. But, assuming differences are negligible, I'm posting my own observations: https://imgur.com/a/Y9JdV I've done my best on sliding and slicing parts to synchronize pieces. On circled parts it's clearly visible that the difference not just in the volume, but in the structure of wave. After all, I don't think this needs much explanation because it goes too deep into music theory. Another interesting point is that it's clearly a software issue since software->software sound transition ended up with distorted sound.
Expected behaviour
Music should be clear just like in any other music software.
Actual behaviour
Probably at some frequencies or some specific wave shape, the timbre of music "shifts" and distorts.
Configuration
Operating system: (Almost) clean Debian 9.3 (Stretch) installation, Linux.
Version of Telegram Desktop: 1.1.23 and 1.2.6
Used theme: not applicable
Is this reproducible on the official Telegram Desktop as well?
Yes, can be reproduced on any Telegram version actually. Doesn't affects official mobile Telegram client. I'm amazed that nobody reported this to developers before, but I've managed to reproduce this on other machine on Windows. Which is quite confusing, since other users also reported that they actually hear distorted sound on official client. Edit: nobody reported exactly this issue, but here's what I found
It could be result of mixing OpenAL and ffmpeg for playback, but i need to dig the sources more to be sure.
Fixed in upstream (e3b6e1325e0d8dff9c428f293d468c7c2a1c3329)
@Hexawolf ща своруем, вроде тривиально всё