Changes to be committed:

new file:   AGENTS.md
	modified:   pyproject.toml
	modified:   src/epub_tts/__main__.py
	new file:   src/epub_tts/tts_backend.py
This commit is contained in:
2026-08-06 14:57:57 -03:00
parent 5c187961d6
commit 4437b62ae9
4 changed files with 136 additions and 3 deletions
+16 -2
View File
@@ -7,6 +7,15 @@
import sys
from argparse import ArgumentParser
from epub_tts import tts_backend
from epub_tts import tts_edge
backend = {
# keys are the backend names, values are the corresponding TTS classes
"default": tts_backend.GenericTTSBackend,
"edge": tts_edge.TTSEdge,
}
def main(args=None):
p = ArgumentParser(description="Convert EPUB to audio using TTS")
@@ -20,10 +29,15 @@ def main(args=None):
p.add_argument("-o", "--output", help="Output audio file", required=True)
p.add_argument("-l", "--language", help="Language to use for TTS")
p.add_argument("-v", "--voice", help="Voice to use for TTS")
p.add_argument("-b", "--backend",
help="Backend to use for TTS",
default="default",
choices=backend.keys())
args = p.parse_args(args or sys.argv[1:])
print(
f"Converting {args.input} to {args.output} using voice {args.voice}, language {args.language}, ..."
f"Converting {args.input} to {args.output} using voice "
f"{args.voice}, language {args.language}, "
f"backend {args.backend}, ..."
)