Created
April 16, 2012 09:23
-
-
Save tonistiigi/2397232 to your computer and use it in GitHub Desktop.
LimeJS Audio updates sample.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Still support old way: | |
var tromboon = new lime.audio.Audio('assets/tromboon_sample.mp3'); | |
tromboon.play(); | |
tromboon.stop(); | |
// Support for audio sprites: | |
// Actual Zynga Player is created on first touch of the director. | |
var audio = new lime.audio.AudioMap({ | |
resources: [ | |
'media/spritemap-cajon.ac3', | |
'media/spritemap-cajon.mp3', | |
'media/spritemap-cajon.m4a', | |
'media/spritemap-cajon.ogg' | |
], | |
autoplay: 'bg-music', | |
spritemap: { | |
'bg-music': { | |
'start': 0.00, | |
'end': 4.20, | |
'loop': true // Important! Background Music MUST have it | |
}, | |
'cajon-2': { | |
'start': 5.00, | |
'end': 9.30 | |
} | |
} | |
}); | |
audio.play('cajon-2'); | |
audio.stop(); | |
// Global Mute switch | |
lime.audio.getMute(); | |
lime.audio.setMute(bool); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment