mu-law

Capture audio from WasapiLoopbackCapture, and convert to muLaw

喜夏-厌秋 提交于 2020-02-01 07:59:13
问题 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 ... 回答1: 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

Write silence audio data into file ffmpeg C++

别来无恙 提交于 2020-01-21 10:04:34
问题 I want to write silence/zeroed audio sampled data into mov media container file inside audio data. My audio data is G711 linear PCM-mulaw encoded data with one channel. Currently my code looks like: AVFrame* pSilentData = av_frame_alloc(); memset(&pSilentData->data[0], 0, iDataSize); pkt.data = (uint8_t*) pSilentData; pkt.size = iDataSize; // ... av_freep(&pSilentData->data[0]); av_frame_free(&pSilentData); But this sounds noise like dot dot instead of silence. What's the problem? 回答1: For µ