Skip to content

Instantly share code, notes, and snippets.

@Fintan
Last active July 27, 2016 18:54
Show Gist options
  • Select an option

  • Save Fintan/8409b99f61d62ae570c607fd3fb74cba to your computer and use it in GitHub Desktop.

Select an option

Save Fintan/8409b99f61d62ae570c607fd3fb74cba to your computer and use it in GitHub Desktop.
Create voice recordings of text with Ubuntu
#join multiple files together
ffmpeg -f concat -safe 0 -i tmp.txt -c copy new.mp3
#ffprobe gathers information from multimedia streams and prints it in human- and machine-readable fashion.
#output to screen
ffprobe -show_entries format=filename,duration -i ./out.mp3
#output to json file
ffprobe -show_entries format=filename,duration -i ./out.mp3 -of json 2>NUL > out.json
file 'bannerHeading.mp3'
file 'decisionHeading.mp3'
file 'welcomeIntroduction.mp3'
file 'optionHeading.mp3'
file 'optionIntroduction.mp3'
file 'forTitle.mp3'
file 'forText.mp3'
file 'againstTitle.mp3'
file 'againstText.mp3'
file 'directionText.mp3'
file 'resultTitle.mp3'
file 'correctFeedbackP1.mp3'
file 'correctFeedbackP2.mp3'
file 'incorrectFeedbackP1.mp3'
file 'incorrectFeedbackP2.mp3'
#dependencies
sudo apt-get install libttspico-utils
sudo apt-get install ffmpeg
#generate wav from text
pico2wave -w=out.wav -l=en-GB "Hello there"
#convert wav to mp3
ffmpeg -i ./out.wav -b:a 160k -metadata artist=homebrook ./out.mp3 -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment