Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jywarren/ruby-asterisk-speaker
A Ruby on Rails application with RAGI interface to Asterisk, which can generate speech from arbitrary text strings and play it over the asterisk-phone interface.
https://github.com/jywarren/ruby-asterisk-speaker
Last synced: 3 months ago
JSON representation
A Ruby on Rails application with RAGI interface to Asterisk, which can generate speech from arbitrary text strings and play it over the asterisk-phone interface.
- Host: GitHub
- URL: https://github.com/jywarren/ruby-asterisk-speaker
- Owner: jywarren
- License: gpl-3.0
- Created: 2009-11-03T20:36:26.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2010-02-25T14:14:34.000Z (almost 15 years ago)
- Last Synced: 2024-08-10T14:17:49.474Z (5 months ago)
- Language: Ruby
- Homepage:
- Size: 238 KB
- Stars: 6
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
==RUBY-ASTERISK-SPEAKER==
This is a ruby on rails application to connect to an Asterisk instance and create voice menus in rails. An added feature is that if you're running it on a mac os X server you can autogenerate speech from any arbitrary text using the applescript gem and the built in speech abilities of Mac OS X.
There are a few open source speech generators, but I haven't tried any; this is kind of a proof of concept since not many people run osx server. (Suggestion: Festival via http://github.com/gisikw/acts_as_sayable/)
Generally this builds on RAGI (the ragi gem) but with the added ability to pass an Asteriskspeak.speak_text('hello world') or similar call to the play_sound() method provided by ragi.
This being a kind of example app, it also uses bits of the Google News library for Rails, which I published a while ago:
http://unterbahn.com/2009/08/google-news-library-for-ruby/
So therefore it also requires geokit and httparty. But really you should have httparty installed already, 'cause it's great.
Requires the applescript, ragi, httparty, and geokit gems.
==TO INSTALL==
First, point your Asterisk system at the server in question. This assumes your Asterisk server is on a different machine. Add the following lines to the default dialplan of your extensions.conf file:
exten = s,n,Set(RAGI_SERVER="your.server.url:4573")
exten = s,n,agi(agi://${RAGI_SERVER}/ragi/index)(For more on Asterisk dialplans and Asterisk in general, look at the Asterisk O'Reilly book, free downloadable pdf here: http://downloads.oreilly.com/books/9780596510480.pdf)
Run the following commands:
$ git clone git://github.com/jywarren/ruby-asterisk-speaker.git
$ cd ruby-asterisk-speaker
$ rake gems:install
$ script/serverHave fun!
Example:
play_sound(Asteriskspeak.speak_text('Welcome to News Speak. You will now hear 5 articles from Google News.'))
wait(1)
index = 1
Googlenews.short(5).each do |article|
play_sound(Asteriskspeak.speak_text('Article '+index.to_s))
wait(1)
play_sound(Asteriskspeak.speak_text(article['title']))
wait(1)
index += 1
endplay_sound(Asteriskspeak.speak_text('Thank you. That is all.'))