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. 深入理解Javascript变量作用域

    在学习JavaScript的变量作用域之前,我们应当明确几点: a.JavaScript的变量作用域是基于其特有的作用域链的. b.JavaScript没有块级作用域. c.函数中声明的变量在整个函数 ...

  2. Wi-Fi无线网络下行速度超级慢 (5kb/s)之解决方案

    转载:http://www.iplaysoft.com/wifi-slow-solution.html 作者:X-Force 转载原因:该文分类提出了多种解决方案,并详述其原因.简洁清晰,可作为参考方 ...

  3. Objective-C中的@dynamic(转)

    转自 http://blog.csdn.net/haishu_zheng/article/details/12873151 Objective-C中的@dynamic 一.@dynamic与@synt ...

  4. EA UML 建模——类图

    Enterprise Architect(EA) 是一个功能比较强悍的建模工具,本篇文章仅使用其 UML 建模功能,其他更多功能,可以Google. 一.简单梳理C#中类与类.类与接口.接口与接口的关 ...

  5. ios专题 -归档保存数据

    关键类:NSKeyedArchiver  与  NSKeyedUnarchiver 采用归档的形式来保存数据,该数据对象需要遵守NSCoding协议,并且该对象对应的类必须提供encodeWithCo ...

  6. (转)JS页面间传值

    一:JavaScript静态页面值传递之URL篇 能过URL进行传值.把要传递的信息接在URL上. 例子: 参数传出页面Post.htm—> <input type="text& ...

  7. 选取两个有序数组中最大的K个值,降序存入另一个数组中

    原题: 假设有两个有序的整型数组int *a1, int *a2,长度分别为m和n.试用C语言写出一个函数选取两个数组中最大的K个值(K可能大于m+n)写到int *a3中,保持a3降序,并返回a3实 ...

  8. [LeetCode OJ] Decode Ways

    A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' - ...

  9. U盘安装ubuntu时出现的gfxboot.c32:not a COM32R image问题

    方法特别简单:只需在提示后面输入   live  然后回车 就OK了

  10. sublime text 自动保存

    perferences->Settings - User添加下面两句话: { "save_on_focus_lost": true, "atomic_save&qu ...