OscillatorNode.frequency
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
frequency
は OscillatorNode
インターフェイスのプロパティで、 a-rate の AudioParam
であり、これは発振器の周波数をヘルツ単位で表します。
メモ:
返される AudioParam
は読み取り専用ですが、それが表す値は読み取り専用ではありません。
値
a-rate の AudioParam
です。
例
以下の例は、発振器ノードを作成するための AudioContext
の基本的な使用方法を示しています。応用例については、 Violent Theremin demo を見てみてください。(関連するコードは app.js を参照)。
js
// create web audio api context
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
// create Oscillator node
const oscillator = audioCtx.createOscillator();
oscillator.type = "square";
oscillator.frequency.setValueAtTime(440, audioCtx.currentTime); // value in hertz
oscillator.start();
仕様書
Specification |
---|
Web Audio API # dom-oscillatornode-frequency |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
frequency |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.