音频的播放速率,安卓 [英] Audio Playback Rate in Android
问题描述
所以,我知道这已经做与之前的几个Android应用程序,但我不能为我的生活弄清楚如何,因为它是目前无法通过API。
So, I know that this has been done with a few Android apps before, but I cannot for the life of me figure out how, since it's not currently possible through the API.
如何调节声音的播放速率通过MediaPlayer的发挥;无论有或没有调整间距是好的,现在,尽管后者绝对是preferred。如果有人能在一个开源的应用程序,我可以为指导使用的方向指向我,那也将是罚款。
How does one adjust the playback rate of a sound played through MediaPlayer; either with or without adjusting the pitch is fine for now, though the latter is definitely preferred. If someone can point me in the direction of an open source app that I can use as guidance, that would also be fine.
在此先感谢。
推荐答案
看起来像的 AudioTrack.setPlaybackRate 应该做的伎俩。
Looks like AudioTrack.setPlaybackRate should do the trick.
将其设置为一半的采样率 内容将导致回放 持续的两倍长,但也会 导致负变调。
Setting it to half the sample rate of the content will cause the playback to last twice as long, but will also result in a negative pitch shift.
不知道你可以从MediaPlayer的一个AudioTrack ...
Not sure if you can get a AudioTrack from MediaPlayer...
这篇关于音频的播放速率,安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!