Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. BaseAudioContext
  4. sampleRate

BaseAudioContext: sampleRate property

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.

ThesampleRate property of theBaseAudioContext interface returns a floating point number representing the sample rate, in samples per second, used by all nodes in this audio context.This limitation means that sample-rate converters are not supported.

Value

A floating point number indicating the audio context's sample rate, in samples persecond.

Examples

Note:For a full Web Audio example implementation, see one of ourWeb Audio Demos on theMDN GitHub repo. Try enteringaudioCtx.sampleRate into your browser console.

js
const audioCtx = new AudioContext();// Older webkit/blink browsers require a prefix// …console.log(audioCtx.sampleRate);

Specifications

Specification
Web Audio API
# dom-baseaudiocontext-samplerate

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp