Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2016-0-4 21:22

Class enchant.WebAudioSound

Sound wrapper class for Web Audio API (supported on some webkit-based browsers)

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
Current playback position (seconds).
 
Sound file duration (seconds).
 
Volume.

Method Summary

Method Attributes Method Name and Description
 
Create a copy of this Sound object.
<static>  
enchant.WebAudioSound.load(src, type, callback, onerror)
Loads an audio file and creates WebAudioSound object.
 
Pause playback.
 
play(dup)
Begin playing.
 
stop()
Stop playing.
Methods borrowed from class enchant.EventTarget:
addEventListener
clearEventListener
dispatchEvent
on
removeEventListener

Class Detail

enchant.WebAudioSound()

Field Detail

{Number} currentTime
Current playback position (seconds).
{Number} duration
Sound file duration (seconds).
{Number} volume
Volume. 0 (muted) ~ 1 (full volume).

Method Detail

  • Create a copy of this Sound object.
    Returns:
    {enchant.WebAudioSound} Copied Sound.
  • <static> {enchant.WebAudioSound} enchant.WebAudioSound.load(src, type, callback, onerror)
    Loads an audio file and creates WebAudioSound object.
    Parameters:
    {String} src
    Path of the audio file to be loaded.
    {String} type Optional
    MIME Type of the audio file.
    {Function} callback Optional
    on load callback.
    {Function} onerror Optional
    on error callback.
    Returns:
    {enchant.WebAudioSound} WebAudioSound
  • pause()
    Pause playback.
  • play(dup)
    Begin playing.
    Parameters:
    {Boolean} dup Optional, Default: false
    If true, Object plays new sound while keeps last sound.
  • stop()
    Stop playing.