diff --git a/README.rst b/README.rst index 25b514a..ada2f84 100644 --- a/README.rst +++ b/README.rst @@ -19,12 +19,22 @@ installation usage ----- -assuming you have a file named ``episode_42.mp3``, ``mp3chaps`` looks for a chapter marks file called ``episode_42.chapters.txt`` in the same directory:: +assuming you have a file named ``episode_42.mp3``, ``mp3chaps`` looks for a chapter marks file called ``episode_42.chapters.txt`` in the same directory. + +**Important**: File must be encoded in your system default file format, e.g. ANSI for Windows and UTF-8 for Unix + +either:: 00:00:00.000 Introduction 00:02:00.000 Chapter Title 00:42:24.123 Chapter Title +or (Audacity export format, separated by tab, contains 2x start time in seconds of the chapter):: + + 0.000000 0.000000 Chapter 1 + 85.180378 85.180378 Chapter 2 + 543.822379 543.822379 Chapter 3 - spaces are allowed as you like + add chapter marks ----------------- add (import) chapter marks from text file (unexpected results may occur if chapters already exist, for best results remove chapters first with -r) diff --git a/mp3chaps.py b/mp3chaps.py index 328ed98..9511bb2 100755 --- a/mp3chaps.py +++ b/mp3chaps.py @@ -37,8 +37,18 @@ def parse_chapters_file(fname): chaps = [] with open(chapters_fname, "r") as f: for line in f.readlines(): - time, title = line.split()[0], " ".join(line.split()[1:]) - chaps.append((to_millisecs(time), title)) + if '\t' in line: + #assume we have audacity format + # e.g. "85.180378<\t>85.180378<\t>Chapter 1" + # (