mirror of
https://github.com/rany2/edge-tts
synced 2024-11-22 01:45:02 +00:00
add stdin support
This commit is contained in:
parent
0b7308c9a6
commit
b11e7cc1ae
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
## To use this script you need to install
|
## To use this script you need to install
|
||||||
## edge-tts.py to a directory in your $PATH
|
## edge-tts.py to a directory in your $PATH
|
||||||
## as executable and give it the name edge-tts
|
## as executable and give it the name edge-tts.
|
||||||
trap 'kill -- $(jobs -p) 2>/dev/null' EXIT
|
trap 'kill -- $(jobs -p) 2>/dev/null' EXIT
|
||||||
exec {fd}< <(edge-tts "${@}")
|
[ "$1" == "read-from-stdin" ] && { stdin=$(cat); shift 1; } || stdin=""
|
||||||
|
exec {fd}< <(edge-tts "${@}" <<<"$stdin")
|
||||||
mpg123 -C "/dev/fd/$fd"
|
mpg123 -C "/dev/fd/$fd"
|
||||||
|
Loading…
Reference in New Issue
Block a user