zoukankan      html  css  js  c++  java
  • 解决silk-v3-decoder-master转换wav时,百度语音解析问题

    $cur_dir/silk/decoder "$1" "$1.pcm" > /dev/null 2>&1
    if [ ! -f "$1.pcm" ]; then
            /usr/local/ffmpeg/bin/ffmpeg -y -i "$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 success, ${YELLOW}but not a silk v3 encoded file.${RESET}"&&exit
            echo -e "${YELLOW}[Warning]${RESET} Convert $1 false, maybe not a silk v3 encoded file."&&exit
    fi
    /usr/local/ffmpeg/bin/ffmpeg -y -f s16le -ar 24000 -ac 2 -i "$1.pcm" -f $2 -ar 16000  -ac 1 "${1%.*}.$2" > /dev/null 2>&1
    #/usr/local/ffmpeg/bin/ffmpeg -y -f s16le -ar 24000 -ac 2 -i "$1.pcm" -f $2 -ar 16000 -b:a 16 -ac 1 "${1%.*}.$2" > /dev/null 2>&1
    #/usr/local/ffmpeg/bin/ffmpeg  -f s16le -v 8 -y -ar 16000 -ac 2 -i "$1.pcm" "${1%.*}_play.$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

    解决silk-v3-decoder-master转换wav时,百度语音解析问题

  • 相关阅读:
    svn Mac
    webpack实用配置
    vuex状态管理-数据改变不刷新
    element-vue-koa2-mysql实现文件上传
    Promise的理解
    mysql Mac篇
    python 24 days
    python 7 days
    python 27 days
    python 26 days
  • 原文地址:https://www.cnblogs.com/ylcms/p/7815776.html
Copyright © 2011-2022 走看看