Closed furkanshaikh313 closed 10 months ago
Hi, can you change line 41 in src/edge_tts/util.py to if sys.stdout.isatty() and not args.write_media:
?
diff --git a/src/edge_tts/util.py b/src/edge_tts/util.py
index a26c9bd..ad80a61 100644
--- a/src/edge_tts/util.py
+++ b/src/edge_tts/util.py
@@ -38,7 +38,7 @@ async def _run_tts(args: Any) -> None:
"""Run TTS after parsing arguments from command line."""
try:
- if sys.stdin.isatty() and sys.stdout.isatty() and not args.write_media:
+ if sys.stdout.isatty() and not args.write_media:
print(
"Warning: TTS output will be written to the terminal. "
"Use --write-media to write to a file.\n"
sure let me try
Ir is rhis
try: if sys.stdin.isatty() and sys.stdout.isatty() and not args.write_media: print( "Warning: TTS output will be written to the terminal. " "Use --write-media to write to a file.\n" "Press Ctrl+C to cancel the operation. " "Press Enter to continue.", file=sys.stderr, ) input() except KeyboardInterrupt: print("\nOperation canceled.", file=sys.stderr) return
Yes
but it still gives error ok can u tell me any other way i can run tts in python using subprocess or anything i just need to save a variable as speech in a particular place
Why can't you use the library directly? If you don't want to use async, you could do something like: https://github.com/rany2/edge-tts/issues/127#issuecomment-1658996740
E:\RVC-beta-v2-0618\AniVoiceChanger>Warning: TTS output will be written to the terminal. Use --write-media to write to a file. Press Ctrl+C to cancel the operation. Press Enter to continue.
MY code def edge_playback(output): subprocess.Popen(["edge-tts", "--text", '"' + output + '--write-media hello.mp3'])