BaseAudioContext: sampleRate プロパティ
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.
sampleRate
は BaseAudioContext
インターフェイスのプロパティで、この音声コンテキスト内のすべてのノードが使用するサンプリングレートを、1 秒あたりのサンプル数で表した浮動小数点数を返すものです。
この制限は、サンプリングレートコンバーターに対応していないことを意味します。
値
音声コンテキストのサンプリングレートを、 1 秒当たりのサンプル数で示す浮動小数点数です。
例
メモ:
完全なウェブオーディオの実装の例は、GitHub の MDN リポジトリー にあるいずれかのウェブオーディオのデモを参照してください。
ブラウザーのコンソールで audioCtx.sampleRate
と入力してみてください。
js
const audioCtx = new AudioContext();
// 古い webkit/blink のブラウザーでは接頭辞が必要です
// …
console.log(audioCtx.sampleRate);
仕様書
Specification |
---|
Web Audio API # dom-baseaudiocontext-samplerate |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
sampleRate |
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.