Skip to content

TheSean/cocos2d-html5-howler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#cocos2d-html5-howler

##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 the iphone/ipad the Audio API is really bad.


TODO: nothing

##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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published