From b11e7cc1aecf39aec7f0c785074737d7a8e02cda Mon Sep 17 00:00:00 2001 From: rany Date: Tue, 11 May 2021 16:29:47 +0300 Subject: [PATCH] add stdin support --- easy-playback.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/easy-playback.sh b/easy-playback.sh index bec5c34..1ac3554 100755 --- a/easy-playback.sh +++ b/easy-playback.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash ## To use this script you need to install ## 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 -exec {fd}< <(edge-tts "${@}") +[ "$1" == "read-from-stdin" ] && { stdin=$(cat); shift 1; } || stdin="" +exec {fd}< <(edge-tts "${@}" <<<"$stdin") mpg123 -C "/dev/fd/$fd"