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.

sampleRateBaseAudioContext インターフェイスのプロパティで、この音声コンテキスト内のすべてのノードが使用するサンプリングレートを、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 GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
sampleRate

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報