Kink On Tap Wiki

Kink On Tap is officially distributed only as an enhanced AAC audio file (i.e., chaptered AAC, or .m4a file). However, it can be converted from this format to many other audio formats freely. This page describes how to accomplish that. Some knowledge of open source software is assumed.

Conversion tools[]

To convert audio, you can use any of the following tools.

Converting using GStreamer[]

GStreamer is a Free and open source library/framework for manipulating media streams. It's included in most Linux distributions, and is also available for Mac OS X as a package from the Fink, MacPorts, and DarwinPorts package managers. (Windows packages aren't generally available.)

This section describes how to use GStreamer to convert .m4a audio files into both .mp3 and .ogg audio files.

Prerequisites[]

The following software needs to be installed.

Ubuntu Linux[]

On Ubuntu Linux, the packages needed for (along with what they're used for) the examples below are:

  • gstreamer0.10-alsa (for vorbisenc, oggmux, filesink, filesrc)
  • gstreamer0.10-tools (for gst-launch)
  • gstreamer0.10-plugins-bad (for faad2, an AAC decoder)
  • gstreamer0.10-ffmpeg (for ffdemux_mov_mp4_m4a_3gp_3g2_mj2)

For the MP3 example, you'll need:

  • gstreamer0.10-plugins-ugly (for lame - MP3 encoder)
  • gstreamer0.10-plugins-good (for id3v2mux - metadata muxer)

Mac OS X[]

On Mac OS X, using the MacPorts package manager, issuing the following commands will install the necessary software:

sudo port install gstreamer        # base package
sudo port install gst-ffmpeg
sudo port install gst-plugins-good # for "id3v2mux", a metada muxer
sudo port install gst-plugins-bad  # for "faad2", an AAC decoder
sudo port install gst-plugins-ugly # for "lame", an MP3 codec

GStreamer conversion examples[]

The following example converts episode 18 into Ogg Vorbis:

gst-launch-0.10 filesrc location=kinkontap18.m4a ! \
    ffdemux_mov_mp4_m4a_3gp_3g2_mj2 ! faad ! audioconvert ! \
    vorbisenc quality=0.15 ! oggmux ! filesink location=kinkontap18.ogg

and the following makes an MP3 file:

gst-launch-0.10 filesrc location=kinkontap18.m4a ! \
    ffdemux_mov_mp4_m4a_3gp_3g2_mj2 ! faad ! \
    lame mode=4 bitrate=64 ! id3v2mux ! \
    filesink location=kinkontap18.mp3

For Mac OS X, simply use gst-launch as the command name instead of gst-launch-0.10.

The BASH shell script below makes MP3 and Ogg Vorbis files for all the episodes in the current directory.

#!/usr/bin/env bash

for i in $(ls *.m4a | sed -e s/.m4a$//); do

  if [ ! -f $i.ogg ]; then
    echo "converting $i.m4a to $i.ogg"
    gst-launch-0.10 filesrc location=$i.m4a ! \
      ffdemux_mov_mp4_m4a_3gp_3g2_mj2 ! faad ! audioconvert ! \
      vorbisenc quality=0.15 ! oggmux ! filesink location=$i.ogg
  fi

  if [ ! -f $i.mp3 ]; then
    echo "converting $i.m4a to $i.mp3"
    gst-launch-0.10 filesrc location=$i.m4a ! \
      ffdemux_mov_mp4_m4a_3gp_3g2_mj2 ! faad ! audioresample ! \
      audio/x-raw-int, rate=44100 ! \
      lame mode=4 bitrate=64 ! id3v2mux ! \
      filesink location=$i.mp3
  fi

done