J
josh_bauer2020
Guest
I recorded sound from speakers as 32 bits with NAudio
but wished to have it as 16 bits. What is best way to do so?
Code sample is below:
WasapiLoopbackCapture CaptureInstance = new WasapiLoopbackCapture();
WaveFileWriter RecordedAudioWriter = new WaveFileWriter(outputFilePath, CaptureInstance.WaveFormat);
CaptureInstance.DataAvailable += (s, a) =>
{
RecordedAudioWriter.Write(a.Buffer, 0, a.BytesRecorded);
};
CaptureInstance.RecordingStopped += (s, a) =>
{
RecordedAudioWriter.Dispose();
RecordedAudioWriter = null;
CaptureInstance.Dispose();
};
CaptureInstance.StartRecording();
Continue reading...
but wished to have it as 16 bits. What is best way to do so?
Code sample is below:
WasapiLoopbackCapture CaptureInstance = new WasapiLoopbackCapture();
WaveFileWriter RecordedAudioWriter = new WaveFileWriter(outputFilePath, CaptureInstance.WaveFormat);
CaptureInstance.DataAvailable += (s, a) =>
{
RecordedAudioWriter.Write(a.Buffer, 0, a.BytesRecorded);
};
CaptureInstance.RecordingStopped += (s, a) =>
{
RecordedAudioWriter.Dispose();
RecordedAudioWriter = null;
CaptureInstance.Dispose();
};
CaptureInstance.StartRecording();
Continue reading...