TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Determine sound quality of a file, objectively?

65 pointsby ggeorgovassilis9 months ago
Is there a way to "objectively" determine the sound quality of an audio file? Eg. I sometimes come across mp3 files with a high bitrate, but they sound bad which suggest that they were re-encoded from a bad/low-bitrate source. By "objectively" I mean something else than listening to them, eg. an audio spectogram etc?

19 comments

bheadmaster9 months ago
&gt; I sometimes come across mp3 files with a high bitrate, but they sound bad which suggest that they were re-encoded from a bad&#x2F;low-bitrate source.<p>You could try re-compressing the mp3 file to lower and lower bitrates and check the amplitude of differences. Since mp3 is a lossy codec, there will always be a slight difference, but you should see a sudden increase in difference when you surpass the &quot;true&quot; encoding bitrate.<p>You could probably write a script for it using ffmpeg and some other tools to generate a bitrate-difference chart.
评论 #41290638 未加载
评论 #41290505 未加载
sgarland9 months ago
A private music tracker called REDacted has a good overview [0] on this subject (link should be SFW, and is on a different domain than the tracker itself). What.CD, before its demise, was the first I had seen demonstrating this, but older trackers (OiNK, Waffles.fm, et al.) may have also had it.<p>Objectivity aside, IMO the easiest way to tell when listening is paying attention to high-frequency sounds, especially hi-hat cymbals. Unless lossy encoders have gotten remarkably better since I last tried, there’s always a marked loss of shimmer &#x2F; reverb on those.<p>[0]: <a href="https:&#x2F;&#x2F;interviewfor.red&#x2F;en&#x2F;spectrals.html" rel="nofollow">https:&#x2F;&#x2F;interviewfor.red&#x2F;en&#x2F;spectrals.html</a>
评论 #41292507 未加载
评论 #41294392 未加载
hengheng9 months ago
<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Perceptual_Evaluation_of_Audio_Quality" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Perceptual_Evaluation_of_Audio...</a><p>PEAQ is an algorithm and scoring system that takes psychoacoustic modeling into account. When I looked into this more than ten years ago, I managed to find a command line utility called pqevalaudio <i>or something</i> that I could just use to assign a score to a file.
评论 #41290753 未加载
评论 #41290383 未加载
comprev9 months ago
Try Spek [0]<p>It&#x27;s a popular tool for verifying the quality of music downloaded via P2P platforms. Re-encoding YouTube rips is popular - especially bootleg tracks - and this helps weed them out.<p>[0] <a href="http:&#x2F;&#x2F;help.spek.cc&#x2F;" rel="nofollow">http:&#x2F;&#x2F;help.spek.cc&#x2F;</a>
评论 #41289672 未加载
评论 #41289415 未加载
评论 #41289523 未加载
评论 #41290291 未加载
mchinen9 months ago
Most of the work on objective quality metrics (e.g. PESQ, POLQA, ViSQOL, DNS-MOS, NISQA) focus on speech because of telecommunications demands, but some of these have an audio mode. But there are some new promising audio ones that are ML based.<p>I haven&#x27;t tried it but you may want to look into PAM, which is relatively new and doesn&#x27;t require a reference (you don&#x27;t need the original uncompressed audio), and is open source.<p>However, all approaches are quite far from perfect. Human evaluation is still the gold standard.
Retr0id9 months ago
All the truly objective metrics will require a reference file to compare against. If you manage to find such a reference file, you&#x27;ve kinda solved your initial problem (which, presumably, was wanting to find the best quality file to listen to).
jononor9 months ago
Objective metrics for audio quality estimation is a tool commonly used to develop audio products, from mobile phones to headphones, hearing aids and audio codecs. I worked briefly in that area some years ago, and have put some notes together at: <a href="https:&#x2F;&#x2F;github.com&#x2F;jonnor&#x2F;machinehearing&#x2F;blob&#x2F;master&#x2F;audio-quality&#x2F;README.md">https:&#x2F;&#x2F;github.com&#x2F;jonnor&#x2F;machinehearing&#x2F;blob&#x2F;master&#x2F;audio-q...</a> In your usecases you would want a metric that only needs the single audio clip, without an original&#x2F;pristine reference. This is called a &quot;reference-free&quot; &#x2F; &quot;non-intrusive&quot; &#x2F; &quot;single-ended&quot; metric.<p>Detecting re-encoding or double encoding is sometimes researched, though mostly for audio forensic purposes.<p>Conceptually it would be possible to use the encoding with different codecs and nitrates&#x2F;settings on a sizable corpus of music, to learn a ML model that can learn to identify the &quot;true&quot; bitrate on new unseen audio clips.
WhiteOwlLion9 months ago
<a href="https:&#x2F;&#x2F;friture.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;friture.org&#x2F;</a><p>spectral analyzer. not sure if you need cli or batch function, but the frequency will be cut off regardless of the purported bitrate even if it was &quot;upscaled&quot; since those frequencies were chopped previously. you can see a sample screenshot in the upper left showing the frequency. re-encode a 320kbps to 128kbps and you can see the frequency range diminished on the 128kbps.
Madeindjs9 months ago
I found a tool named [Lossless Audio Checker](<a href="https:&#x2F;&#x2F;losslessaudiochecker.com" rel="nofollow">https:&#x2F;&#x2F;losslessaudiochecker.com</a>) : &quot;A utility to check whether a WAVE or FLAC file is truly lossless or not&quot;.<p>I was so sad that this project is not open-source but their Research papers give some interesting clues about detecting bad quality files.<p>On my side, I used it through a [Bash script](<a href="https:&#x2F;&#x2F;gist.github.com&#x2F;madeindjs&#x2F;d5e3949313b141f2e5eea62b982c2a02" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;madeindjs&#x2F;d5e3949313b141f2e5eea62b98...</a>) to detect bad files in my library. The tool produces a lot of false positives since it triggered on some High Res audio musics I bought on Qobuz.
lmpdev9 months ago
Not my area, but:<p>You could use image processing&#x2F;DSP methods on a sample of spectrogram images taken from the file<p>Visibly it’s obvious when it’s compressed, you get “glitchy” or “smeary” <i>repeated</i> artefacts<p>I’d also look for cuts on the high end (over ~15k hz) that clip more than normal (compared to uncompressed)
gwbas1c9 months ago
<a href="https:&#x2F;&#x2F;andrewrondeau.com&#x2F;blog&#x2F;2016&#x2F;07&#x2F;deconstructing-lossy-audio-the-case-for-lossless" rel="nofollow">https:&#x2F;&#x2F;andrewrondeau.com&#x2F;blog&#x2F;2016&#x2F;07&#x2F;deconstructing-lossy-...</a><p>Years ago, I did a study. I wrote a program to compare the original to the encoded version of a file. I used high-resolution DVD-A rips, to try to avoid artifacts introduced by downsampling the master to CD resolution.<p>The source code that I used for the above article is at: <a href="https:&#x2F;&#x2F;github.com&#x2F;GWBasic&#x2F;MeasureDegredation">https:&#x2F;&#x2F;github.com&#x2F;GWBasic&#x2F;MeasureDegredation</a>
dotancohen9 months ago
I asked almost this exact question on Super User (part of the Stack Exchange network) a few years ago. Some of the answers are still relevant:<p><pre><code> How to objectively compare the sound quality of two files? </code></pre> <a href="https:&#x2F;&#x2F;superuser.com&#x2F;questions&#x2F;693238&#x2F;how-to-objectively-compare-the-sound-quality-of-two-files" rel="nofollow">https:&#x2F;&#x2F;superuser.com&#x2F;questions&#x2F;693238&#x2F;how-to-objectively-co...</a>
hiddencost9 months ago
Worth keeping in mind that this varies wildly per domain, and there are many different measures for different types of problems.<p>SNR is a classic, and simple enough to give you an intuitive sense for the underlying signal processing.<p><a href="https:&#x2F;&#x2F;essentia.upf.edu&#x2F;reference&#x2F;std_SNR.html" rel="nofollow">https:&#x2F;&#x2F;essentia.upf.edu&#x2F;reference&#x2F;std_SNR.html</a>
corytheboyd9 months ago
Not an answer, just got me thinking about my _subjective_ measures of “bad music quality”. It’s not as trivial as “there is clipping”, because some elements clip on purpose, but if a vocal part clips it’s an instant turn off for me, it sounds horrible. That’s not a data issue though, it’s a production issue… unless the data is exceptionally bad.
animuchan9 months ago
A track which uses low-bitrate mp3 compression as an effect, specifically to get the ringing artifacts on some of the instruments, would make a fun benchmark for any quality detection method.
lsferreira429 months ago
What an awsome thread and answers, i have no personal interest on the subject but i had to read all the answers and even try a script a guy did here!!!
butterknife9 months ago
Listen to the the decoded Side channel. The more artefacts you hear the less bitrate encoding was used.<p>Compare to known good.
2OEH8eoCRo09 months ago
What is quality? The smallest resolvable detail?
评论 #41290477 未加载
_a_a_a_9 months ago
Answers here show HN at its finest.
评论 #41290064 未加载