soundtouch源码分析__based on csdn :
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 :的更多相关文章
- PS-Lite源码分析
PS-Lite源码分析 http://blog.csdn.net/kangroger/article/details/73307685
- 锁对象-Lock: 同步问题更完美的处理方式 (ReentrantReadWriteLock读写锁的使用/源码分析)
Lock是java.util.concurrent.locks包下的接口,Lock 实现提供了比使用synchronized 方法和语句可获得的更广泛的锁定操作,它能以更优雅的方式处理线程同步问题,我 ...
- gmock使用、原理及源码分析
1 初识gmock 1.1 什么是Mock 便捷的模拟对象的方法. 1.2 Google Mock概述 google mock是用来配合google test对C++项目 ...
- vim 源码分析
vim 源码分析 http://bbs.csdn.net/topics/230031469 Ver7.1 晕.看不明白很正常. 7.1已经很大了. 支持了太多东西. 代码行数那么多(源码压缩了都 ...
- Contacts源码分析(一、概述)
代码版本: Contact code version: 4.4.2 一 打开Log开关:如if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG ...
- 深入理解 spring 容器,源码分析加载过程
Spring框架提供了构建Web应用程序的全功能MVC模块,叫Spring MVC,通过Spring Core+Spring MVC即可搭建一套稳定的Java Web项目.本文通过Spring MVC ...
- 【JUC】JDK1.8源码分析之AbstractQueuedSynchronizer(二)
一.前言 在锁框架中,AbstractQueuedSynchronizer抽象类可以毫不夸张的说,占据着核心地位,它提供了一个基于FIFO队列,可以用于构建锁或者其他相关同步装置的基础框架.所以很有必 ...
- Android应用层View绘制流程与源码分析
1 背景 还记得前面<Android应用setContentView与LayoutInflater加载解析机制源码分析>这篇文章吗?我们有分析到Activity中界面加载显示的基本流程原 ...
- fastdfs-nginx扩展模块源码分析
FastDFS-Nginx扩展模块源码分析 1. 背景 在大多数业务场景中,往往需要为FastDFS存储的文件提供http下载服务,而尽管FastDFS在其storage及tracker都内置了htt ...
随机推荐
- 大数据应用:五大地区喜新厌旧游戏APP类别之比较与分析
今天,我们来分享点不一样的资讯.....游戏APP之喜新厌旧排行榜!! 前阵子笔者开发了一套系统可以用来收集亚洲五大地区上架APP的每日排名信息,希望观察出五大地区在APP上的喜好和使用程度之间的相异 ...
- Bootstrap学习——起步
一,前言 个人不是专业从事前端开发,但在一个小公司里工作,作为有过这样经历的程序员都知道,开发一个网站或者是一个管理系统,程序员基本所有的事都包了,真是什么都要懂一点啊.而我个人也不怎么喜欢写CSS和 ...
- 经典关于多态的demo
class Foo { public int a; public Foo() { a = 3; } public int addFive() { a += 5; return a; } public ...
- Using load balance for thrift servers
Software load balance .Nginx(http://nginx.org) 1.Install nginx download source code from http://ngin ...
- php编译安装扩展curl
./configure --with-php-config=/opt/software/php5.4/bin/php-configyum install curl curl-devel
- ZOJ 1234 Chopsticks(动态规划)
Chopsticks 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=234 题目大意:给定n个筷子的长度,取k+8套筷 ...
- PHP临时文件session的分级存储与定期删除
在Windows上PHP默认的Session服务端文件存放在C:\WINDOWS\Temp下,如果说并发访问很大或者 session建立太多,目录下就会存在大量类似sess_xxxxxx的sessio ...
- MFC中cannot find the definition (implementation) of this function 解决方法
问题:使用vc6 在点击左侧class view中的一个方法实现时出现下面错误: cannot find the definition (implementation) of this func ...
- 【原创】CMD常用命令:解决实际问题
1.查找某一目录下后缀名文某某的所有文件. 命令格式:dir *.mp3 /a -d/b/s >C:\Users\leemo\Desktop\total.txt MP3为文件后缀名.>是命 ...
- 不错的轮播插件flexslider
http://flexslider.woothemes.com/ $('.flexslider').flexslider({ animation:'slide', //滑动效果:翻页效果,默认为fad ...