最近準備開發一款可以變聲的錄音機,于是在網上找了一下這方面的開源代碼,發現soundtouch是一個不錯的選擇。
首先是在官網下載下傳源代碼
http://www.surina.net/soundtouch/sourcecode.html
如果是在windows 下用的話可以直接下載下傳相應的庫來調用,linux的庫暫時沒有,隻能自己來編了。
接下來就是編譯源碼了。(我使用的是Ubuntu10.04)
根目錄下的README.html 說的很詳細了,先運作
./bootstrap
這個是用來生成配置檔案的,但是運作上處腳本發現
./bootstrap: line 24: autoreconf: command not found
接下來你需要安裝 apt-get install autoconf工具(這個是幹嘛的google一下就知道了)
裝完後繼續運作./bootstrap
接着又出現
Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 189.
安裝第二個工具
apt-get install libtool (不是root使用者請在前面加sudo)
如果出現:
configure: error: in `/root/Downloads/soundtouch':
configure: error: C++ compiler cannot create executables
See `config.log' for more details.
說明你的電腦還沒有裝g++ 你需要apt-get install g++
繼續就可以正确生成配置檔案了。
最後make 一下就編譯完了。
如果你想安裝到自己電腦就再運作make install
這樣你在/usr/local/lib 下面就可以找到
libSoundTouch.so了
=============================================================
今天就到此為止,下次将介紹我移植該代碼到android的過程。