sudo apt-get install sox
通过 play 查看音频格式 play male_audio.wav
play WARN alsa: can't encode 0-bit Unknown or not applicable
male_audio.wav:
File Size: 184k Bit Rate: 706k
Encoding: Signed PCM
Channels: 1 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
Duration: 00:00:02.08
In:100% 00:00:02.08 [00:00:00.00] Out:91.9k [ | ] Clip:0
Done.
sox 命令:
sox [global-options]
[format-options] infile1
[[format-options] infile2] ...
[format-options] outfile
[effect [effect-options]] ...
• input.raw has single channel
• It uses 16-bit linear PCM
• Sample rate is 16kHz
command:
sox -c 1 -e signed-integer -b 16 -r 16000 input.raw
output.wav remix 1
sox input.wav output.wav remix 2 1
且第二个声道中的数值 为0;
sox input.wav output.wav remix 1 0 1
sox input.wav -r 8000 output.wav
Convert 16-bit linear PCM file to μ-law.
sox input.wav -e mu-law output.wav
Convert from WAV to FLAC format.
sox input.wav output.flac
sudo apt install ffmpeg
Convert MP4 file to WAV:
ffmpeg -i input.mp4 output.wav