java speex_JAVA版-微信语音.speex转.wav(示例代码)

本文介绍了如何在MAC或Linux环境下,使用Java将.speex文件解码为.wav文件。步骤包括安装libspeex库,进行编译和安装,然后打包并测试解码功能。
摘要由CSDN通过智能技术生成

功能介绍:PC端将.speex文件解码为*.wav文件

### 环境:

1. MAC OS 10.12.5/Linux

2. Xcode

3. Gcc

4. JDK 1.8

5. speex 1.2.0

### 步骤:

1. 安装libspeex

> 从https://www.speex.org/downloads/下载speex-1.2.0.tar.gz

> 解压speex-1.2.0.tar.gz

>cd pathto/speex-1.2.0

>./configure

```

...

config.status: creating win32/VS2003/libspeex/Makefile

config.status: creating win32/VS2003/speexdec/Makefile

config.status: creating win32/VS2003/speexenc/Makefile

config.status: creating win32/VS2005/Makefile

config.status: creating win32/VS2005/libspeex/Makefile

config.status: creating win32/VS2005/speexdec/Makefile

config.status: creating win32/VS2005/speexenc/Makefile

config.status: creating win32/VS2005/tests/Makefile

config.status: creating win32/VS2008/Makefile

config.status: creating win32/VS2008/speexdec/Makefile

config.status: creating win32/VS2008/tests/Makefile

config.status: creating win32/VS2008/libspeex/Makefile

config.status: creating win32/VS2008/speexenc/Makefile

config.status: creating include/speex/speex_config_types.h

config.status: creating ti/Makefile

config.status: creating ti/speex_C54_test/Makefile

config.status: creating ti/speex_C55_test/Makefile

config.status: creating ti/speex_C64_test/Makefile

config.status: creating config.h

config.status: executing depfiles commands

config.status: executing libtool commands

Type "make; make install" to compile and install Speex

```

>sudo make install

```

Making install in libspeex

.././install-sh -c -d ‘/usr/local/lib‘

/bin/sh ../libtool --mode=install /usr/bin/install -c libspeex.la ‘/usr/local/lib‘

libtool: install: /usr/bin/install -c .libs/libspeex.1.dylib /usr/local/lib/libspeex.1.dylib

libtool: install: (cd /usr/local/lib && { ln -s -f libspeex.1.dylib libspeex.dylib || { rm -f libspeex.dylib && ln -s libspeex.1.dylib libspeex.dylib; }; })

libtool: install: /usr/bin/install -c .libs/libspeex.lai /usr/local/lib/libspeex.la

libtool: install: /usr/bin/install -c .libs/libspeex.a /usr/local/lib/libspeex.a

libtool: install: chmod 644 /usr/local/lib/libspeex.a

libtool: install: ranlib /usr/local/lib/libspeex.a

make[2]: Nothing to be done for `install-data-am‘.

Making install in include

Making install in speex

...

```

2.打包

> cd pathto/release

linux系统:

> make -f makefile-linux

> make -f makefile-linux install

mac系统:

> make -f makefile-mac

> make -f makefile-mac install

3.测试

SpeexUtils.decode("pathto/a.speex", "pathto/a-test.wav");

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值