Back to Content

BaseAudioContext: createConstantSource() method

files/en-us/web/api/baseaudiocontext/createconstantsource/index.md

latest778 B
Original Source

{{APIRef("Web Audio API")}}

The createConstantSource() property of the {{domxref("BaseAudioContext")}} interface creates a {{domxref("ConstantSourceNode")}} object, which is an audio source that continuously outputs a monaural (one-channel) sound signal whose samples all have the same value.

[!NOTE] The {{domxref("ConstantSourceNode.ConstantSourceNode", "ConstantSourceNode()")}} constructor is the recommended way to create a {{domxref("ConstantSourceNode")}}; see Creating an AudioNode.

Syntax

js-nolint
createConstantSource()

Parameters

None.

Return value

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}