Just a normal day in Geekland 1/2
Friday, October 3rd, 2008 by TuukkaI was having a lot of fun with openSUSE. Then I get that feeling that didn’t had enough fun at all. I was listenin my LP-records and felt little sad about that they could fit to my mobilephone. So I decided to do little megamix (and use my DJ-Sk1lzz). So I tried audacity (little bit over kill). Gnome record (Naah.. too professional still). I wanted something that records to disk same time it comes from ALSA in Ogg/Vorbis by command line.
I searched in Freashmeat, Build and Google no fun at all. Little thinking (actually this one was long while) I had an idea that I have two easy options: Mplayer and SoX. Mplayer is fantastic. It’s more than you can imagine. FFMpeg in somehow learnable syntax and more stuff upon it. One thing made it unusable (If some one know howto I will try) it couldn’t only record from ALSA device and turn it to Ogg/Vorbis buut I found SoX could very easyly.
rec output.ogg
So SoX it will be then. Only think I noticed missing that I wanted Artist, Dates and stuff like that in Ogg-file and that couldn’t be done in SoX (or can I?). So this get more Geekish (hooray!). I launched little stdout/stdin pipe and putted oggenc to end of the command so it looked like this.
rec --no-show-progress -t wav - | oggenc - -q 6 -b 168 -c "Comment $(date +%x)" -d "$(date +%x)" \ -G "Funk" -l "The Album" -t "The Title" -a "Dj SupaGeekorous" -o outputfile-$(date +%x).ogg
Geek in me felt very happy I was having a time of my life
. Mission compilished or was it.. NO! I got Idea to stream my marvelous mix to the world with Icecast and VLC live when i’m doing it. So I think I have to try this and If you don’t nuke me down I’ll tell you how it went.



This is how it could be done using GStreamer
gst-launch alsasrc ! audioconvert ! taginject tags="title=\"The title\",genre=funk" ! vorbisenc ! oggmux ! filesink location="record.ogg"