Skip to content

Commandline tool to convert any audio file(s) into a Tonie compatible file

License

Notifications You must be signed in to change notification settings

marco79cgn/audio2tonie

 
 

Repository files navigation

audio2tonie


A fast and easy way to transcode any audio files to a format which is playable by a Tonie box.

This fork is based on the opus2tonie.py script. But since it's quite difficult to set up and has lots of dependencies (ffmpeg, Python, Google Protobuf, etc.) I decided to build a docker container. Some small updates have been implemented as well as a shell script which is used as a wrapper for the entrypoint.

Installation (Build from source)

  • git clone https://github.com/marco79cgn/audio2tonie.git
  • cd audio2tonie
  • docker build -t audio2tonie .

Usage

The intention is to run this container on-demand and only as long as the file converions are running.

Invoke it from your desired host directory where your audio files are stored. In these examples, the current host directory ($(pwd)) will be mounted into the container's /data folder (recommended).

docker run --rm -v $(pwd):/data [IMAGE ID] transcode 
            -s/--source SOURCE 
           [-o/--output OUTPUT]
           [-r/--recursive] 
           
required argument:
  SOURCE            the input source: a single file, a list (*.lst) or a folder

optional arguments:
  OUTPUT            the output filename (default: same as input with .taf extension)
  -r/--recursive    creates a taf file for each subfolder recursively

Examples

  • 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
  • Convert a single file audiobook.mp3 from your current directory with given output name
Command:
docker run --rm -v $(pwd):/data audio2tonie transcode -s /data/audiobook.mp3 -o /data/lullaby.taf

Output: 
lullaby.taf
  • Convert all files from a given folder into one taf file (with chapters for each file)
Command:
docker run --rm -v $(pwd):/data audio2tonie transcode -s /data/sandmann

Output:
sandmann.taf (with chapters)
  • Convert all files from a list MyFavoriteList.lst (one file per line) into a single taf (with chapters for each line/file)
MyFavoriteList.lst content:
audio.mp3
music.m4a
news.opus
trailer.mp3

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

Output: 
MyFavoriteList.taf (with 4 chapters)
  • 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

Chapters

When using a list or folder(s) as source, chapters will be created automatically.

Some useful resources

About

Commandline tool to convert any audio file(s) into a Tonie compatible file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 90.2%
  • Shell 8.1%
  • Dockerfile 1.7%