Get PCM data have lots of noise?

leo9960

New Member
I want get pcm audio data to write in the file, but lots of noise have in it.

LPBYTE buffer;
capture->GetBuffer(&buffer, &frames, &flags, &pos, &ts);
obs_source_audio data = {};
data.data[0] = (const uint8_t*)buffer;
data.frames = (uint32_t)frames;
data.speakers = speakers;
data.samples_per_sec = sampleRate;
data.format = format;
data.timestamp = useDeviceTiming ? ts * 100 : os_gettime_ns();
fwrite(buffer,1, get_audio_size(data.format, data.speakers, data.frames), ft);

Can I write this?
 
Top