Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
The ConstantSourceNode() constructor creates a new ConstantSourceNode object instance, representing an audio source which constantly outputs samples whose values are always the same.
An AudioContext representing the audio context you want the node to be associated with.
optionsA ConstantSourceOptions dictionary object defining the properties you want the ConstantSourceNode to have:
offsetA read-only AudioParam specifying the constant value generated by the source. The default is 1.0. The normal range is -1.0 to 1.0, but the value can be anywhere in the range from -Infinity to Infinity.
In this example, an audio context is created, then a ConstantSourceNode is established with its offset initialized to 0.5.
Note: The new ConstantSourceNode created by the constructor has a channelCount of 2.
| Web Audio API # dom-constantsourcenode-constantsourcenode |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jun 23, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.