sharedopk.blogg.se

Amazon text to speech free
Amazon text to speech free













amazon text to speech free

To throttle the requests, I used the popular async module, specifically eachOfLimit(). I used the textchunk module (which is basically sbd) to split the text into pieces small enough for AWS, without splitting the text in the middle of a word or a sentence.īecause even a moderate amount of text can be split into hundreds of pieces (textbook chapters for me divided into ~180 parts), we don’t want to exceed Amazon’s rate limits. The process is straightforward, but uses a few interesting libraries.įirst, it splits the text into pieces.

amazon text to speech free

Technical DetailsĪll in all, the tool is only about 200 lines of code. That’s it! If you want something other than an MP3 or the default voice (Joanna), you can specify those options on the command line. All you need to do is specify the input file, and where you want the resulting audio file to be saved: $ aws-tts my-test-file.txt resulting-speech.mp3 It’s designed to be simple to use and completely hands-off.

amazon text to speech free

aws-ttsĪws-tts is a CLI tool that converts a text file into an audio file using AWS Polly. How do you convert a large amount of text, such as a book? Not finding a tool that would do this for me, I decided to create one. The tricky part is that the API only allows ~1,500 characters of text per request. Submitting text to Polly is pretty easy, using the AWS CLI tool: $ aws polly synthesize-speech -output-format mp3 -text "Here is my text" -voice-id Joanna output.mp3 Like most AWS products, it is on-demand and low-cost - you get 5 million characters per month free for the first 12 months, and a million characters for $4.00 after that.

amazon text to speech free

Using the AWS API, you can convert a snippet of text into speech in seconds. Last month, Amazon debuted Polly, the latest in its long line of web services. What if I want to automate the process completely from the Linux command line interface (CLI)? Enter Polly I ended up using the Cepstral software, which works fine, but it has a graphical interface and is mainly for Windows and OSX. Festival, the open source solution, doesn’t have great voices, hasn’t been updated in years, and is hard to use. Last year I wrote about converting books to speech, where I investigated using open source and free tools to scan textbooks and convert them into audio files.Īt that time, the weakest part of the process was the actual text-to-speech part.















Amazon text to speech free