Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebAPI: Update Method pages to modern structure (part 3) #14920

Merged
merged 2 commits into from
Apr 12, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This method may only be run once, to notify the user on a failed or a successful
## Syntax

```js
let updateUI = BackgroundFetchUpdateUIEvent.updateUI(options);
updateUI(options);
```

### Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ can be used to expose audio time and frequency data and create data visualizatio
## Syntax

```js
var analyserNode = baseAudioContext.createAnalyser();
createAnalyser();
```

### Returns
### Return value

An {{domxref("AnalyserNode")}}.

## Example
## Examples

The following example shows basic usage of an AudioContext to create an Analyser node,
then use requestAnimationFrame() to collect time domain data repeatedly and draw an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ filter configurable as several different common filter types.
## Syntax

```js
baseAudioContext.createBiquadFilter();
createBiquadFilter();
```

### Returns
### Return value

A {{domxref("BiquadFilterNode")}}.

## Example
## Examples

The following example shows basic usage of an AudioContext to create a Biquad filter
node. For a complete working example, check out our [voice-change-o-matic](https://mdn.github.io/voice-change-o-matic/) demo (look
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/baseaudiocontext/createbuffer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ reference page.
## Syntax

```js
var buffer = baseAudioContext.createBuffer(numOfChannels, length, sampleRate);
createBuffer(numOfChannels, length, sampleRate);
```

### Parameters
Expand All @@ -58,7 +58,7 @@ var buffer = baseAudioContext.createBuffer(numOfChannels, length, sampleRate);
- : The sample rate of the linear audio data in sample-frames per second. All browsers
must support sample rates in at least the range 8,000 Hz to 96,000 Hz.

### Returns
### Return value

An {{domxref("AudioBuffer")}} configured based on the specified options.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ track.
## Syntax

```js
var source = baseAudioContext.createBufferSource();
createBufferSource();
```

### Returns
### Return value

An {{domxref("AudioBufferSourceNode")}}.

## Example
## Examples

In this example, we create a two second buffer, fill it with white noise, and then play
it via an {{ domxref("AudioBufferSourceNode") }}. The comments should clearly explain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ which combines channels from multiple audio streams into a single audio stream.
## Syntax

```js
createChannelMerger(numberOfInputs)
createChannelMerger(numberOfInputs);
```

### Parameters
Expand All @@ -33,11 +33,11 @@ createChannelMerger(numberOfInputs)
- : The number of channels in the input audio streams, which the output stream will
contain; the default is 6 if this parameter is not specified.

### Returns
### Return value

A {{domxref("ChannelMergerNode")}}.

## Example
## Examples

The following example shows how you could separate a stereo track (say, a piece of
music), and process the left and right channel differently. To use them, you need to use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ which is used to access the individual channels of an audio stream and process t
## Syntax

```js
createChannelSplitter(numberOfOutputs)
createChannelSplitter(numberOfOutputs);
```

### Parameters
Expand All @@ -32,11 +32,11 @@ createChannelSplitter(numberOfOutputs)
- : The number of channels in the input audio stream that you want to output separately;
the default is 6 if this parameter is not specified.

### Returns
### Return value

A {{domxref("ChannelSplitterNode")}}.

## Example
## Examples

The following simple example shows how you could separate a stereo track (say, a piece
of music), and process the left and right channel differently. To use them, you need to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ value.
## Syntax

```js
var constantSourceNode = AudioContext.createConstantSource()
createConstantSource();
```

### Parameters

None.

### Returns
### Return value

A {{domxref('ConstantSourceNode')}} instance.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ Convolution](https://webaudio.github.io/web-audio-api/#background-3) for more in
## Syntax

```js
baseAudioContext.createConvolver();
createConvolver();
```

### Returns
### Return value

A {{domxref("ConvolverNode")}}.

## Example
## Examples

The following example shows basic usage of an AudioContext to create a convolver node.
The basic premise is that you create an AudioBuffer containing a sound sample to be used
Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/baseaudiocontext/createdelay/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ which is used to delay the incoming audio signal by a certain amount of time.
## Syntax

```js
var delayNode = audioCtx.createDelay(maxDelayTime);
createDelay(maxDelayTime);
```

### Parameters
Expand All @@ -33,12 +33,12 @@ var delayNode = audioCtx.createDelay(maxDelayTime);
- : The maximum amount of time, in seconds, that the audio signal can be delayed by.
Must be less than 180 seconds, and defaults to 1 second if not specified.

### Returns
### Return value

A {{domxref("DelayNode")}}. The default {{domxref("DelayNode.delayTime")}} is 0
seconds.

## Example
## Examples

We have created a simple example that allows you to play three different samples on a
constant loop — see [create-delay](https://chrisdavidmills.github.io/create-delay/) (you can also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ help avoid clipping (distorting) of the audio output.
## Syntax

```js
baseAudioCtx.createDynamicsCompressor();
createDynamicsCompressor();
```

### Returns
### Return value

A {{domxref("DynamicsCompressorNode")}}.

## Example
## Examples

The code below demonstrates a simple usage of `createDynamicsCompressor()`
to add compression to an audio track. For a more complete example, have a look at our [basic Compressor
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/baseaudiocontext/creategain/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ overall gain (or volume) of the audio graph.
## Syntax

```js
var gainNode = AudioContext.createGain();
createGain();
```

### Return value
Expand All @@ -37,7 +37,7 @@ audio whose volume has been adjusted in gain (volume) to a level specified by th
{{domxref("GainNode.gain")}} [a-rate](/en-US/docs/Web/API/AudioParam#a-rate)
parameter.

## Example
## Examples

The following example shows basic usage of an {{domxref("AudioContext")}} to create a
`GainNode`, which is then used to mute and unmute the audio when a Mute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ of filter.
## Syntax

```js
var iirFilter = AudioContext.createIIRFilter(feedforward, feedback);
createIIRFilter(feedforward, feedback);
```

### Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ waveform. It basically generates a constant tone.
## Syntax

```js
var oscillatorNode = audioCtx.createOscillator();
createOscillator();
```

### Returns
### Return value

An {{domxref("OscillatorNode")}}.

## Example
## Examples

The following example shows basic usage of an AudioContext to create an oscillator
node. For applied examples/information, check out our [Violent Theremin demo](https://mdn.github.io/violent-theremin/) ([see
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/baseaudiocontext/createpanner/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ audio.
createPanner();
```

### Returns
### Return value

A {{domxref("PannerNode")}}.

## Example
## Examples

In the following example, you can see an example of how the `createPanner()`
method, {{domxref("AudioListener")}} and {{domxref("PannerNode")}} would be used to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ that can be used to shape the output of an {{ domxref("OscillatorNode") }}.
## Syntax

```js
var wave = AudioContext.createPeriodicWave(real, imag[, constraints]);
createPeriodicWave(real, imag);
createPeriodicWave(real, imag, constraints);
```

### Returns
### Return value

A {{domxref("PeriodicWave")}}.

Expand All @@ -50,7 +51,7 @@ otherwise an error is thrown.

> **Note:** If normalized, the resulting wave will have a maximum absolute peak value of 1.

## Example
## Examples

The following example illustrates simple usage of `createPeriodicWave()`, to
create a {{domxref("PeriodicWave")}} object containing a simple sine wave.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ creates a {{domxref("ScriptProcessorNode")}} used for direct audio processing.
## Syntax

```js
var scriptProcessor = audioCtx.createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels);
createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels);
```

### Parameters
Expand Down Expand Up @@ -54,11 +54,11 @@ var scriptProcessor = audioCtx.createScriptProcessor(bufferSize, numberOfInputCh
> **Note:** It is invalid for both `numberOfInputChannels` and
> `numberOfOutputChannels` to be zero.

### Returns
### Return value

A {{domxref("ScriptProcessorNode")}}.

## Example
## Examples

The following example shows basic usage of a `ScriptProcessorNode` to take a
track loaded via {{domxref("BaseAudioContext/decodeAudioData", "AudioContext.decodeAudioData()")}}, process it, adding a bit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ It positions an incoming audio stream in a stereo image using a [low-cost pannin
## Syntax

```js
baseAudioContext.createStereoPanner();
createStereoPanner();
```

### Returns
### Return value

A {{domxref("StereoPannerNode")}}.

## Example
## Examples

In our [StereoPannerNode
example](https://mdn.github.io/webaudio-examples/stereo-panner-node/) ([see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ distortion. It is used to apply distortion effects to your audio.
## Syntax

```js
baseAudioCtx.createWaveShaper();
createWaveShaper();
```

### Returns
### Return value

A {{domxref("WaveShaperNode")}}.

## Example
## Examples

The following example shows basic usage of an AudioContext to create a wave shaper
node. For applied examples/information, check out our [Voice-change-O-matic](https://mdn.github.io/voice-change-o-matic/) [demo](https://mdn.github.io/voice-change-o-matic/) ([see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ install prompt at a time of their own choosing.
## Syntax

```js
BeforeInstallPromptEvent.prompt()
prompt();
```

### Parameters

None.

### Returns
### Return value

An empty {{jsxref("Promise")}}.

## Example
## Examples

```js
var isTooSoon = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ must be the same size as the array of input frequency values
## Syntax

```js
BiquadFilterNode.getFrequencyResponse(frequencyArray, magResponseOutput, phaseResponseOutput);
getFrequencyResponse(frequencyArray, magResponseOutput, phaseResponseOutput);
```

### Parameters
Expand Down Expand Up @@ -58,7 +58,7 @@ BiquadFilterNode.getFrequencyResponse(frequencyArray, magResponseOutput, phaseRe
- `InvalidAccessError`
- : The three arrays provided are not all of the same length.

## Example
## Examples

In the following example we are using a biquad filter on a media stream (for the full
demo, see our [stream-source-buffer
Expand Down Expand Up @@ -95,7 +95,7 @@ var freqResponseOutput = document.querySelector('.freq-response-output');

Finally, after creating our biquad filter, we use `getFrequencyResponse()`
to generate the response data and put it in our arrays, then loop through each data set
and output them in a human-readable list at the bottom of the page:
and output them in a human-readable list at the bottom of the page:

```js
var biquadFilter = audioCtx.createBiquadFilter();
Expand Down
Loading