Skip to content

Commit

Permalink
added support for sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpacker committed Aug 2, 2012
1 parent 9af5187 commit 2e2b0af
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -12,7 +12,8 @@
"dependencies": {
"express": "~2.5.11",
"socket.io": "~0.9.6",
"coffee-script": "~1.3.3"
"coffee-script": "~1.3.3",
"play": "~0.5.0"
},
"devDependencies": {}
}
6 changes: 5 additions & 1 deletion server.coffee
Expand Up @@ -4,6 +4,7 @@ app = express.createServer()
io = require('socket.io').listen(app)
pubdir = "#{__dirname}/pub"
events = new Emitter
play = require('play').sound

app.use express.bodyParser()
app.listen 4567
Expand All @@ -19,4 +20,7 @@ app.get '/', (req, res) ->

app.post '/log', (req, res) ->
events.emit 'log', req.body
res.send 200
res.send 200

app.post '/sound/:sound', (req, res) ->
play(req.params.sound)
Binary file added sounds/brass.wav
Binary file not shown.
Binary file added sounds/fanfair.aiff
Binary file not shown.

0 comments on commit 2e2b0af

Please sign in to comment.