Adding Automated Speech Recognition for Phone Calls to Ruby on Rails Applications
With the advent of personal digital assistants and in-home, voice-controlled gadgets, voice technologies are on the rise. Working with voice and speech recognition technologies is a crucial skill to have, not just in emergent technologies, but also in robust, existing applications. In this tutorial, we will build an implementation of Twilio’s Automated Speech Recognition (ASR) service in a simple Ruby on Rails Application, in hopes of you being able to see the wide-reaching possibilities for other implementations in your own projects.
In this tutorial, we will build a simple “Feedback Service” that receives, responds to, and stores voice messages from user phone calls—using speech recognition—and then displays them for review at a later time.
Getting Started with Our Rails App
Generating Music with Sonic Pi and Ruby
Sonic Pi is an Integrated Development Environment (IDE) for writing music in Ruby. I write code with Ruby using the Sonic Pi IDE and sample myself screaming over it with Audacity under the artist name Messica Arson. The sound I create is very much inspired by the strange sounds of noise music combined with my screams I perfected while fronting a punk band.
In this tutorial we’ll walk through how to create this song together.
What is Sonic Pi?
With Sonic Pi we can interact with our computer as if we were using a synthesizer. Under the hood Sonic Pi is a Ruby wrapper for SuperCollider. There are samples and synthesizers loaded in that you can interact with in countless ways. You can also add your own samples as we will be doing in this tutorial.
Download Sonic Pi before moving on with the rest of the post. If ...
Add SMS Notifications to Your Rails App Using Twilio
Anyone living in NYC with a car knows the pain that is Alternate Side Parking rules. There’s the need to always to be conscious of which side of the street your car is parked on, to run out at the most inopportune times to move it to the other side of the street, and occasionally the opportunity to be blocked in by someone double-parking. All of these, and more, are part of what New York drivers have to put up with on a weekly cycle.
The idea hit on and followers kept coming in… but it had its limitations. First of all, most people aren’t glued to their Twitter feeds, and one tweet can easily ...
Better passwords in Ruby applications with the Pwned Passwords API
Here at Twilio we’re fans of using a second factor to protect user accounts, but that doesn’t mean we’ve forgotten the first factor. Encouraging users to pick strong passwords is still the first line of defence for their accounts.
After spending years collecting lists of passwords from publicly available data breaches at HaveIBeenPwned, Troy Hunt has made available an API to check whether a password has been used before. This post will show you how to encourage your users to use stronger passwords by checking against the pwned passwords API.
The Pwned Passwords API
In 2017 NIST (National Institute of Standards and Technology) as part of their digital identity guidelines recommended that user passwords are checked against existing public breaches of data. The idea is that if a password has appeared in a data breach before then it is deemed compromised and should not be used. Of ...
Send SMS Messages from Your Rails 5 Application with Twilio
In the burgeoning world of coffee, there are many varietals of coffee roasts from many regions of the world. Your boss has tasked you to create an application for them to Create, Read, Update, and Destroy (CRUD) different coffee roasts. They have also informed you that they want to be notified via SMS every time a new coffee roast is added to their website in order to prevent their competitors from putting in fake coffee roasts.
Today, we will create a very basic Rails 5 CRUD app entitled “Coffee Roasts” that will notify your boss via SMS whenever a new coffee roast is added to our website using Twilio’s SMS API.
Initializing Our Rails Project
First, let’s ensure that you have Ruby, Bundler, and Rails installed in order to set up a new project:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 curl -sSL https://get.rvm.io ...
Beat the Rush on Exclusive Twitter Deals with Node.js and Twilio SMS
I just couldn’t get online fast enough. You may know the feeling: someone or some business you follow posts a sale on Twitter and by the time you get online, you have either missed the tweet or the sale has ended. You could enable SMS notifications and get every tweet texted to you in a timely fashion, but this really doesn’t help as you start to tune out the texts when the volume exceeds several tweets within a short period of time. What if you could make an app that sends you an SMS notification only when the tweet matches a sale you are actually looking for?
This is where the Twilio SMS API comes to the rescue.
In my case, I am a big fan of Wes Bos (@wesbos). Wes is a developer who produces quality and fun online courses for learning web development, particularly in a ...
Build Your Own Daily Fantasy Football Salary Tracker with Ruby and Twilio MMS
September is here, the NFL has kicked off and the fantasy season is in full swing. Kareem Hunt is a beast, Zeke is gonna serve a 6 week suspension, there’s so much going on! In this post we’ll show you how to build a price tracker for your favorite daily fantasy sports website with Ruby. It will help you stay on top of the competition and receive price alerts as soon as they happen.
Tech-wise, we will use SQLite, an embedded database, and Sequel, a lightweight database toolkit for Ruby, to store all the data downloaded for easy accessing and querying. We will then setup a recurring task that downloads the CSV every “x” amount of time, like, say, two hours, and compares the entries with the ones received in the previous update. You will then receive a recap of all changes via MMS on your phone which ...
Verify user phone numbers in Ruby on Rails with the Authy Phone Verification API
If you ever need to contact your application’s users by phone then it’s good practice to verify that the phone number they enter is in fact theirs. Let’s see how to verify phone numbers in a Rails 5 application using the Authy Phone Verification API.
What you’ll need
To code along with this post, you’ll need:
- A Twilio account
- An Authy App which you can create in the Twilio console, you’ll need the API key
- Ruby and Rails installed, I am using the latest Rails 5.1.2 and Ruby 2.4.1
Create a new Rails application for this project:
rails new phone_verification cd phone_verification
We need to add a couple of gems that we’ll use in the project, open up the!-->
envyable. Authy is going to be used for the phone verification, envyable ...
Next Generation Ruby Helper Library Release
Today, we are excited to announce the general availability of our next-generation Ruby helper library.
The Ruby library offers new functionality and takes advantage of modern language features. We’ve rebuilt it from the ground up based on the developer feedback we received from you.
This release concludes the effort of updating our existing libraries to make the helper libraries more consistent, enable faster iteration, and improve the libraries by having a shared foundation across languages. The next-generation SDK family includes PHP, Java, .NET/C#, Python and Node.
Let’s take a deeper look at the new features of the Ruby library.
- Accessing resources: The new library makes Twilio API subdomains (Lookups, Conversations, Monitor, etc.) first-class citizens. You can now also pin a specific versions of the API.
- Listing resources: There are now two ways to get a list of resources—list and each.
- list ...