MPMusicPlayerController没有响应1附近的currentPlaybackRate [英] MPMusicPlayerController not responding to currentPlaybackRate near 1

查看:441
本文介绍了MPMusicPlayerController没有响应1附近的currentPlaybackRate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用MPMusicPlayerController上的currentPlaybackRate属性来调整音乐曲目播放时的速度。当速率小于0.90或大于1.13时,该属性按预期工作,但对于刚好高于和低于1的范围,速度似乎没有变化。这是我正在尝试的:

I'm trying to use the currentPlaybackRate property on MPMusicPlayerController to adjust the tempo of a music track as it plays. The property works as expected when the rate is less than 0.90 or greater than 1.13, but for the range just above and below 1, there seems to be no change in tempo. Here's what I'm trying:

UIAppDelegate.musicPlayer = [MPMusicPlayerController iPodMusicPlayer]; 

...从图书馆加载带音轨的音乐播放器

... load music player with track from library

[UIAppDelegate.musicPlayer play];

- (void)speedUp{

        UIAppDelegate.musicPlayer.currentPlaybackRate =  UIAppDelegate.musicPlayer.currentPlaybackRate + 0.03125;           
}

- (void)speedDown
{

        UIAppDelegate.musicPlayer.currentPlaybackRate = UIAppDelegate.musicPlayer.currentPlaybackRate - 0.03125;

}

我可以监控值currentPlaybackRate,看看它是否正确设置,但在达​​到0.9或1.13阈值之前,回放速度似乎没有差别。有没有人对此事有任何指导或经验?

I can monitor the value currentPlaybackRate and see that it's being correctly set, but there seems to be no different in playback tempo until the 0.9 or 1.13 threshold has been reached. Does anyone have any guidance or experience on the matter?

推荐答案

我不是专家,但我怀疑这种现象可能仅仅是用来改变播放的算法的假象速度没有升高或降低音高。这是一个棘手的业务,在这里必须实时完成而不会有太多失真,因此可能需要一个整数倍的速度。您可能希望按时阅读维基百科文章, http://en.wikipedia.org/wiki / Audio_timescale-pitch_modification

I'm no expert, but I suspect that this phenomenon may be merely an artefact of the algorithm used to change the playback speed without raising or lowering the pitch. It's a tricky business, and here it must be done in real time without much distortion, so probably an integral multiple of the tempo is needed. You might want to read the wikipedia article on time stretching, http://en.wikipedia.org/wiki/Audio_timescale-pitch_modification

这篇关于MPMusicPlayerController没有响应1附近的currentPlaybackRate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