Convert Audible Files to mp3 — aa2mp3.sh (and, on the way, some comments about Mageia Linux)
I have a particular thing I want to do:
I want to use aa2mp3.sh to convert my audible content. It needs to use Audible Manager — this is not a method to convert Audible (.aa) files if you do not have an Audible log in! I have a Linux box but the wine installation of the Audible Manager is not working properly. It might be the rather old version of wine in Debian stable, it might be something else; I don’t know. So rather than mess with a nicely working installation, I am trying to set it up in VirtualBox. This also means that, if it works, I have a solution that will work for people using Windows.
I’m looking at Mageia (v5) as the Linux – why? Just because I haven’t played with it before. This is what I did:
(1) Went to http://mirror.aarnet.edu.au/pub/mageia/iso/5/Mageia-5-LiveCD-KDE4-en-i586-CD/ and got the KDE CD.
(2) Created a default Linux 32-bit VM in VirtualBox, though went up to 512MB RAM. Here is my Fedora walk-through.
(3) Put the iso in the virtual CD drive (in ‘Storage’ menu).
(5) Selected ‘Install’.
(6) Waited…chose language…
(7) Accepted licence…
(8) Set time zone (Mageia really holds your hand…)
(9) US Keyboard.
(10) Entered install wizard…
(11) Accepted defaults…
(12) Let it remove unrequired packages due to my hardware configuration…
(13) Waited while there was nothing to see but a splash screen…
(14) Just clicked accept or next or whatever until it asked me to halt machine and remove install media. Did so. Restarted.
(15) It booted … threw some errors but then I was able to add root password and create a user.
(16) Logged in as the user.
(17) Start button -> Tools -> System Tools -> enter root password.
(18) Clicked on ‘Update Your System’.
(19) Clicked my way through and let it update.
(20) Inside the guest, fired up browser, went to https://github.com/itayperl/aa2mp3.
(21) Clicked ‘Download zip’ and unpacked in ~/installs (after making ~/installs).
(22) In Mageia, went to ‘Start button -> Tools -> System Tools -> entered root password -> Configure Media Sources’ and added aarnet mirror…File -> Specific media mirror -> select aarnet (wow, easy!) except did not work… oh well, go ahead with existing config…
(23) Used ‘Install & Remove Software’ to install wine, mingw32-gcc, libav, ffmpeg.
(24) Inside Mageia, went to audible.com, logged in and and downloaded Audible Manager.
(25) Double-clicked on the installer and let Mageia’s version of wine install it. NOTE added later: Please see my reply to a comment on this post for more instructions on how to download Audible Manager; it is not obvious! Also, I can’t say whether a particular version of Manager will work on not, I just used the one that was current at the time…
(26) OK, good. Started Audible Download manager — how? Well, opened a terminal window and typed:
dolphin ~/.wine/drive_c/Program\ Files/Audible/Bin
Then double clicked AudibleDownloadHelper.exe.
(27) No, I don’t want to activate a device. Then I got the menu and selected podcasts.
(28) Logged in with my Audible credentials, but it did not work… tried a reboot and tried again, after confirming by logging in to my Audible account that my password for Audible was correct. Still no luck. But…
(29) Audible sent me a passkey and that worked — probably this was necessary because I use an old Audible rather than an Amazon login.
(30) Ok, installed guest additions on Mageia… This turned out to be unnecessary, but I’ve left the steps in.
(31) Installed kernel headers and dkms.
(32) Went to the VirtualBox devices menu at the top of the guest: Devices -> Insert Guest additions CD image
(33) Made sure the CD was mounted, open a terminal, went there, logged in as superuser (su or sudo, if sudo is being used) and ran the VBoxLinuxAdditions script.
(34) It says is already has one installed. OK, let it go and set up the shares.
(35) (Actually, I stopped the VM, and exported it (File -> Export Appliance) and moved it to a different computer, but that is not relevant.)
(36) Imported it, set up sharing in accordance with Fedora post. Used the ‘Music‘ folder on the host as the shared drive, since I just want to convert Audible files.
(37) So to mount the shared folder, on the guest (Mageia) type:
sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) sharehost /mnt/shareguest
(38) On guest,
(39) Following instructions in the aa2mp3 bundle, I copied the DLL into the aa2mp3_master directory:
cp ~/.wine/drive_c/Program\ Files/Audible/Bin/AAX* .
(40) Ran make:
this created dump.exe, needed by the script. OK, gave it a whirl
(41) Copied an Audible ‘.aa‘ file into my work space:
cp ~/mnt/shareguest/Music/AudibleBackups/file.aa .
(42) Installed ffmpeg, avconv (tried both) — no avconv on Mageia?
(43) Ran the conversion, got an error:
Encoder (codec mp3) not found for output stream
OK, tried an ffmpeg static build from http://johnvansickle.com/ffmpeg/
(44) Unpacked the static build of ffmpeg in my ~/installs directory:
xz -d ffmpeg-git-32bit-static.tar.xz tar x -vf ffmpeg-git-32bit-static.tar
(45) Put the new, statically-linked ffmpeg into the aa2mp3.sh script, path and all — I made a copy called aa2p3_static.sh. The only difference from the original is that I explicitly tell it where to find the ffmpeg binary. ‘username’ here is my username:
(46) Now, try again:
./aa2mp3_static.sh file.aa file.mp3
This method will work on any platform that runs VirtualBox, I would think, which is the big three (Win, Lin, Mac) at least.
YMMV, and all the usual caveats.
The mp3 came out quite large compared to the .aa (about 3 times the size) so perhaps there’s an ffmpeg option or two that could be used to tune it.
As a final note, I would rate Mageia as one of the easiest out-of-the-box experiences I have had with a Linux. I don’t know how extensive the package repository is, because I only had a very specific task in mind and did not do a general install, but it could hardly have been easier and everything I needed ‘just worked’ (well, except for needing the ffmpeg static build). Given that it was easier than usual to get the VirtualBox guest additions to work, it looks like it is an absolutely ideal distribution to use in VB when a Windows or Mac user needs some Linux functionality or wants to gain some Linux experience. I have only looked at this, the KDE version, so I won’t make broader comments.