录音上传转换问题
发布于 5 年前 作者 ping90 18886 次浏览 来自 问答

windows下微信开发者工具,录音然后上传到服务器通过silk-v3-decoder进行转换成WAV,转换正常,播放正常。

但mac下的微信开发者工具录音后转换报错,点预览,用手机访问录音后上传转换也报错。。请教大神们是什么原因啊?

windows的微信开发者工具录音后上传到服务器转换:

[OK] Convert /zxs/fxzw_pc/apache-tomcat-8.5.16/webapps/shout/voice/RedPacket_20171213143029172.slk to /zxs/fxzw_pc/apache-tomcat-8.5.16/webapps/shout/voice/RedPacket_20171213143029172.wav success, but not a silk v3 encoded file

苹果下的微信开发者工具和手机上录音后上传服务器转换:

[Warning] Convert /zxs/fxzw_pc/apache-tomcat-8.5.16/webapps/shout/voice/RedPacket_20171213140706554.slk false, maybe not a silk v3 encoded file.

$cur_dir/silk/decoder “$1” “$1.pcm” > /dev/null 2>&1

if [ ! -f “$1.pcm” ]; then

        ffmpeg -y -i “$1” -f wav -ar 16000 -ac 1 “${1%.*}.$2” > /dev/null 2>&1 &

        ffmpeg_pid=$!

        while kill -0 “$ffmpeg_pid”; do sleep 1; done > /dev/null 2>&1

        [ -f “${1%.*}.$2” ]&&echo -e “${GREEN}[OK]${RESET} Convert $1 to ${1%.*}.$2 success22222, ${YELLOW}but not a silk v3 encoded file.${RESET}”&&exit

        echo -e “${YELLOW}[Warning]${RESET} Convert $1 false22222, maybe not a silk v3 encoded file.”&&exit

fi

echo -e “enter into transfer”

ffmpeg -y -f s16le -ac 1 -i “$1.pcm” -f wav -ar 16000 -b:a 16 -ac 1 “${1%.*}.$2” > /dev/null 2>&1

ffmpeg_pid=$!

while kill -0 “$ffmpeg_pid”; do sleep 1; done > /dev/null 2>&1

rm “$1.pcm”

[ ! -f “${1%.*}.$2” ]&&echo -e “${YELLOW}[Warning]${RESET} Convert $1 false, maybe ffmpeg no format handler for $2.”&&exit

echo -e “${GREEN}[OK]${RESET} Convert $1 To ${1%.*}.$2 Finish.”

exit

回到顶部