Skip to content

Check for sdlmixer before falling back on dummy player? #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

require.paths.unshift(require('path').join(__dirname, 'lib'));

var JSONloops = require('JSONloops');
Expand Down
15 changes: 12 additions & 3 deletions vendor/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
var player;

try {
var irrKlang = require(__dirname + "/../../node-irrklang/lib/irrklang").irrKlang
player = new irrKlang()
console.warn("trying irrklang");
var irrKlang = require(__dirname + "/../../node-irrklang/lib/irrklang").irrKlang;
player = new irrKlang();
} catch (e) {
player = { play : function() { /* noop */ } };

try {
console.warn("trying sdlmixer");
player = require("sdlmixer");

} catch (e) {
console.warn("giving up, using stub");
player = { play : function() { /* noop */ } };
}
}

if(typeof exports === 'undefined'){
Expand Down