移植soundtouch 到android 通过JNI来调用(一)

来源:互联网 发布:vericut是个什么软件 编辑:程序博客网 时间:2024/05/16 03:10

最近准备开发一款可以变声的录音机,于是在网上找了一下这方面的开源代码,发现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的过程。