Class cc.AudioEngine

Class Summary
Constructor Attributes Constructor Name and Description
 
A simple Audio Engine engine API.

Method Summary

Class Detail

cc.AudioEngine()
A simple Audio Engine engine API.

Method Detail

  • <static> cc.AudioEngine.end()
    Stop all music and sound effects
    //example
    cc.AudioEngine.end();
  • {Number} getEffectsVolume()
    The volume of the effects max value is 1.0,the min value is 0.0 .
    //example
    var effectVolume = cc.AudioEngine.getInstance().getEffectsVolume();
    Returns:
    {Number}
  • <static> {cc.AudioEngine} cc.AudioEngine.getInstance()
    Get the shared Engine object, it will new one when first time be called.
    Returns:
    {cc.AudioEngine}
  • {Boolean} isFormatSupported(ext)
    search in this._supportedFormat if ext is there
    Parameters:
    {String} ext
    Returns:
    {Boolean}
  • preloadEffect(path)
    Preload effect resource.
    Parameters:
    {String} path
  • preloadMusic(path)
    Preload music resource.
    Parameters:
    {String} path
  • {boolean} willPlayMusic()
    Indicates whether any background music can be played or not.
    Returns:
    {boolean} true if the background music is playing, otherwise false