How does JavaScript modify the sampling rate (sampleRate) of audio?

because using JavaScript to call iFLYTEK speech recognition Web API, iFLYTEK (and others) only supports audio with a 16K sampling rate of (sampleRate). However, HTML5"s Web Audio has not found a way to convert the sampling rate.

searched several other people"s methods on the Internet, and all of them had problems such as unable to play after audio conversion.

is there any convenient way for JavaScript to convert the sampling rate?


OfflineAudioContext learn about

https://developer.mozilla.org.

seems interesting, so I wrote a demo:
https://jsfiddle.net/liqi0816.

.

record first, prompt to finish, then convert, and then play back. If the headphones are good enough, the noise caused by non-integer conversion of the sampling rate can be clearly recognized.

the above code is tested under Chrome67.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36aba-2b7ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36aba-2b7ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?