Is it possible to compress a wav audio file without reducing the sampling rate?
I have an audio file with 256 bit rate and sampling rate - 8000Hz. I would just like to reduce the bit rate to 128/64 kbs
I tried converting to mp3 and back to wav, ffmpeg -i input.wav 1.mp3 ffmpeg -i "1.mp3" -acodec pcm_s16le -ar 4000 out.wav but this reduced sampling rate as well. ffmpeg -i "1.mp3" -acodec pcm_s16le -ab 128 out.wav has default 256 bit rate
PCM ("WAV") is uncompressed, so
-b:a
/-ab
is ignored.Calculating PCM bitrate
Assuming a stereo input, 8000 samples per second, 16 bits per sample:
Determine channels, sample rate, bit depth
You can just view the output of
ffmpeg -i input.wav
or useffprobe
for a more concise output:Reducing bitrate
You can reduce the number of channels, change the sample rate, and/or change the bit depth, but another option is to use a lossless compressed format such as FLAC:
I usually do this using Audacity
1) import the wav file to audacity
2) Then File>Export
3) Choose "Constant" and then from the Quality drop-down select your required bit-rate
I haven't tried that with ffmpeg, but the command should be: