Record audio on web, preset: 16000Hz 16bit

后端 未结 4 1015
终归单人心
终归单人心 2021-01-05 08:02
function floatTo16BitPCM(output, offset, input){
  for (var i = 0; i < input.length; i++, offset+=2){
    var s = Math.max(-1, Math.min(1, input[i]));
    output.         


        
4条回答
  •  孤街浪徒
    2021-01-05 08:56

    I do not believe you can control sample rate using Web Audio API ... it picks up the system default sample rate which is defined outside the browser ... of course subsequent to recording, you can programmatically alter your audio to resample to any sample rate ... Most audio players can only play media of standard sample rates ... being able to render an off sample rate of 16 kHz might be more challenging than resampling from 44.1 to 16 kHz

提交回复
热议问题