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这个权限。
1
2
3
4
5
|
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声卡播放原始音频流。两种重载方法如下
1
2
|
int write( short [] audioData, int offsetInShorts, int sizeInShorts)
int write( byte [] audioData, int offsetInBytes, int sizeInBytes)
|
3.soundtouch的代码结构
soundtouch源码分析__based on csdn :相关推荐
- soundtouch源码分析
1.soundtouch官网:http://www.surina.net/soundtouch/.这上面有soundtouch的介绍.源码,封装好的dll文件.使用方法.以及一些demo.这上面dem ...
- 【OpenCV流程+代码分析】Opencv HOG行人检测 源码分析
[原文:http://blog.csdn.net/ttransposition/article/details/11874285] OpenCV demo演示见本人的另一篇灌水博客 http://bl ...
- HRNet 源码分析
论文 Deep High-Resolution Representation Learning for Human Pose Estimation 也是 一个 top-down得对于人体姿态估计得检测 ...
- 【Apollo源码分析】系列的第三部分【prediction】_slamcode的博客 -CSDN博客
[Apollo源码分析]系列的第三部分[prediction]_slamcode的博客 -CSDN博客
- 自己动手编写CSDN博客备份工具-blogspider之源码分析(3)
作者:gzshun. 原创作品,转载请标明出处! 来源:http://blog.csdn.net/gzshun 周星驰:剪头发不应该看别人怎么剪就发神经跟流行,要配合啊!你看你的发型,完全不配合你的脸 ...
- ViewGroup的Touch事件分发(源码分析)
Android中Touch事件的分发又分为View和ViewGroup的事件分发,View的touch事件分发相对比较简单,可参考 View的Touch事件分发(一.初步了解) View的Touch事 ...
- Spark源码分析之七:Task运行(一)
在Task调度相关的两篇文章<Spark源码分析之五:Task调度(一)>与<Spark源码分析之六:Task调度(二)>中,我们大致了解了Task调度相关的主要逻辑,并且在T ...
- JDK源码分析 NIO实现
总列表:http://hg.openjdk.java.net/ 小版本:http://hg.openjdk.java.net/jdk8u jdk:http://hg.openjdk.java.net/ ...
- Nginx源码分析链接
nginx-0.8.38源码探秘:http://blog.csdn.net/ccdd14/article/details/5872312 nginx源码分析: http://blog.sina.com ...
最新文章
- Artlantis 2020中文版
- How to determine if SAP CRM UI is extensible
- Delphi 正则表达式语法(9): 临界匹配 - 也叫预搜索与反向预搜索
- NodeJS-queryString
- Linux IPC实践(12) --System V信号量(2)
- 内存管理-基础知识框架和关键结构体(一)
- 【友盟+】助力故宫博物院数据化智能运营
- Java 生成随机手机号,并写入数据库
- vmware虚拟机连不上服务器,VMware虚拟机nat模式连不上网怎么办
- 【TP5】安装Guzzle并简单使用
- 6个简历模板免费下载网站,资源超多,质量超高!
- 十、【高级篇】RTC--实时时钟
- selenium 校园网自动连接
- Ubuntu16.04调整屏幕分辨率至1920*1080
- 超乎认知 认知智能十大黑科技 我国首次对外公布 道翰天琼认知智能
- CSDN新版个人空间介绍之二——个人主页
- 分布式系统概念与设计分布式实例
- 微信小程序-底部导航栏
- Linux开发篇 | Linux下制作EXT4文件系统镜像
- 在x86和arm编译libmodbus