參考:
- https://developer.mozilla.org/zh-CN/docs/Web/API/AudioContext/createScriptProcessor
- https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API
1. 在錄音采樣過程中
采樣數 = sample_rate ; 采樣大小 = sample_rate * sample_width/8
如果采樣寬度sample_width是paInt16,那么16位整數采樣的字節/長度是2字節
paInt16整形是特定的錄音采樣數據類型,來自於pyaudio.paInt16;
在數組數據類型轉換時np.int16。 np.fromstring(data, dtype = np.int16)
frame_duration_ms = 30ms padding_duration_ms = 300ms
2.