最近小程序項目需要錄制語音並上傳到服務器,經過查資料了解 目前微信小程序錄音的文件后綴名是silk,因此需要轉換。
經過查資料了解,參考一下的地址
https://github.com/kn007/silk-v3-decoder
需要安裝gcc ffmpeg
wget http://downloads.sourceforge.net/lame/lame-3.100.tar.gz tar -zxvf lame-3.100.tar.gz cd lame-3.100 ./configure --prefix=/usr/local make make install ln -s /usr/local/lib/libmp3lame.so.0.0.0 /usr/lib64/libmp3lame.so.0
wget http://ffmpeg.org/releases/ffmpeg-3.4.1.tar.bz2 tar -jxvf ffmpeg-3.4.1.tar.bz2 cd ffmpeg-3.4.1 ./configure --prefix=/usr/local --pkg-config-flags=--static --enable-libmp3lame --disable-x86asm make make install cd /usr/local/soft wget https://github.com/kn007/silk-v3-decoder/archive/master.zip unzip master.zip mv silk-v3-decoder-master silk-v3-decoder chmod -R +x /usr/local/soft/silk-v3-decoder/ silk-v3-decoder/converter.sh file mp3