1. soundtouch介绍和相关资源

The SoundTouch Library Copyright © Olli Parviainen 2001-2014

SoundTouch is an open-source audio processing library for changing the Tempo, Pitch and Playback Rates of audio streams or audio files

  • Tempo (time stretch): Changes the sound to play at faster or slower tempo than originally without affecting the sound pitch.
  • Pitch (key) : Changes the sound pitch or key while keeping the original tempo (speed).
  • Playback Rate : Changes both tempo and pitch together as if a vinyl disc was played at different RPM rate.

The SoundTouch library is intended  for application developers writing sound processing tools that require tempo/pitch control functionality, or just for playing around with the sound effects.

resource:

1.soundtouch官网:http://www.surina.net/soundtouch/。这上面有soundtouch的介绍、源码,封装好的dll文件、使用方法、以及一些demo。这上面demo做的不好。

2.一个利用java的jni调用soundtouch非常短小精悍的java swing界面小程序:http://www.aplu.ch/home/apluhomex.jsp?site=44

3.csdn suhetao做的soundtouch源码分析:http://blog.csdn.net/suhetao/article/details/5843480

4.关于声音处理的一个理论网页:http://www.surina.net/article/time-and-pitch-scaling.html

5.其他资料:http://baosu.iteye.com/blog/1840054

      http://baosu.iteye.com/blog/1843031

      http://blog.csdn.net/leilu2008/article/details/6724354

2.对于soundtouch源码的最简明的解释(参考)

1. 音频采集

这点主要是通过Android设备的麦克风实时采集音频,由于Android平台的MediaRecorder类录制音频到文件,虽然可以通过空设备回调获得实时的音频流,不过为了降低开发者的难度,Android开发网推荐使用正统的AudioRecord和AudioTrack,首先我们仍然需要加入android.permission.RECORD_AUDIO这个权限。

android.media.AudioRecord类的read方法主要有3种重载形式:

int  read(short[] audioData, int offsetInShorts, int sizeInShorts)   //short在java中占用两个字节
int read(byte[] audioData, int offsetInBytes, int sizeInBytes) //byte在java中占用一个字节
int read(ByteBuffer audioBuffer, int sizeInBytes) //基于NIO的ByteBuffer类型

  

我们可以看到从麦克风中获取的音频无需经过文件系统直接通过AudioRecord类的read方法读入到我们预定的缓冲区中,这里需要注意的是采样率的大小必须有足够的缓冲区空间处理

2. 变声处理

这点需要一些基本的音频处理方式,比如移调、变速,Android开发网推荐大家参考Adobe Audition的早期Cool Editi泄露的代码,当然音频处理算法比较多,大家可以自己实现。

3. 播放原始音频流

同样,处理完后考虑到效率我们仍然直接从内存流中播放,最简单的就是AudioTrack类,通过android.media.AudioTrack类的write方法,让Android声卡播放原始音频流。两种重载方法如下

int  write(short[] audioData, int offsetInShorts, int sizeInShorts)
int write(byte[] audioData, int offsetInBytes, int sizeInBytes)

  

3.soundtouch的代码结构

soundtouch源码分析__based on csdn :的更多相关文章

  1. PS-Lite源码分析

    PS-Lite源码分析 http://blog.csdn.net/kangroger/article/details/73307685

  2. 锁对象-Lock: 同步问题更完美的处理方式 (ReentrantReadWriteLock读写锁的使用/源码分析)

    Lock是java.util.concurrent.locks包下的接口,Lock 实现提供了比使用synchronized 方法和语句可获得的更广泛的锁定操作,它能以更优雅的方式处理线程同步问题,我 ...

  3. gmock使用、原理及源码分析

    1      初识gmock 1.1      什么是Mock 便捷的模拟对象的方法. 1.2      Google Mock概述 google mock是用来配合google test对C++项目 ...

  4. vim 源码分析

    vim 源码分析 http://bbs.csdn.net/topics/230031469 Ver7.1  晕.看不明白很正常.  7.1已经很大了.  支持了太多东西. 代码行数那么多(源码压缩了都 ...

  5. Contacts源码分析(一、概述)

    代码版本: Contact code version: 4.4.2 一 打开Log开关:如if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG ...

  6. 深入理解 spring 容器,源码分析加载过程

    Spring框架提供了构建Web应用程序的全功能MVC模块,叫Spring MVC,通过Spring Core+Spring MVC即可搭建一套稳定的Java Web项目.本文通过Spring MVC ...

  7. 【JUC】JDK1.8源码分析之AbstractQueuedSynchronizer(二)

    一.前言 在锁框架中,AbstractQueuedSynchronizer抽象类可以毫不夸张的说,占据着核心地位,它提供了一个基于FIFO队列,可以用于构建锁或者其他相关同步装置的基础框架.所以很有必 ...

  8. Android应用层View绘制流程与源码分析

    1  背景 还记得前面<Android应用setContentView与LayoutInflater加载解析机制源码分析>这篇文章吗?我们有分析到Activity中界面加载显示的基本流程原 ...

  9. fastdfs-nginx扩展模块源码分析

    FastDFS-Nginx扩展模块源码分析 1. 背景 在大多数业务场景中,往往需要为FastDFS存储的文件提供http下载服务,而尽管FastDFS在其storage及tracker都内置了htt ...

随机推荐

  1. HTML+CSS基础学习笔记(5)

    一.文字排版--字体 Eg: body{font-family:"宋体";} body{font-family:"Microsoft Yahei";}//微软雅 ...

  2. 会话技术之Cookie 和 Session

    为什么要使用会话技术 会话从字面上来说就是,就是两个人说话,也就是两个人交流,那么这里说的是计算机web端的交流,因为互联网是基于HTTP传输信息的,而http传输是无状态协议,缺少状态,意味着如果后 ...

  3. Bootstrap 开关(switch)控件需要注意的问题

    远程文档地址:http://www.bootcss.com/p/bootstrap-switch/ 先上lz遇到的小坑:自古无图无真相的原则 上面代码注释掉后 就是下面这个图片效果!然后加载顺序也要注 ...

  4. Library中的title与Name

    在Library中新增Title字段,其中文件夹的title字段与Name相同,并且默认生成:但是文件的Title字段为空.

  5. MongoDB 3.0安全权限访问控制(Windows版)

    MongoDB 3.0安全权限访问控制(Windows版) 1.首先,不使用 –auth 参数,启动 mongoDB: mongod --dbpath "d:\mongodb\data\db ...

  6. Ganglia3.6.0,nginx+php搭建gweb,监控Hadoop2.2 和 Hbase0.98.1

    环境:CentOS6.5 Hadoop2.2.0 Hbase0.98.1 服务端(master): 安装 ganglia ganglia-devel ganglia-gmetad ganglia-gm ...

  7. o] TortoiseGit错误 - Could not get all refs. libgit2 returned: corrupted loose reference file

    因无法追溯的同步操作错误或工程文件错误,造成Git 同步时报错: Could not get all refs. libgit2 returned: corrupted loose reference ...

  8. jmeter,监控插件

    1.下载JMeterPlugins.jar 2.下载后放在\apache-jmeter-3.0\lib\ext下 3.重启jmeter,监听器中即可看到jp@gc-开头的监听器

  9. Android常用错误解决汇总

    一.No active compatible AVD's or devices found. Relaunch this configuration after connecting a device ...

  10. mvc5 + ef6 + autofac搭建项目(repository+uow)(二)

    续上篇: DBContext 在上篇 图一类库根目录创建的 DbContextBase /// <summary> /// 数据库上下文基类 /// </summary> // ...