I wrote a fairly detailed article to explain how to convert between various audio types in .NET (many using NAudio) With ACM codecs, you can usually only change one thing at a time - e.g. Changing the sample rate (e.g. 48kHz -> 8kHz) Changing the channel count (e.g. mono -> stereo) Changing the bit depth (e.g. 32 bit float -> 16 bit integer)
The only way to do it is to convert into another file and replace the original files. Or you can convert it to another folder and replace the original folder, it's easier. For Windows: mkdir outdir for %i in (*.bmp) do ( ffmpeg -i %i -ar 22050 outdir\%i ) Note: Replace %i with %%i when putting it in Windows batch file. Output of the decoder are pcm samples. if your input is 16-bit stereo 44100Hz, then each frame is 16 bit*2 channels = 4 bytes, each second is 44100 * 4 bytes. Skip as many output bytes as you need until start of the desired part, then dump 44100 * 4 * 40 bytes for 40 your seconds. You can even do mixing to mono and then cutting to 8-bit as you go. I am trying to convert .mp3 file to .wav format. when I am using below command in "command prompt" I am able to get desired output. it gives me output file in .wav format sox "C:\Users\Desktop\Audio

Below are softwares and online converter you can use to convert to 16 bit Mono 8k PCM waf format. Option 1: g711.org. This free online tool will convert just about any DRM-free media file into audio that's compatible with most telephony vendors' Music on Hold and IVR Announcements.

Is what I found on the internet. But the outfile is not a pcm wav: file *.wav RIFF (little-endian) data, WAVE audio, mono 22050 Hz Where a reference wav from xiph.org is pcm. file wb_male.wav RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz speexenc does encode the last PCM WAV, but does not with the mplayer file. Why yiGyDN. 45 82 124 266 235 279 112 160 288

convert mp3 to wav mono 16 bit