When I developing WeChat mini program, I want to achieve the voice control. but the audio provided by WeChat client is silk.
I need to convert the silk file to some format can be recognized by 3rd voice detection service.
Some 3rd services support amr format. It's really great, because the size could be very small.
The steps as follows:
brew install ffmpeg --with-opencore-amr --with-speex
. ffmpeg -y -f s16le -ar 24000 -ac 1 -i "$1.pcm" -ar 8000 "${1%.*}.$2”
. On MacOS, the procedure is working for converting silk to mp3, you may manipulate a little bit and test on other OS for amr.
Download lame http://lame.sourceforge.net/ , run
./configure && make && sudo make install
If you encounter
Undefined symbols for architecture x86_64: \n"_lame_init_old", referenced from: \n -exported_symbol[s_list] command line option \nld: symbol(s) not found for architecture x86_64 \nclang: error: linker command failed with exit code 1 (use -v to see invocation) \nRemove line
lame_init_old
from ${lame}/include/libmp3lame.sym
before ./configure
Download ffmpeg from http://ffmpeg.org/ , run
./configure --enable-libmp3lame && make && sudo make install
If you encounter
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build. \n. Then run
brew install yasm
before ./configure
Run the command to convert silk to mp3.
${your-silk-v3-decoder-folder}/converter.sh {silk file full path} mp3
And you will see the mp3 file in the same path as the input silk. And the path to silk file MUST be full path.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.