Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions docs/api/audio/Audio.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,24 @@ <h3>[property:String type]</h3>

<h2>Methods</h2>

<h3>[method:null connect]()</h3>
<h3>[method:Audio connect]()</h3>
<p>
Connect to the [page:Audio.source]. This is used internally on initialisation and when
setting / removing filters.
</p>

<h3>[method:null disconnect]()</h3>
<h3>[method:Audio disconnect]()</h3>
<p>
Disconnect from the [page:Audio.source]. This is used internally when
setting / removing filters.
</p>

<h3>[method:Array getFilter]()</h3>
<h3>[method:BiquadFilterNode getFilter]()</h3>
<p>
Returns the first element of the [page:Audio.filters filters] array.
</p>

<h3>[method:null getFilters]()</h3>
<h3>[method:Array getFilters]()</h3>
<p>
Returns the [page:Audio.filters filters] array.
</p>
Expand All @@ -131,22 +131,22 @@ <h3>[method:GainNode getOutput]()</h3>
Return the [page:Audio.gain gainNode].
</p>

<h3>[method:Number getPlaybackRate]()</h3>
<h3>[method:Float getPlaybackRate]()</h3>
<p>
Return the value of [page:Audio.playbackRate playbackRate].
</p>

<h3>[method:Number getVolume]( value )</h3>
<h3>[method:Float getVolume]( value )</h3>
<p>
Return the current volume.
</p>

<h3>[method:null play]()</h3>
<h3>[method:Audio play]()</h3>
<p>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, starts playback.
</p>

<h3>[method:null pause]()</h3>
<h3>[method:Audio pause]()</h3>
<p>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is true, pauses playback.
</p>
Expand All @@ -162,7 +162,7 @@ <h3>[method:Audio setBuffer]( audioBuffer )</h3>
If [page:Audio.autoplay autoplay], also starts playback.
</p>

<h3>[method:null setFilter]( filter )</h3>
<h3>[method:Audio setFilter]( filter )</h3>
<p>
Applies a single [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNode] to the audio.
</p>
Expand All @@ -173,37 +173,37 @@ <h3>[method:Audio setFilters]( [param:Array value] )</h3>
Applies an array of [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes] to the audio.
</p>

<h3>[method:null setLoop]( [param:Boolean value] )</h3>
<h3>[method:Audio setLoop]( [param:Boolean value] )</h3>
<p>
Set [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop] to *value*
(whether playback should loop).
</p>

<h3>[method:null setMediaElementSource]( mediaElement )</h3>
<h3>[method:Audio setMediaElementSource]( mediaElement )</h3>
<p>
Applies the given object of type [link:https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement HTMLMediaElement] as the source of this audio.<br />
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.

</p>

<h3>[method:null setNodeSource]( audioNode )</h3>
<h3>[method:Audio setNodeSource]( audioNode )</h3>
<p>
Setup the [page:Audio.source source] to the audioBuffer, and sets [page:Audio.sourceType sourceType] to 'audioNode'.<br />
Also sets [page:Audio.hasPlaybackControl hasPlaybackControl] to false.

</p>

<h3>[method:null setPlaybackRate]( [param:Number value] )</h3>
<h3>[method:Audio setPlaybackRate]( [param:Float value] )</h3>
<p>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, set the [page:Audio.playbackRate playbackRate] to *value*.
</p>

<h3>[method:null setVolume]( [param:Number value] )</h3>
<h3>[method:Audio setVolume]( [param:Float value] )</h3>
<p>
Set the volume.
</p>

<h3>[method:null stop]()</h3>
<h3>[method:Audio stop]()</h3>
<p>
If [page:Audio.hasPlaybackControl hasPlaybackControl] is enabled, stops playback,
resets [page:Audio.startTime startTime] to *0* and sets [page:Audio.isPlaying isPlaying] to false.
Expand Down
8 changes: 4 additions & 4 deletions docs/api/audio/AudioListener.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h3>[method:GainNode getInput]()</h3>
Return the [page:AudioListener.gain gainNode].
</p>

