Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

branch: public
Octocat-spinner-32 music Removed binaries. January 13, 2012
Octocat-spinner-32 templates Added template. January 13, 2012
Octocat-spinner-32 .gitignore Merged. January 13, 2012
Octocat-spinner-32 Procfile Added template. January 13, 2012
Octocat-spinner-32 README.md Added analytics to README. July 11, 2013
Octocat-spinner-32 app.py Speaker added. January 13, 2012
Octocat-spinner-32 requirements.txt Added template. January 13, 2012
README.md

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

2) Install dependencies:

cd Twilio-Karoke
pip install -r requirements.txt

3) Login to Twilio (or signup for account).

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

5) 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'

6) 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

Something went wrong with that request. Please try again.