Audible content in amaroc again, virtualbox to the rescue

Some time ago I wrote about getting my audible content into my ipod without using a window system. It was working fine until November last year and then it stoped working all together. No matter what I was doing and how i fiddled around with the settings, installed new programs or whatever i did. The files came down perfectly but I could not play them on my ipod.

What was happening (I think) is that audible has timed up with itunes for the ipod delivery and as the system is not seeing my ipod it defaults to remove the ipod from my device list after a while (some years or so). So the drm will not let me play it on my ipod. I was kind of crossed as I just bought 2 new books that was a continuation of a book i already read, and now I could not read (well listen) to them.

One way of perhaps solving this would have been to reformat and connect the ipod to a vmware instance that I have for some windows programs that I do need to run, like the bank and so, but as i have had problems with that (linux sees the ipod first and grabs it) and that I do want amarok to handle my podcast that was not real way for me. And as vmware dont talk to pulseaudio I could not play it in “windows” and capture the audio.

Some days ago I started to play with virtualbox as an other way of doing other systems that I sometimes need to run uner linux. I have some customer sometimes that requires stuff to be done on a windows system with ASP and MsSQL server and so, so I am forced to run it some times. And as  Virtualbox is free I was looking into that.

And I found that the virtualbox works better than vmware does. It handles pulseaudio as it should. So i get the sound working in the windows instance that I run under virtalbox. Well this is interesting.

This guide also requires that you have pulseaudio working on your system but as I have covered that earlier I will not go into that here.

Install virtualbox

Installing virtualbox is fairly easy. You install the virtualbox-ose version (this is the open one thats in the normal repository). Im shure you can download and install the new versions from suns site directly but as this solved my problem i just did that. You also need to install the virtualbox-ose-modules-generic package also to gte the networks and so working.

Setup a virtualbox for playing

To set up a virtualbox its a straight forward job. You just click on new in the virtualbox control program, select a name and windows xp as os type. You create a new virtual disk of at least 5 gb (5g is enough for setting up the os and itunes, and some audiobooks).

You then select NAT as a network drive


Then setup the audio as pulseaudio


And after you have installed the OS and the guest additions you can add a shared drive to store the data on


This should give you an OS that should work well and play ipod music.

Then go ahead and install the audible download manager and the itunes program.

Configure pulseaudio

Pulseaudio has many config files and many options. I am sure that someone that is very knowable in configuring a pulseaudio setup can do this better, and if you already are using pulseaudio over the network you might need to work more on this,  but this worked for me.

As pulseaudio has a option of sending audio out over the network, and in creating this you have a sink to use to send the audio from our virtualbox os out on, and record from you can use this separatly from any other sound device so that normal system sounds and so will not disturb the recording.

You go into the “Pulseaudio Preferences”. and go to tab 2.


Click the “Enable Multicast/RTP sender” and then the “Create separate audio device for Multicast/RTP”. This is all that is needed to make it work.

Install pacpl

To convert the file later on we need the pacpl program. This is a perl audio converter and it can convert from mp3 to mp4’s for the ipod. It has quite some prerequisites so the easiest way is to follow the instrucrtions here. I think im using a slightly newer version, 4.0.5 insted of 4.0.4 but the procedure is the same.

In short:

  • Install/Setup the mediabuntu repostitory
  • Install Ubuntu Restricted Extras and build-essential
  • Download and build pacpl package
  • Install it and all prerequisites

The we can use the pacpl program later to convert the file.

Install gpac

To get the best files for the ipod we need to install gpac packages also. This will give us the MP4Box program that we can use later to fix the files for the ipod.

will install this.

Install lame

To convert the file to mp3 files we also need the lame encoder. Install this with:

Running the audio capture

So now its time to run the audio capture. And yes – it will require you to play the audible file in your virtalbox windows, but as this is just running I don’t see the problem with that. It just take time. So startup itunes in there, and select the file you whant to play. But don’t start playing it yet. I have created one small playlist called ToConvert that I use and add one file to that the time. This is often the case because I like the unabridged versions of the books.

