Project

azure-tts

0.01
No release in over 3 years
Low commit activity in last 3 years
Text-to-speech gem based using Azure Cognitive Speech Services.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 1.17
~> 5.0
>= 0
~> 10.0
>= 0

Runtime

 Project Readme

Azure::TTS

Text-to-speech gem based using Azure Cognitive Speech Services.

Status: alpha (it works, has just some basic testing and it's not use anywhere in production)

Installation

Add this line to your application's Gemfile:

gem 'azure-tts'

And then execute:

$ bundle

Or install it yourself as:

$ gem install azure-tts

Usage

Obtain a Cognitive Services Subscription key (get a trial one here). Read more about the Cognitive Services TTS here.

Azure::TTS.configure do |config|
  config.region = "eastus"
  config.api_key = "YOUR_SUBSCRIPTION_KEY"
end

Azure::TTS.voices # => returns a list of voices available in the region

Azure::TTS.(text: "Hello world!", locale: "en_US", gender: :female, neural: true)
Azure::TTS.(text: "Hello world!", locale: "en_US", gender: :female)
Azure::TTS.(text: "Hello world!", locale: "en_US", format: :audio_24khz_160kbitrate_mono_mp3)

Note: see constants.rb for available formats.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/cristianbica/azure-tts.

License

The gem is available as open source under the terms of the MIT License.