Contact us
Leave a message

Mitglied bei

Logo "Bündnis '90/Die Grünen"
B'90/Grüne, OV Lehrte
Logo "Gospelchor 'Swing Low', Markus-Gemeinde, Lehrte"
Gospelchor "Swing Low", Markus-Gemeinde, Lehrte
Logo "Verein zum Erhalt klassischer Computer"
Verein zum Erhalt klassischer Computer
CHANGELOG abtools
=================


0.1.0
-----

- Initial release

Freiheit für Hörbücher!

Ein bekannter und großer Online-Anbieter von Hörbüchern bietet die Werke nicht in der gewohnten Form von mp3-Dateien an, sondern in einem eigenen, DRM-geschützen Format namens aax. Leider musste ich feststellen, dass Hörbücher im aax-Format weder unter Linux noch auf meinem guten, alten mp3-Player unter Rockbox abspielbar sind. (Schon das Herunterladen der erworbenen Dateien erweist sich unter Linux als schwierig -- der Download mit Firefox start nur, wenn man die Browser-Kennung mittels des User Agent RG-Addons auf den E-Book-Reader des großen Internet-Buchhändlers einstellt...)

Natürlich war ich nicht der erste, der sich mit diesen unnötigen Schikanen herumschlägt, und nach reichlich Recherche habe ich die folgenden beiden Perl-Skripte zusammengehackt, um das Überspielen der Hörbücher in ein DRM-freies Format (hier: FLAC) sowie das Aufspalten in handliche mp3-Dateien zu erleichtern.

abrec.pl

Im Grunde genommen macht dieses Tool nichts anderes, als die prorietäre Abspiel-Software des Hörbuch-Dealers (die in Wine installiert sein muss) aufzurufen und das abgespielte Hörbuch per sox wieder aufzunehmen.

Hier die Ausgabe von abrec.pl bei Aufruf mit -?:

abrec.pl -- Record (part of) an aax audiobook to a flac file
Version 0.0.1
-----------------------------------------------------------------------
Usage: abrec.pl [options]
with possible options:
-?|--help           : Show this message.
-b|--wine-bug       : Use a less comfortable way of calling external
                      helper programs in order to circumvent an ALSA
                      recording bug in Wine.
-c|--config-path    : Path to an alternative config file.
-p|--part-no        : Part number of a multi-part audiobook; should be
                      '1' for single-part audiobooks. [1]
-r|--rec-command    : What to execute in order to record the audiobook
                      played by the --play-command. The following
                      placeholders are understood: %o = Path to
                      output file; %t = value of -t parameter.
                      [rec "%o" silence 1 0.1 0.1% 1 %t 0.1%]
-t|--terminate-after-silence : After how many seconds of silence the
                      recording is to be considered completed. [15.0]
-y|--play-command:  : What to execute in order to play the audiobook.
                      [wine Manager.exe 2>&1 > /dev/null]
-v|--verbose        : Talk a lot.
-w|--working-dir    : Where the recorded flac files are to be stored.
                      [/home/tcrass/devlp/mediatools/abtools/work]
Requires ABTools.pm and SysUtils.pm to be in PERL5LIB and usually
relies on wine and sox/rec, which should be installed and in PATH.

abconv.pl

Dieses Skript ist ein bisschen komplexer als abrec.pl -- vor allem, weil der Hörbuch-Dealer es oft nicht hinbekommt, die Kapitel-Marken in den aax-Dateien ordentlich zu setzen, so dass die Marken mit den eigentlichen Buchkapiteln übereinstimmen.

abconv.pl -- Convert audiobook recorded with abrec.pl to mp3 or
             other formats
Version 0.0.1
-----------------------------------------------------------------------
Usage: abconv.pl [options] <part1.aax> [<part2.aax> ...]
with possible options:
-?|--help           : Show this message.
-a|--auto-chapters <f>: If != 0, split into chapters at every piece
                      of silence of at least -s seconds, ensuring
                      a minimum chapter duration of <f> seconds.
                      Mutually exclusive with -x. [0]
