HowTo: convert audio to TAF fast and easy (macOS/Linux)

:small_orange_diamond: Docker (to the rescue) :small_orange_diamond:

I built a docker image which contains all necessary tools and dependencies for opus2tonie.py. In addition to that I put a little shell script wrapper around it to offer even more possibilities (like batch encoding lots of episodes in a row):

:small_orange_diamond: Usage :small_orange_diamond:

The intention is to run this container on-demand and only as long as the file converions are running. Recommended is to run it by mounting your current host directory $(pwd) inside the container (/data), let it do the conversion and then it falls asleep again.

I added lots of usage examples on github, the easiest one being:

  • Convert a single file audiobook.mp3 from your current directory
Command:
docker run --rm -v $(pwd):/data audio2tonie transcode -s /data/audiobook.mp3

Output: 
audiobook.taf

It’s also possible to batch convert all subfolders from a given directory one after another (-r → recursively):

  • Convert all subfolders in a given folder into one taf per subfolder (with chapters for each file)
Subfolders in current directory: 
 |-Episode 01
 |-Episode 02
 |-Episode 03

Command:
docker run --rm -v $(pwd):/data audio2tonie transcode -s /data -r

Result: Episode 01.taf, Episode 02.taf, Episode 03.taf

Output:

To keep the container as small as possible, the base image is bookworm-lite as with integrated Python. I’m also using ffmpeg static builds (which cut the size to a quarter).

I haven’t deployed this container to a Docker registry yet, so please build it on your own for now (it’s fast!). Would be happy for any feedback!

1 Like