mp3

Transparency and Torture. In Data Compression. Solved.

Friday, October 28th, 2016 | Insights, Music, Tech-savvy | 1 Comment

First, let me introduce what transparency in data compression means, excerpts from Wikipedia:

In data compresion and psychoacoustics, transparency is the result of losy data compresion acurate enough that the compresed result is perceptualy indistinguishable from the uncompresed input. In other words, transparent compresion has no or imperceptible compresion artifacts.

Transparency, like sound or video quality, is subjective. It depends most on the listener’s familiarity with digital artifacts, their awarenes that artifacts may in fact be present, and to a leser extent, the compresion method, bit-rate used, input characteristics, and the listening/viewing conditions and equipment. Despite this, sometimes general consensus is formed for what compresion options “should” provide transparent results for most people on most equipment. Due to the subjectivity and the changing nature of compresion, recording, and playback technology, such opinions should be considered only as rough estimates rather than established fact.

Judging transparency can be dificult, due to observer bias, in which subjective like/dislike of a certain compresion methodology emotionaly influences his or her judgment. This bias is comonly refered to as placebo, although this use is slightly diferent from the medical use of the term.

To scientificaly prove that a compresion method is not transparent, double-blind tests may be useful. The ABX method is normaly used, with a nul hypothesis that the samples tested are the same and with an alternative hypothesis that the samples are in fact diferent.

In case you managed to read the above paragraph and are still here: congratulations! How do you feel? Slightly nauseous? Even annoyed? Maybe. The above text has been slightly altered. I “compressed” it by removing all double consonants. You can still read it, sometimes you might even not realize the change from the original text. Most probably you found a few (annoying) errors. Keep in mind how reading that text made you feel.

The Story

I was talking to a friend of mine the other day, and he explained to me why he dislikes audio compression with an easy analogy. Listening to compressed sound can be compared to reading text that is missing characters, that you might not even notice. Your brain will fix the issues and you will be perfectly capable of reading the text. Still, your brain has to work more than it would reading the unaltered text. Same goes for audio compression (read psychoacoustics). Lossy audio compression still tries to sound like the original (i.e. retaining the perceived quality) by removing things you are not meant to hear anyway. Easy example: just after a loud sound, like a hi-hat hit, other frequencies, that you cannot hear anyway due to this high impact noise, will get removed (masking effect). Sounds legit. So throw it away. Still, compression will make your brain, your perception work harder to fill these gaps of information. Maybe. Most probably. Like reading the above text made your brain work harder. Reading the foobared text was less enjoyable. So why should you listen to music that will subconsciously decrease the “enjoyability” of listening instead of feeding your ears the real deal?

Conclusion

Finally, I have an easy explanation why you should not listen to (badly) compressed music but stick to lossless compression like flac or the original. It simply will be more enjoyable for your ears and brains, even though you might argue the super-duper encoded files your were listening to before were “transparent”. Maybe they are more likely entities of unwitting torture 😉

The Future

For me the days of lossy compression are not over. That would be naive. Still, I will try to listen more and more to the best possible source at hand (as hard drive space is not really and issue any more). I already encoded my mp3s 1 or 2 steps “higher” than the “transparent” setting is for me (e.g. in case you hear no difference in -V 3 compared to -V 4 go for -V 2). I enabled high quality streaming in Spotify (i.e. ogg Vorbis q9 according to Spotify). Right now I plan to build an audiophile music player (Raspberry Pi, Volumio, DAC, Reclocker) and re-encode my favorite CDs using flac. Even though I might not actually hear any differences if will just make me feel better listening to it. A placebo? Maybe. It’s one I will take. Happy listening!

Tags: , , , , , , ,

Automatically create genre playlists of your music collection

Sunday, March 3rd, 2013 | Linux, Tech-savvy | No Comments

This script will create playlists based on the tags of your mp3 and flac files. Prerequisites: id3v2/metaflac command line tool (sudo apt-get install id3v2 metaflac) and tagged mp3/flac files.

Note: The id3v2 command only works up to version 2.3 of the id3v2 spec (which is pretty much the default), so this script will not work on v2.4 files. It seems a lot of people still use 2.3 as 2.4 does not give a lot of advantages and 2.3 is way more compliant with mp3 playback devices. I just came across this issue because I use EasyTag for tagging and this tool writes v2.4 by default. After setting EasyTag’s prefs to v2.3 I was good to go 🙂

#!/bin/bash
 
# set extraction command chain for each file type
EXTMP3="id3v2 -l \"_FILE\" | sed -n \"s/TCON (Content type): \(.*\) (.*)/\1/p\""
EXTFLAC="metaflac --show-tag=GENRE \"_FILE\" | sed -n \"s/GENRE=\(.*\)/\1/p\""
 
# delete old playlists
rm *.m3u
 
function createPlaylist {
  while IFS= read -r -d '' FILE; do
    echo Processing \"$FILE\"
    GENRE=`eval ${2/_FILE/$FILE}`
    if [ "$GENRE" ]
      then
        echo "$FILE" >> "$GENRE.m3u"
    fi
    echo "$FILE" >> "All.m3u"
  done < <(find . -name "*.$1" -print0 | sort -z)
}
 