<h3>[method:null removeFilter]()</h3>
<h3>[method:AudioListener removeFilter]()</h3>
<p>
Set the [page:AudioListener.filter filter] property to *null*.
</p>
Expand All @@ -86,17 +86,17 @@ <h3>[method:AudioNode getFilter]()</h3>
Returns the value of the [page:AudioListener.filter filter] property.
</p>

<h3>[method:null setFilter]( [param:AudioNode value] )</h3>
<h3>[method:AudioListener setFilter]( [param:AudioNode value] )</h3>
<p>
Set the [page:AudioListener.filter filter] property to *value*.
</p>

<h3>[method:Number getMasterVolume]()</h3>
<h3>[method:Float getMasterVolume]()</h3>
<p>
Return the volume.
</p>

<h3>[method:null setMasterVolume]( [param:Number value] )</h3>
<h3>[method:AudioListener setMasterVolume]( [param:Number value] )</h3>
<p>
Set the volume.
</p>
Expand Down
15 changes: 8 additions & 7 deletions docs/api/audio/PositionalAudio.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ <h1>[name]</h1>
<h2>Example</h2>

<p>
[example:webaudio_orientation webaudio / orientation ]</br>
[example:webaudio_sandbox webaudio / sandbox ]</br>
[example:webaudio_timing webaudio / timing ]
</p>
Expand Down Expand Up @@ -82,22 +83,22 @@ <h3>[method:PannerNode getOutput]()</h3>
Returns the [page:PositionalAudio.panner panner].
</p>

<h3>[method:Number getRefDistance]()</h3>
<h3>[method:Float getRefDistance]()</h3>
<p>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
</p>

<h3>[method:PannerNode setRefDistance]( [param:Number value] )</h3>
<h3>[method:PositionalAudio setRefDistance]( [param:Number value] )</h3>
<p>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance panner.refDistance].
</p>

<h3>[method:PannerNode getRolloffFactor]()</h3>
<h3>[method:Float getRolloffFactor]()</h3>
<p>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
</p>

<h3>[method:PannerNode setRolloffFactor]( [param:Number value] )</h3>
<h3>[method:PositionalAudio setRolloffFactor]( [param:Number value] )</h3>
<p>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor panner.rolloffFactor].
</p>
Expand All @@ -107,17 +108,17 @@ <h3>[method:String getDistanceModel]()</h3>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel].
</p>

<h3>[method:String setDistanceModel]( [param:String value] )</h3>
<h3>[method:PositionalAudio setDistanceModel]( [param:String value] )</h3>
<p>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel panner.distanceModel].
</p>

<h3>[method:PannerNode getMaxDistance]()</h3>
<h3>[method:Float getMaxDistance]()</h3>
<p>
Returns the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance].
</p>

<h3>[method:PannerNode setMaxDistance]( [param:Number value] )</h3>
<h3>[method:PositionalAudio setMaxDistance]( [param:Number value] )</h3>
<p>
Sets the value of [link:https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance panner.maxDistance].
</p>
Expand Down
6 changes: 6 additions & 0 deletions src/audio/AudioListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {

}

return this;

},

getFilter: function () {
Expand All @@ -68,6 +70,8 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {
this.gain.connect( this.filter );
this.filter.connect( this.context.destination );

return this;

},

getMasterVolume: function () {
Expand All @@ -80,6 +84,8 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {

this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );

return this;

},

updateMatrixWorld: ( function () {
Expand Down
8 changes: 8 additions & 0 deletions src/audio/PositionalAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {

this.panner.refDistance = value;

return this;

},

getRolloffFactor: function () {
Expand All @@ -48,6 +50,8 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {

this.panner.rolloffFactor = value;

return this;

},

getDistanceModel: function () {
Expand All @@ -60,6 +64,8 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {

this.panner.distanceModel = value;

return this;

},

getMaxDistance: function () {
Expand All @@ -72,6 +78,8 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {

this.panner.maxDistance = value;

return this;

},

updateMatrixWorld: ( function () {
Expand Down