1. 程式人生 > 實用技巧 >mac微信語音匯出,格式轉碼

mac微信語音匯出,格式轉碼

一、環境準備

1、brew準備

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

2、gcc準備

MBP ~ % gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.21)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

3、ffmpeg準備

huangshihui@huangshihuideMBP ~ % brew install ffmpeg

二、找到微信語音檔案

1、匯出聊天記錄內的語音資訊

在聊天框中選中某張圖片,然後在finder中開啟,進入微信儲存目錄
微信語音格式:.silk或.aud.silk格式

2、匯出微信收藏內的語音資訊,切換至Favorites目錄

語音格式:.silk或.aud.silk格式

三、格式轉換執行

1、git拉取silk包
git clone https://github.com/kn007/silk-v3-decoder.git silk-v3-decoder

MBP silk % ls
Makefile		libSKP_SILK_SDK.a
decoder			src
interface		test

2、將silk先轉化為pcm

 ./decoder ~/Desktop/Audio/1100ff0d291cf89e903.aud.silk ~/Desktop/Audio/1100ff0d291cf89e903.pcm

3、將pcm轉化為wav即可匯出語音正常播放

ffmpeg -y -f s16le -ar 24000 -ac 1 -i  ~/Desktop/Audio/1100ff0d291cf89e903.pcm  -f wav -ar 16000 -b:a 16 -ac 1  ~/Desktop/Audio/1100ff0d291cf89e903.wav