Gapless Playback with Streams

*nix specific usage questions
Akito
New Cone
New Cone
Posts: 4
Joined: 17 Nov 2019 16:17

Gapless Playback with Streams

Postby Akito » 06 Jul 2020 23:29

Code: Select all

#!/bin/bash INPUT=$* STRINGNUM=0 ary=($INPUT) for key in "${!ary[@]}" do SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}" LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]}) #echo "word:$key, ${ary[$key]}" #echo "adding to: $STRINGNUM" if [[ "$LENGTH" -lt "100" ]]; then #echo starting new line SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]} else STRINGNUM=$(($STRINGNUM+1)) SHORTTMP[$STRINGNUM]="${ary[$key]}" SHORT[$STRINGNUM]="${ary[$key]}" fi done for key in "${!SHORT[@]}" do #echo "line: $key is: ${SHORT[$key]}" echo "Playing line: $(($key+1)) of $(($STRINGNUM+1))" NEXTURL=$(echo ${SHORT[$key]} | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g') cvlc --play-and-exit "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$NEXTURL" 2>/dev/null #mpg123 -q "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$NEXTURL" done
I was given this script and it is supposed to use Google's TTS engine, to read local strings aloud. The issue is, that the engine only allows a maximum of 100 characters at once, so a big string has to be split each 100 characters. This results in gapful playback when streaming several string pieces. How can the script user achieve gapless playback with a stream and not a local file?

Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 4 guests