Class ccs.ComAudio

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for ccs.ComAudio

Method Summary

Class Detail

ccs.ComAudio()
Base class for ccs.ComAudio

Method Detail

  • <static> {ccs.ComAudio} ccs.ComAudio.create()
    allocates and initializes a ComAudio.
    // example
    var com = ccs.ComAudio.create();
    Returns:
    {ccs.ComAudio}
  • {Number} getBackgroundMusicVolume()
    The volume of the music max value is 1.0,the min value is 0.0 .
    Returns:
    {Number}
  • {Number} getEffectsVolume()
    The volume of the effects max value is 1.0,the min value is 0.0 .
    Returns:
    {Number}
  • {string} getFile()
    File path Getter
    Returns:
    {string}
  • {Boolean} isBackgroundMusicPlaying()
    Whether the music is playing.
    Returns:
    {Boolean}
  • {boolean} isLoop()
    Whether is loop
    Returns:
    {boolean}
  • pauseAllEffects()
    Pause all effects
  • pauseBackgroundMusic()
    Pause background music
  • pauseEffect(soundId)
    Pause playing sound effect.
    Parameters:
    {Number} soundId
  • playBackgroundMusic(pszFilePath, loop)
    Play background music
    Parameters:
    {String} pszFilePath
    {Boolean} loop
  • {Boolean} playEffect(pszFilePath, loop)
    Play sound effect.
    Parameters:
    {String} pszFilePath
    {Boolean} loop
    Returns:
    {Boolean}
  • preloadBackgroundMusic(pszFilePath)
    Preload background music resource
    Parameters:
    {String} pszFilePath
  • preloadEffect(pszFilePath)
    Preload effect
    Parameters:
    {String} pszFilePath
  • resumeAllEffects()
    Resume all effects
  • resumeBackgroundMusic()
    Resume background music
  • resumeEffect(soundId)
    Resume effect
    Parameters:
    {Number} soundId
  • rewindBackgroundMusic()
    Rewind background music
  • setBackgroundMusicVolume(volume)
    Set the volume of music.
    Parameters:
    {Number} volume
    must be in 0.0~1.0 .
  • setEffectsVolume(volume)
    Set the volume of sound effects.
    Parameters:
    {Number} volume
  • setFile(pszFilePath)
    File path setter
    Parameters:
    {String} pszFilePath
  • setLoop(loop)
    Set loop
    Parameters:
    {Boolean} loop
  • stopAllEffects()
    stop all effects
  • stopBackgroundMusic(releaseData)
    Stop background music
    Parameters:
    {String} releaseData
  • stopEffect(soundId)
    Stop effect
    Parameters:
    {Number} soundId
  • unloadEffect(pszFilePath)
    Unload effect
    Parameters:
    {String} pszFilePath
  • {boolean} willPlayBackgroundMusic()
    Indicates whether any background music can be played or not.
    Returns:
    {boolean}