FLAC (无损音频压缩编码)-百度百科简介
使用sox工具把flac格式转wav,命令如下:
sox 1.flac 1.wav
如果你的 flac 通道数、采样率、量化进度和wav不一致的话,需要加相应参数,如:
sox 1.flac -c 1 -r 16000 -b 16 1.wav
Linux使用Shell循环遍历文件夹里的音频进行转换的代码如下:
#!/bin/bashfunction flacToWav(){echo $1ext=${1##*.}echo $extif [ $ext = 'flac' ]then#echo "True"filename=$(basename $1 .flac)echo $filenamesox $1 ${filename}.wavrm -rf $1fi}function travFolder(){echo $1flist=`ls $1`cd $1#echo $flistfor f in $flistdoif test -d $fthentravFolder $felseflacToWav $ffidonecd ../}travFolder $1
我的个人音频批量转换shell命令如下:
tar zxvf dev-other.tar.gz ./flacToWav.sh LibriSpeech/mkdir dev-othercp -r LibriSpeech/ dev-otherzip -r dev-other.zip dev-other