-A|--author <s>     : Use <s> as the book's author's name, rather than
                      what is stored in the original aax file.
-B|--book <s>       : Use <s> as the book's title, rather than what is
                      stored in the original aax file.
-c|--config-path <p>: Path to an alternative config file.
-C|--include-cover-art: If available, extract cover art from aax file
                      and include in audio files (using -T).
-d|--durations <d>  : Comma-separated list of durations of all the
                      audiobook's parts (according to publisher). Must
                      be given in h:m:s format and will be taken into
                      account when fixing chapters (see -x option), if
                      specified.
-i|--remove-intro <f>: If != 0, remove intro and goodbye comments (as
                      well as the 'This is the end of part x' message
                      found in multipart books) using <f> seconds of
                      silence as end-of-message marker. [0]
-f|--chapter-offset <f>: Split into chapters <f> seconds off the
                      chapter marks stored in the aax file. [-1]
-m|--convert-command <c>: Execute <c> in order to convert a chapter wav
                      to the desired target format. Apart from audio
                      format placeholders (see below), the following
                      placeholders can (and should) be used: %i = path
                      to input file; %o = path to output file.
                      [ffmpeg -y -i "%i" -ar %r -ab 96k "%o" 2>&1 > /dev/null]
-o|--out-dir <p>    : Path to output directory, which will eventually
                      contain the converted audio files.
                      [./out]
-p|--filename-pattern <s>: Template for the converted audio files'
                      names. All track data placeholders (see below)
                      are understood. [%0n - %b %n.mp3]
-r|--reuse-silence  : When When auto-splitting into chapters (see -a)
                      or fixing chapter positions (see -x), re-use
                      silence information gathered in a previous run.
-s|--silence-min-duration <f>: When auto-splitting into chapters (see
                      -a) or fixing chapter positions (see -x), only
                      treat intevals of silence of at least <f>
                      seconds in length as chapter breakpoint
                      candidates. [0.2]
-t|--tagging-command <c>: Execute <c> for tagging the converted audio
                      files. Apart from all track data placeholders,
                      the %i placeholder (= path to audio file) can
                      (and should) be used.
                      [id3v2 -2 -a "%a" -A "%a - %b" -t "%0n - %b %n/%N" -T %0n "%o" 2>&1 > /dev/null]
-T|--add-cover-art-command <c>: Execute <c> for adding cover art to
                      converted audio files; will be used, if the -C
                      option has been passed.
                      [eyeD3 -2 --add-image="%c":FRONT_COVER "%o" 2>&1 > /dev/null]
-x|--fix-chapters <f>: If != 0, instead of splitting the recording at
                      the chapter breaktpoints stored in the original
                      aax file, split at the longest interval of
                      silence found within +/- <f> seconds around the
                      aax chapter positions. Mutually exclusive with
                      -a. [0]
-v|--verbose        : Talk a lot.
-w|--working-dir    : Where the recorded flac files are stored.
                      [/home/tcrass/devlp/mediatools/abtools/work]
Audio format placeholders:
  %b = Bitdepth of recording (per channel)
  %r = Bitrate of recording (per channel)
  %n = Number of channels in recording
Track data placeholders:
  %a  = Author
  %b  = Book title
  %c  = Path to cover art image file
  %p  = Part number
  %0p = Part number padded with zeros
  %P  = Parts count
  %m  = Chapter number (within part)
  %0m = Chapter number padded with zeros
  %M  = Chapters count
  %e  = Chapter name (from aax file)
  %n  = Track number (over all parts)
  %0n = Track number padded with zeors
  %N  = Tracks count
Requires ABTools.pm and SysUtils.pm to be in PERL5LIB and relies
on sox as well as the mp4v2-utils package, which should be installed
and in PATH.
In standard configuration, audio file conversion is performed using
ffmpeg, while tagging relies on eyeD3.

Konfiguration

Die beiden Skripte können über Konfigurations-Dateien gesteuert werden; im zip-File des Downloads finden sich neben der Standard-Konfiugrations-Datei noch ein paar Beispieldateien, die ich zur Konvertierung einiger Hörbucher verwendet habe.