Skip to content

RobSpectre/Twilio-Karaoke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twilio Karaoke

A ten-minute demo where you build a karaoke machine in front of an audience using Twilio and Heroku.

Originally given at PennApps 2012 Spring Hackathon.

Summary

This live-coding demonstration uses Twilio Client , Twilio Voice and Twilio SMS to piece together a karaoke machine on the fly starting from nothing but a blank file. The four components created are:

  • Microphone (Twilio Client to a Twilio Conference)
  • Speaker (Twilio Client to a Twilio Conference, muted)
  • Music (Twilio Voice to a Twilio Conference)
  • Lyrics (Twilio SMS iterating through text file)

Demo Outline

  • Intro
    • Who wants to sing karaoke (yay!)
    • Karaoke machine has four components
      • Microphone
      • Speaker
      • Music
      • Lyrics
    • We're going to create all of those things using Twilio
    • And we're going to do it right now.
  • Microphone
    • Create TwiML application for Conference Room
      • Write route for conference room
      • Create TwiML app in Twilio Dashboard
      • Assign to phone number
    • Create microphone
      • Call number from singer's cell phone
      • Alternatively, create a Twilio Client for the Conference Room
  • Speaker
    • Create another TwiML application to connect muted
      • Write route for conference room muted
      • Create TwiML app
    • Create Twilio Client for the Conference room
  • Music
    • Create yet another TwiML application to play music
    • Connect TwiML application to conference by using REST API
    • Create call with REST API to karaoke conference phone number
  • Lyrics
    • Search for song lyrics
    • Drop into text file
    • Create function to send text message to singer with a string
    • Iterate through file and send lyrics to singer

Hacking

Installation

Requires Python 2.5 or greater.

  1. Clone repo:
git clone git@github.com:RobSpectre/Twilio-Karoke.git
  1. Install dependencies:
cd Twilio-Karoke
pip install -r requirements.txt
  1. Login to Twilio (or signup for account).

  2. Create new TwiML App for Somebody Put Something In My Ring.

  3. Configure local_settings.py with your Twilio account details or use environment variables.

export ACCOUNT_SID='ACxxxxxxxxxxxxxxxxx'
export AUTH_TOKEN='yyyyyyyyyyyyyyyyyyyy'
export SPEAKER_APP_SID='APzzzzzzzzzzzzz'
export SPEAKER_CALLER_ID='+17778889999'
  1. Launch dev server.
python web.py

Note - a Procfile is included if you would prefer to use Foreman.

Structure

  • app.py - Core Flask app.
  • templates/index.html - Main webpage with Twilio Client integration.
  • music - Music file and lyrics for song ("Blitzkrieg Bop" lyrics included.

Deployment

This app is currently running on Heroku, but can be deployed to any WSGI compliant hosting provider. If it runs Python, it should be able to run this project.

Technologies

  • Flask - Python microframework. Makes all this go.
  • Heroku - Uber easy cloud hosting for Python (and lesser) apps.
  • Twilio, snacky.

Credits

Plug

Yes, this is what I do for a living.

Want to do it too? We're hiring.

githalytics.com alpha

About

A ten minute demo where an entire karaoke machine gets built before your very eyes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages