Class tQuery.WebAudio.Sound

Handle one sound for tQuery.WebAudio

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

Method Summary

Class Detail

tQuery.WebAudio.Sound(world, nodeChain)
sound instance
Parameters:
{tQuery.World} world Optional
the world on which to run
{tQuery.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
  • destroy()
    destructor
  • follow(object3d)
    follow a object3D
    Parameters:
    object3d
  • {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
  • 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
  • unfollow()
    unfollow the object3D if any
  • updateWithMatrix4(matrixWorld, deltaTime)
    Update the source with a matrixWorld. usefull for positional sounds
    Parameters:
    {THREE.Matrix4} matrixWorld
    the matrixWorld describing the position of the sound
    {Number} deltaTime
    the number of seconds since last update
  • updateWithObject3d(object3d, deltaTime)
    Update the source with object3d. usefull for positional sounds
    Parameters:
    {THREE.Object3D} object3d
    the object which originate the source
    {Number} deltaTime
    the number of seconds since last update
  • volume(value)
    getter/setter on the volume
    Parameters:
    {Number} value Optional
    the value to set, if not provided, get current value