Then we need to move the audio output of the virtualbox to the rtp.multicast.sink. You do this by opening up the Pulseaudio Volum Control program, rightclick on the VBOX (with the right name if you are running multiple virtual boxes), select Move stream, and move it to the rtp.multicast.sink.


Then open up a terminal windows to start the recorder. The command to capture is (type in the command but don’t press enter yet):

We use the parec to capture from the rpt.monitor and send ot out as 16 bits little endian raw pcm file.

Then we use lame to encode it to mp3. The flags for lame is -r for raw pcm file, -x for little endian, –bitwith 16 for 16 bits file, -m s for stereo and -a for downsample to mono.

When you are ready, have the virtual box ready and the parec ready, press enter on the command line to start the recorder and then click on play in itunes to start recordning.

This will give you the file /tmp/js.mp3 with the audio you have played in itunes. You have to have the windows open and press <CTRL> + C when the playing is done. If you miss and record silence in the end, you can use audacity to trim down the file.

So now we have the mp3 file and you can play that in your ipod. But there is some problems.

  1. The file will not come in right without the ID3 tag
  2. If you just copy over a mp3 you can play it, but if you navigate away from the playing and play something else you will loose where you where.
  3. And the file will not be under Audiobooks.

Number 1 is sorted out by using a good ID3 tag editor – i prefer the EasyTAG one.

Number 2 and 3 is handled by converting it to a m4b file. The m4b file is just an mp4 file (m4a), but renamed to m4b.

Convert to m4a

To convert the file to mp4 we will use the pacpl program. The commadn line to do the conversion is:

This will set no default options (–defoptions 0), be verbose (-v), convert to m4a (-to m4a), set the m4a quality to 50 (–aacqual 50) and set the encoding options to use 32 bits bitrate (–eopts=”-b 32). This will produce a m4a files that is just lightly bigger than the audible file we started with.

Setting ID3 tags

Before one renames the m4a files to m4b i run the easyTag to set the ID3 tags. Remember to add Part1.. and to to the title if you are spliting the file in multiple parts to keep the size down (i have found that files under 100mb works best). I usually sets the tags for both the mp3 file and the m4a file.

Fixing file for ipod

There is a problem with just converting the mp3 to m4a. Some times when you start up your ipod it will fail to read in the file in memory, or miss to skip to the right place, and then it will jump to next file. Enoying. But you can make it less frequent by just waiting for 5 seconds before pressing to play. But it seems that this last step will fix this to. Apparently the itunes creates an interleaved version of the file, and MP4Box program can do this to. So run the following command on the file:

And now you are ready to rename the file:

And you can now tranfer the file to your ipod with amarol, and listen to it.

Hope you enjoy this as much as i do.

7 thoughts on “Audible content in amaroc again, virtualbox to the rescue

  1. Thanks for sharing nice review on virtual box installation. I am trying it. It’s is very amazing.

  2. Pingback: A Linux User in a Windows World » Blog Archive » Linux and Audible

  3. Hi, I got VirtualBox running with XP and the Audible player. I can hear the audio fine and when I switch Pulseaudio to multicast.rtp, I can see the VU meter working indicating that sound is getting through. I then issue the parec command exactly as above and the mp3 file steadily grows in size. Yet when I stop and check it in audacity, it is just a bunch of white noise. Any suggestions you might have would be very welcome.

    Cheers.. Steve

  4. Sounds like you have sme problems with the encoding. Play with the encodings options for lame. I sugest that you remove the -x flags to lame and test that. If thats not working I would trie to just dump out the file from pacer directly and see what you get there.

  5. Perfect! Removing the -x flag did the trick. Thank you for sharing this! Now that I am not trapped by their DRM, I will buy more Audible books.

  6. Way too complicated 🙁 wish there was a simpler way to go about listening to .aa files on linux. It just strikes me as odd that there’s so many Win converters and stuff but nothing for linux, not even codecs.

  7. Aw, this was a really nice post. In thought I want to put in writing like this moreover – taking time and precise effort to make a very good article… but what can I say… I procrastinate alot and in no way seem to get one thing done.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.