I'm capturing audio with WasapiLoopbackCapture
- format = IeeeFloat - SampleRate = 48000 - BitsPerSample = 32
I need to convert this to muLaw (8Khz, 8 bit, mono) - eventually it'll be sent to a phone via SIP trunking. I've tried 100s of samples (most of them with NAudio) and solutions but still have no clue how to do this ...
The Mu-Law tools in NAudio are limited so you might have to roll your own.
You'll need to set up a chain of
IWaveProvider
filters to convert to mono, change bit-rate, and change bit-depth.Then create a custom IWaveProvider for the next step.
The new provider can be sent directly to WaveOut
These filters remain in place with the BufferedWaveProvider as the "root". Whenever you call
BufferedWaveProvider.AddSamples()
, the data will go through all these filters.