Looking for batch solution for text to speech conversion.
Posted: 15 Jun 2017 13:50
Hey All,
I don't know where to start and a google search turned up these forums, so I figured I'd start here.
I'm looking to see if it's possible to create a batch (.bat) file, that will parse a text file, and replace a fixed string with a couple of variables in the batch script, then pass the line of text to a 3rd party open source app (that has command line options) which will then convert said text into a .mp3 file, the filename of the said file would be an increasing number.
So, lets say, I have
[name] = Bob
[direction1] = north
[direction2] = south
textfile to parse would/could contain
hello, my name is [name], and I am from the [direction1], but we will go [direction2] today
so, [name] said we should go [direction2], but I felt we needed to go [direction1]
each line could output, something like
audio_output_direction_0001.mp3
audio_output_direction_0002.mp3
the 3rd party software i"m looking to use is https://github.com/brookhong/tts which is free, and has command line output
looking at it's instructions, I could then pass it at the beginning of the script (I'd have to first run an output of -F and -V to get my voices and output qualities)
[voice] = 5 (which would be Microsoft Zira Desktop, in my case)
[quality] = 10 (which would be SPSF_48kHz16BitStero, in my case)
the other variables I specified above
and I know a simple script output from it worked, as I tried it.
tts.exe -f 10 -v 5 "hello, my name is bob, and I am from the north, but we will go south today" -o audio_output_direction_0001 -t
and it outputs to a mp3 (puts an extra 0 on the end for some reason, but I could file rename that)
If you guys are unable to help, even a another forum I could be pointed too would also help me immensely.
I know this could be done by hand, but it would be nice if I only had to change a few variables and the rest was auto'magic'
I don't know where to start and a google search turned up these forums, so I figured I'd start here.
I'm looking to see if it's possible to create a batch (.bat) file, that will parse a text file, and replace a fixed string with a couple of variables in the batch script, then pass the line of text to a 3rd party open source app (that has command line options) which will then convert said text into a .mp3 file, the filename of the said file would be an increasing number.
So, lets say, I have
[name] = Bob
[direction1] = north
[direction2] = south
textfile to parse would/could contain
hello, my name is [name], and I am from the [direction1], but we will go [direction2] today
so, [name] said we should go [direction2], but I felt we needed to go [direction1]
each line could output, something like
audio_output_direction_0001.mp3
audio_output_direction_0002.mp3
the 3rd party software i"m looking to use is https://github.com/brookhong/tts which is free, and has command line output
looking at it's instructions, I could then pass it at the beginning of the script (I'd have to first run an output of -F and -V to get my voices and output qualities)
[voice] = 5 (which would be Microsoft Zira Desktop, in my case)
[quality] = 10 (which would be SPSF_48kHz16BitStero, in my case)
the other variables I specified above
and I know a simple script output from it worked, as I tried it.
tts.exe -f 10 -v 5 "hello, my name is bob, and I am from the north, but we will go south today" -o audio_output_direction_0001 -t
and it outputs to a mp3 (puts an extra 0 on the end for some reason, but I could file rename that)
If you guys are unable to help, even a another forum I could be pointed too would also help me immensely.
I know this could be done by hand, but it would be nice if I only had to change a few variables and the rest was auto'magic'