Movatterモバイル変換


[0]ホーム

URL:


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

MediaTrackSettings: sampleRate property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

TheMediaTrackSettings dictionary'ssampleRate property is an integer indicating how manyaudio samples per second theMediaStreamTrack is currently configuredfor. This lets you determine what value was selected to comply with your specifiedconstraints for this property's value as described in theMediaTrackConstraints.sampleRate property you provided when callingeithergetUserMedia() orMediaStreamTrack.applyConstraints().

If needed, you can determine whether or not this constraint is supported by checkingthe value ofMediaTrackSupportedConstraints.sampleRate as returned by acall toMediaDevices.getSupportedConstraints(). However, typically thisis unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value

An integer value indicating how many samples each second of audio data includes. Commonvalues include 44,100 (standard CD audio), 48,000 (standard digital audio), 96,000(commonly used in audio mastering and post-production), and 192,000 (used forhigh-resolution audio in professional recording and mastering sessions). However, lowervalues are often used to reduce bandwidth requirements; 8,000 samples per second isadequate for comprehensible albeit imperfect human speech, and both 11,025 FPS and22,050 FPS are often used for low-bandwidth, reduced quality sound and music.

Examples

See theConstraint exerciser example.

Specifications

Specification
Media Capture and Streams
# dom-mediatrackconstraintset-samplerate

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp