Created
March 28, 2019 16:39
Star
You must be signed in to star a gist
AGI for high quality Festival TTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### | |
# AGI for high quality Festival TTS | |
# kjotte 2019-03-23 | |
# | |
# The Asterisk built-in Festival application only operates at 8KHz. | |
# This script implements a 32KHz HTS voice. | |
# | |
# Sample invocation from dialplan: | |
# AGI("festival-hts","Hello. I am not a robot.") | |
# | |
# Packages required: | |
# - festival | |
# - festvox-us-slt-hts | |
### | |
# Consume all variables sent by Asterisk | |
while read VAR && [ "${VAR}" != "" ] ; do : ; done | |
# Create temp file | |
TMPFILE=$(mktemp /tmp/festival-XXXXXX.sln32) | |
# Generate waveform | |
echo "$1" | text2wave -eval "(voice_cmu_us_slt_arctic_hts)" -otype raw -scale 1.5 > ${TMPFILE} | |
# Tell Asterisk to play it | |
TMPWAVE=$(echo ${TMPFILE} | sed 's/\.sln32$//') | |
echo STREAM FILE ${TMPWAVE} \"\" | |
read # We shoud probably do something with this response | |
# Clean up | |
rm ${TMPFILE} | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment