Class WebAudio.Sound

Handle one sound for WebAudio

Class Summary
Constructor Attributes Constructor Name and Description
 
WebAudio.Sound(world, nodeChain)
sound instance

Method Summary

Class Detail

WebAudio.Sound(world, nodeChain)
sound instance
Parameters:
{tQuery.World} world Optional
the world on which to run
{WebAudio.NodeChainBuilder} nodeChain Optional
the nodeChain to use

Method Detail

  • {Number} amplitude(width)
    compute the amplitude of the sound (not sure at all it is the proper term)
    Parameters:
    {Number} width
    the number of frequencyBin to take into account
    Returns:
    {Number} return the amplitude of the sound
  • buffer(value)
    getter/setter on the source buffer
    Parameters:
    {Number} value Optional
    the value to set, if not provided, get current value
  • destroy()
    destructor
  • {Boolean} isFollowing()
    Returns:
    {Boolean} true if this sound is following a object3d, false overwise
  • {Boolean} isPlayable()
    Returns:
    {Boolean} true if the sound is playable, false otherwise
  • load(url, callback)
    Load a sound
    Parameters:
    {String} url
    the url of the sound to load
    {Function} callback
    function to notify once the url is loaded (optional)
  • loop(value)
    getter/setter on the loop
    Parameters:
    {Number} value Optional
    the value to set, if not provided, get current value
  • makeHistogram(nBar)
    Put this function is .Sound with getByt as private callback
    Parameters:
    nBar
  • nodes()
    getter of the chain nodes
  • pannerCone(innerAngle, outerAngle, outerGain)
    Set parameter for the pannerCone
    Parameters:
    {Number} innerAngle
    the inner cone hangle in radian
    {Number} outerAngle
    the outer cone hangle in radian
    {Number} outerGain
    the gain to apply when in the outerCone
  • pannerConeInnerAngle(value)
    getter/setter on the pannerConeInnerAngle
    Parameters:
    {Number} value
    the angle in radian
  • pannerConeOuterAngle(value)
    getter/setter on the pannerConeOuterAngle
    Parameters:
    {Number} value
    the angle in radian
  • pannerConeOuterGain(value)
    getter/setter on the pannerConeOuterGain
    Parameters:
    {Number} value
    the value
  • play(time)
    play the sound
    Parameters:
    {Number} time Optional
    time when to play the sound
  • tone(hertz, seconds)
    Generate a sinusoid buffer. FIXME should likely be in a plugin
    Parameters:
    hertz
    seconds
  • volume(value)
    getter/setter on the volume
    Parameters:
    {Number} value Optional
    the value to set, if not provided, get current value