Package: toc2audio
This tool parses a Table of Contents file and:Optionally, showsHTMLin your browser and print it too on the
console, for copy&paste or redirection to complete your
show notes.TODO:Optionally, adds the TOC generatedHTMLto an audio
file.Optionally, adds timestamps (chapters) from your TOC file to
an audio file.Optionally, adds timeoffsets to all timestamps (in theHTMLand in the chapters) in order to compensate from initial
presentation or teasers, advertisements during the audio, etc.If the audio file already has chapter/TOC metadata, we will
replace it as requested. The rest of the metadata presents in the
original file will be preserved.Install$python3-mpipinstalltoc2audioCommand line$toc2audio--version0.5.0$toc2audio-husage: toc2audio.py [-h] [--version] [--offset OFFSET] [--show]
                    [--toc] [--chapters]
                    [TOC] [AUDIO ...]

Add Table of Contents and chapters to audio files

positional arguments:
  TOC              Table of Contents file
  AUDIO            Audio file

optional arguments:
  -h, --help       show this help message and exit
  --version        Show version info
  --offset OFFSET  Seconds or [HH:]MM:SS to add to ALL timestamps
  --show           Show the generated HTML in your browser
  --toc            Store Table of Contents in the audio file
  --chapters       Store chapters details in the audio fileTable of Contents formatThe Table of Contents must be written inmarkdown.toc2audio will parse anymarkdownfile and will, optionally,
insert the generatedHTMLand chapters metadata in your audio
file. If you want to use timestamps (chapters), you must use lines
in this format:[HH:MM:SS] Chapter titleHH:MM:SS is hours:minutes:seconds. The “hours” field is optional.
You can specify fields with one or two digits.An example would be:This audio was recorded blah blah...

* [00:50] Presentation

    Here I describe the topics we will talk about.

* [02:11] Topic 1

    Blah blah blah blah...

* [17:29] Topic 2

    Blah blah blah blah...NoteNotice that when list items have multiple paragraphs, each
subsequent paragrapMUST BE indentedby eitherFOURspaces or a tab, as documented inMarkdown Syntax
Documentationand in thedocumentationofPython-Markdownproject.WarningIf the first chapter doesn’t start at “[00:00]” for whatever
reason (including specifying aTime offset), a dummy chapter
will be implicitly added covering from “[00:00]” to the first
chapter.Time offsetYou can apply a global time offset to all timestamps in the TOCmarkdowndocument using the--offsetcommand line
parameter.Supported audio containersSupported audio containers are:Opus. If you can choose an audio format freely, you should
chooseOpus. It is the current (2021) state-of-art for general
purpose audio (voice and music) and free of patents. It is
“the greatest thing since sliced bread”.Vorbis.MP3.WarningIn manyMP3players, theMP3fileMUST BECBRin order
for the chapter metadata seeking to be accurate.M4A(MP4audio).Usually,MP4audiobooks have am4bextension to advertise
the presence ofbookmarks. Nevertheless, the file is bitwise
identical tom4a. Some software doesn’t recognizem4bfiles, so I use am4asuffix.Usually, the audio format will beAAC,HE-AACorHE-AACv2,
but I don’t really care. I manipulate the genericMP4container, I don’t pay attention to the audio data. I guess I
could even add chapters to video data.WarningThis feature requires availability ofFFmpegsoftware.Author and LicenseThe author of this package is Jesús Cea Avión.email:jcea@jcea.es.Webpage:https://www.jcea.es/.Blog:https://blog.jcea.es/.Twitter:@jcea.Mercurial repository.This code is licensed underAffero GNU Public License v3(AGPLv3)