Created
October 5, 2017 13:40
-
-
Save Technifocal/682f833af3efb1918a1bb20746c2678d to your computer and use it in GitHub Desktop.
Parallelizes 'text.txt' to AWS Polly, splitting per sentence.
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
#!/usr/bin/env bash | |
cat text.txt | \ | |
tr '\n' ' ' | \ | |
sed -e 's/\(\s*[.\?]\)\s\?/\1\x00/g' | \ | |
parallel -j64 --null 'aws polly synthesize-speech --output-format mp3 --text {1} --voice-id Amy Amy.$(printf "%010d" {#}).mp3' && \ | |
ffmpeg -i 'concat:'$(for i in *.mp3; do echo -n "${i}|"; done) out.mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment