soundtouch

基于live555的rtsp播放器之十二:使用soundtouch加速音频播放

巧了我就是萌 提交于 2021-01-16 08:42:19
一.soundtouch soundtouch是一个用C++编写的开源的音频处理库,可以改变音频文件或实时音频流的节拍(Tempo)、音调(Pitch)、速率(Rate)。ST的3个效果互相独立,也可以一起使用。这些效果通过采样率转换、时域压拓结合实现。 Tempo:通过时域压拓算法WSOLA,改变声音的播放速率而不影响音调,即变速不变调。 Pitch:变调不变速时。 Rate:变调也变速。 主要特性 跨平台:支持Windows、Mac OS、Linux、Android、Apple iOS等。 完全开源:ST库与示例工程完全开源可下载。 容易使用:编程接口使用单一的C++类。 支持16位整型或32位浮点型的单声道、立体声、多通道的音频格式。 可实现实时音频流处理,输入/输出延迟约为100ms。 关于soundtouch源码结构简析可参考: https://zhuanlan.zhihu.com/p/266868420 关于WSOLA算法可参考: https://zhuanlan.zhihu.com/p/110278983 二.Tempo soundtouch多用于本地文件的变速播放,这里为何要用呢?上篇文章提到过,当网络不稳定时,会出现时而无包可收,时而收取到大量包的情况,而读取本地文件不会存在这样的问题。我测试用的荧石摄像头,wifi连接到家里的百兆宽度,也会出现上面所述的问题

基于live555的rtsp播放器:开篇

笑着哭i 提交于 2020-12-23 14:26:48
很久没写博客了,今天准备开始接着写。 一直以来对音视频这块都比较感兴趣,从我博客中可以看出,很久之前就开始学习WebRTC,并且转发了一些流媒体的文章,但因为工作中主要是做Qt客户端开发的,音视频学习只能断断续续进行。今年由于年初疫情,隔离在家,时间比较充裕,于是又捡起了心中所好。 说起rtsp,自然会想到开源的跨平台流媒体框架live555。live555兼容的摄像机种类多,文档丰富,而且大名鼎鼎的VLC播放器中关于rtsp的推拉流使用的就是live555,因此决定撸起袖子从VLC源码看起....... 转眼间,一年就快过去了,基于live555的rtsp播放器也略有小成,支持Windows、Linux和Mac三个平台,先上几张图: 开发环境: Qt5.12.2+live555+ffmpeg4.3.1+SDL2.0.12+faac1.30+soundtouch2.2 主要功能: 1.支持多路视频显示 Windows和Linux支持Qt widget、SDL和Qt OpenGL三种方式渲染,Mac上支持Qt widget和Qt OpenGL两种方式渲染。SDL在Mac中嵌入Qt会有问题。 2.支持多种音视频编码格式 视频支持H264和H265,音频支持AAC、G711a、G711u和G726 3.支持抓图 使用ffmpeg编码视频数据为jpg格式并保存 4.支持录制

stdexcept On Android

≡放荡痞女 提交于 2019-12-21 17:01:57
问题 I'm trying to compile SoundTouch on Android. I started with this configure line: ./configure CPPFLAGS="-I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/" LDFLAGS="-Wl,-rpath-link=/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -L/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -nostdlib -lc" --host=arm-eabi --enable-shared=yes CFLAGS="-nostdlib -O3 -mandroid" host

Soundtouch library compile issue

谁说胖子不能爱 提交于 2019-12-11 16:06:15
问题 I am trying to compile Soundtouch library with Android NDK. I successfully installed Cygwin and SWIG required for Soundtouch library. When I try to run ndk-build.cmd, i am getting an error jni/soundtouch/wrapper_wrap.cpp: In function 'void Java_com_talkingyeti_jni2_wrapperJNI_SoundTouch_1putSamples(JNIEnv*, _jclass*, jlong, _jobject*, jlong, jlong)': jni/soundtouch/wrapper_wrap.cpp:545: error: 'SAMPLETYPE' was not declared in this scope jni/soundtouch/wrapper_wrap.cpp:545: error: 'arg2' was

Android变声(SoundTouch)

我怕爱的太早我们不能终老 提交于 2019-12-11 08:19:57
前言:既然说是为变声这个功能而做,就我自己所了解的,原生中应该只有ffmpag,或者soundtouch可以实习,而这两种都涉及到NDK开发,这就有点难受了,当时公司是用的腾讯推广的变声器,后来因为老总发话,要求自己开发,当时看的是挺懵逼的,弱小的我,只能一点一点的研究。下面言归正传: 既然说了是为了变声这个功能模块,就先说一下音频基础: 声音属性 响度(Loudness):音量,与声波的振幅有关 音调(Pitch):音调与声音的频率有关——声音频率越大时,音调就越高,否则就越低 音色(Quality):由物体结构特性所决定 A/D转换(Analog-to-Digital Converter) 样本sample:声波 → 采样sampling → 量化quantization:将连续值离散化 → 编码coding:可由软件或硬件芯片完成 → (压缩compress):mp3等格式 → 二进制1010…10 PCM(Pulse-code modulation,脉冲编码调制),是将模拟信号数字化的一种经典方式,计算机、DVD以及数字电话等系统中的标准格式采用的就是PCM。它的基本原理就是以上流程产生PCM流。另外,可以调整PCM的以下属性来达到不同的采样需求: 采样率(Sampling Rate):多久采样一次。人耳所能辨识的声音范围是20-20KHZ,所以一般都选用44.1kHz

Integrate soundtouch library in Android Studio project

a 夏天 提交于 2019-12-08 13:02:05
问题 I am trying to integrate soundtouch library for change in pitch and playback rate of wav audio file. But when i add it in the project the an error arising which is given belo Information:Gradle tasks [:app:assembleDebug] /home/qwork/Android/android-ndk-r17/build/core/init.mk Error:(537) * Android NDK: Aborting... . Stop. Error:(537) * Error:(537) *** Information:BUILD FAILED Information:Total time: 14.586 secs Information:3 errors Information:0 warnings Information:See complete output in

Soundtouch building with Android NDK

筅森魡賤 提交于 2019-12-07 14:09:58
问题 I'm trying to import Soundtouch library in my Android project, but I'm not a native code power user, so that's probably why I'm having some issues understanding the way the building is supposed to be done. I tried to follow his guidelines: Android : Help in compiling SoundTouch lib in android That means, I created 2 folders( include/ and SoundTouch/ ) and I respectively inserted the headers and the .cpp files. Afterwards, I used his Android.mk and when I tried to ndk-build , I got this:

Soundtouch building with Android NDK

那年仲夏 提交于 2019-12-06 03:56:49
I'm trying to import Soundtouch library in my Android project, but I'm not a native code power user, so that's probably why I'm having some issues understanding the way the building is supposed to be done. I tried to follow his guidelines: Android : Help in compiling SoundTouch lib in android That means, I created 2 folders( include/ and SoundTouch/ ) and I respectively inserted the headers and the .cpp files. Afterwards, I used his Android.mk and when I tried to ndk-build , I got this: Android NDK: WARNING: Ignoring invalid values in LOCAL_CPP_FEATURES definition in /home/user/workspace

stdexcept On Android

寵の児 提交于 2019-12-04 08:52:22
I'm trying to compile SoundTouch on Android. I started with this configure line: ./configure CPPFLAGS="-I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/" LDFLAGS="-Wl,-rpath-link=/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -L/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -nostdlib -lc" --host=arm-eabi --enable-shared=yes CFLAGS="-nostdlib -O3 -mandroid" host_alias=arm-eabi --no-create --no-recursion Because the Android NDK targets ARM, I also had to change the

iOS SoundTouch framework BPM Detection example

只愿长相守 提交于 2019-11-28 19:56:34
I have searched all over the web and cannot find a tutorial on how to use the SoundTouch library for beat detection. (Note: I have no C++ experience prior to this. I do know C, Objective-C, and Java. So I could have messed some of this up, but it compiles.) I added the framework to my project and managed to get the following to compile: NSString *path = [[NSBundle mainBundle] pathForResource:@"song" ofType:@"wav"]; NSData *data = [NSData dataWithContentsOfFile:path]; player =[[AVAudioPlayer alloc] initWithData:data error:NULL]; player.volume = 1.0; player.delegate = self; [player prepareToPlay