Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 

README.md

#cocos2d-html5-howler

###not compatible with cocos2d 3.x at the moment!

##Description

Extension of SimpleAudioEngine.js to use howler.js as Audio Engine.

Howler.js

howler on github

Howler uses the Web Audio API and the HTML5 Audio API as fallback. Why ist the Web Audio API better as the Audio API?

Web Audio is much more flexible and on the iPhone/iPad the Audio API is really bad.


TODO: make it compatible with cocos2d 3.x

##Use

add the 'howler.js' and 'HowlerAudioEngine.js' to your loader config


change in SimpleAudioEngine.js:

cc.AudioEngine.getInstance = function () {
if (!this._instance) {
    this._instance = new cc.AudioEngine();
    this._instance.init();
}
return this._instance;
};

to:

cc.AudioEngine.getInstance = function () {
if (sys.platform === "browser") {
    if (!this._instance) {
        this._instance = new cc.HowlerAudioEngine();
        this._instance.init();
    }
} else {
    if (!this._instance) {
        this._instance = new cc.AudioEngine();
        this._instance.init();
    }
}
return this._instance;
};

so the preloader can use howler

##License

Released under the MIT License.

About

Extension of SimpleAudioEngine.js to use howler.js as Audio Engine.

Resources

Releases

No releases published
You can’t perform that action at this time.