From 49c4138a1c37d36edd669a2c775c6f41922911be Mon Sep 17 00:00:00 2001 From: mitchell Date: Fri, 19 Jun 2026 17:35:05 -0400 Subject: [PATCH] feat(tts): add --pause flag to control mpv playback --- src/tts.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tts.ts b/src/tts.ts index 4e8c36c..e6aab05 100644 --- a/src/tts.ts +++ b/src/tts.ts @@ -21,6 +21,8 @@ async function main() { options: { wait: { type: "boolean" }, w: { type: "boolean" }, + pause: { type: "boolean" }, + p: { type: "boolean" }, url: { type: "boolean" }, u: { type: "boolean" }, edit: { type: "boolean" }, @@ -31,6 +33,7 @@ async function main() { }); const waitAndCombine = args.wait ?? args.w; + const pausePlayer = args.pause ?? args.p; const readURL = args.url ?? args.u; const editContent = args.edit ?? args.e; @@ -136,7 +139,7 @@ async function main() { stdin: "ignore", stdout: "inherit", stderr: "inherit", - })`mpv ${file}`; + })`mpv${pausePlayer ? " --pause" : ""} ${file}`; } } @@ -171,7 +174,7 @@ async function main() { stdin: "ignore", stdout: "inherit", stderr: "inherit", - })`mpv --pause output.wav`; + })`mpv${pausePlayer ? " --pause" : ""} output.wav`; } main().catch(handleTopLevel);