Spotify + Alsa – (audio) Ads on Slackware

I’ve made some changes on a script I found on the internet these days to “remove” the audio ad when listening to Spotify on Linux (with the official Linux preview). The truth is, this script doesn’t remove the ad, just mute it (and all sound from Alsa on your computer), and unmutes when finished. Just it.

The original script uses PulseAudio to do the magic and let you play another song while the ad is “playing”. But as I hate PulseAudio and don’t want it installed on my system, I came with this “solution”. For me it’s working (Slackware-current 64 bits):

It requires Alsa, libnotify (for notify-send) and, of course, Spotify for Linux version 0.9.10.17.g4129e1c (you can get the latest package for Slackware x86_64 here). Basically, the script starts spotify and waits 15 seconds to check if it is running and get its status via dbus. When it detects an ad, it mutes the Alsa master channel and unmutes when the ad finishes.

I saw that Alsa create a stream for Spotify, but I can’t get this information from command line. If you have some better solution that doesn’t involves PulseAudio, send a patch or comment about it on this post 😉

Finalmente, um site pessoal

Tá, tem cara de blog (e é um blog), mas deixa eu ser feliz assim… Agora ao menos tenho um local para poder colocar minhas coisas e os projetos que venho tentando desenvolver, dividindo o antigo The CoRE no The CoRE v2.0 e este aqui, onde trouxe os artigos relevantes de diversas categorias, como o jogo para KDE feito em QT, KWarBots; o bot tradutor para IRC feito em Python, transbot; as histórias cyberpunk CyberEnvironment; o script greasemonkey para remoção de propagandas GMail Without Ads; e por ai vai…

Espero sempre atualizar com algum material novo, e logo também terminar alguns ajustes que ainda faltam por aqui…

😀