Closed bespsm closed 1 year ago
for those who are also looking the answer, data can be scaled to the different format pcm_s16le, this way it has no noise
scaled = np.int16(data / np.max(np.abs(data)) * 32767)
Soundcard gets float data from the OSs' audio APIs. It returns that data as float numpy arrays. What you get is the raw data. int16 PCM is only the default in WAV files, but there's nothing "raw" about it.
using classical example of recording audio from speaker, I can easily save the data to the file using "soundfile" library. What if I want to use raw data (bytes) further it in my app, how can I convert it?
any guess?