Js acquires audio sampling rate

for an audio file, can I use js to get its sampling rate?

Mar.21,2021

in theory, as long as you know the format of the audio file.

for example, the sampling rate of a MP3 file can be obtained by parsing the contents of the file


Web API AudioBuffer has a sampleRate read-only property

AudioBuffer.sampleRate read-only
sampling rate of PCM data stored in the cache: floating point, in sample/s.

refer to MDN:
https://developer.mozilla.org.

Menu