rany2 / edge-tts

Use Microsoft Edge's online text-to-speech service from Python WITHOUT needing Microsoft Edge or Windows or an API key
https://pypi.org/project/edge-tts/
GNU General Public License v3.0
4.21k stars 444 forks source link

Add "-" as a valid parameter for input/output parameters #216

Open j824h opened 2 months ago

j824h commented 2 months ago

Reading from the standard input like many other command line tools could be helpful.

Especially, with edge-playback it would allow a streamlined workflow completely free of intermediate files.

rany2 commented 2 months ago

edge-tts already supports this, it's only edge-playback that has this limitation. What you could do is the following:

<some program> | edge-tts --file /dev/stdin 2>/dev/null | mpv -
j824h commented 2 months ago

That makes sense. I see /dev/stdin is a file of course.

Still you wouldn't plan to alias with - as mpv does?

rany2 commented 2 months ago

/dev/stdin is actually an alias for stdin, it's handled in edge-tts so it works even if that file doesn't exist (i.e., this works on Windows too)

j824h commented 2 months ago

I see /dev/stdin is actually an alias that works even for Windows. I suppose you want to keep it as the only and correct way?

rany2 commented 2 months ago

To be honest, I think it's quite confusing. I'll update it and add - as a supported parameter. You would never guess this if you didn't check the code.