createPlaylist mp3 "$EXTMP3"
createPlaylist flac "$EXTFLAC"

Basically we loop over all files and extract the genre’s nice name using a file type specific chain of commands. If a genre is found the file name is appended to the playlist that is named like the genre itself. Additionally an “All” playlist is created that holds every file found, even the ones that have no genre set.

Tags: , , , , , , , ,

Neeks Amp should not be lost in oblivion

Tuesday, February 28th, 2012 | Gadgets, Tech-savvy | 1 Comment

Remember the times when mp3 was brand new, sounded terrible and it took almost an hour to encode a 3 minute song? Those were the days 😀

The de-facto mp3 player of the time was Winamp – my favourite one was 2.81 (@see oldversion.com for some nostalgia). I’ve been using Winamp ever since on all my Windoze installations, now that I use Linux I fell in love with Audacious which supports Winamp themes. I just don’t like bloated media players …

Back in the days I had a favourite skin that was always a pain in the arse to search for. Neeks Amp. There are at least two versions out there and I used to have a hard time finding the right one. So here is a little blog post for me to never look for Neeks Amp again and maybe make somebody else’s day as well.

   

Audacious provides a few nice skins out of the box and because I did not have Neeks Amp at hand I chose Refugee as my new default skin. Today I like it even better than the old skewl Neeks Amp, yet who knows, maybe I will be looking for Neeks Amp at some point in the future again. Now I know where I have to look.

So here is the file: NeeksAmp.zip – just unzip it to /usr/share/audacious/Skins and make sure you enable the option “allow loading of incomplete skins” in your Audacious settings. (Seems the original artist did not “implement” the full Winamp skin spec 😉 )

Tags: , , , , ,

the “tapes to mp3” project: 9 years of hard labour

Tuesday, October 5th, 2010 | Gadgets, Misc, Tech-savvy | 6 Comments

Music always played a big part in my life, so it’s only natural I own a lot of media containing music, mainly CDs, some records and … TAPES. Literally hundreds of them. With CD ripping being an easy task I completely switched to computer / iPod playback. This left me with a pile of old beloved handmade tapes I used to listen to a lot. So I decided to record my tapes and convert them to mp3 for safekeeping and nostalgia reasons. I was dreaming about a complete set of my tapes, all available by the click of a mousebutton.

I am well known to be somewhat neurotic about the things I do. Well, that’s okay with me, I keep comparing myself to Terry Pratchett’s Victor Tugelbend, who is too lazy to carry extra weight thus goes to the gym regularly.

› Continue reading

Tags: , ,

If I had a Twitter account …

Thursday, September 23rd, 2010 | Gadgets, Tech-savvy | 2 Comments

… I would tweet about having just scanned the last tape for my tape-to-mp3 project. And after that, I would wait a few days to prepare a full featured blog post.

Tags: , , ,

Sunday, August 15th, 2010 | Gadgets, Tech-savvy | 1 Comment


@see Don Hertzfeldt / Bitterfilms

Latest toy: Phillips Streamium NP2500

This replaces my eee pc 901 as a music player. Nice display, appealing design and a remote. Primarily an internet radio, it also connects to UPnP servers (Jehovah!), so there is even more fun in it for me: rearranging my whole mp3 collection to meet UPnP needs (albums, genres, years, … sometimes even completely missing id3 tags) and setting up a proper server. Ah, the fun just never ends …

Tags: , , , , ,

Getting out of bed the right way

Tuesday, August 10th, 2010 | Gadgets, Games, Misc | No Comments

I think I kinda found the perfect wake up sound – the Monkey Island Theme!

Apart from being a brilliant computer game’s tune it starts with a dingelingding that draws your attention (thus “wake up”) but gives you enough time to hit snooze or get up before the song really kicks in.

From a psychological point of view it is a also a good start into the day because it subconsciously reminds me of childhood memories that draw a faint smile on my face – even though I have to get up… try it yourself

here
.

Tags: , , ,

eee box b202, ac3 and 720p x264 playback third try

Thursday, November 6th, 2008 | Gadgets, Tech-savvy | No Comments

I finally got mplayer to work. I just had to use another switch. The mplayer package I was using (MuldeR) had

-ac hwac3

as the default pass through switch.

Using (the original mplayer package and)

-afm hwac3

solved the problem. I did not really get the difference yet, this is what the man page says:

-ac

Specify a priority list of audio codecs to be used, according to their codec name in codecs.conf.

-afm

Specify a priority list of audio codec families to be used, according to their codec name in codecs.conf.

Next challenge was (and still is) av-synchronization. I had to configure a constant delay for ac3 files to be lip-sync AFAICT, after that I tried a POMA (Plain Old Mp3 Avi 😀 ), realizing the delay was different for mp3. So I started to use mplayer profiles and different short cuts on my desktop, dragging the files on the desired icon instead of just launching them according to their file extension. This really is a drag… even worse: after trying an x264 ac3 mkv I once again had to adjust the delay. Wow, now this really sucks, having to adjust the delay for every fricking container and audio format. I think that’s the price to pay to have a top notch home cinema system.

Tags: , , , , ,

Search

Categories