我如何可以加快或放慢的背景音乐曲目与iPhone SDK? [英] How can I speed up or slow down a background music track with iPhone SDK?

查看:110
本文介绍了我如何可以加快或放慢的背景音乐曲目与iPhone SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种简单的方法来控制声音文件循环的播放速度/节奏使用音频队列服务播放?例如,如果一个游戏正在播放的背景音乐,我想使BGM加快,随着时间耗尽,但没有改变音乐的音调。 THX!

Is there an easy way to control the playback speed/tempo of a sound file loop played using Audio Queue Services? For example, if a game is playing background music, I want to make the BGM speed up as time runs out, but without changing the pitch of the music. Thx!

推荐答案

有就是要做到这一点,我知道非同小可方式。在Mac上,你会presumably使用音频单位要做到这一点,但我认为对于那些支持是有限的iPhone SDK。

There's no trivial way to do this that I know of. On the Mac, you'd presumably use Audio Units to do this, but I think the support for those is limited on the iPhone SDK.

您可以将您的播放AudioQueue回调过程中做一些处理,AudioFileReadPackets()和AudioQueueEnqueueBuffer(),但我认为在不改变基调将需要相当大量的CPU时间的速度移。

You can do some processing during your AudioQueue playback callback, between AudioFileReadPackets() and AudioQueueEnqueueBuffer() but I think speed-shifting without changing the tone will require rather a lot of CPU time.

有很可能会更容易有音乐的一个以上的记录,和音乐的无声通路过程中切换文件

It'd probably be easier to have more than one recording of the music, and switch files during a silent passage of the music.

这篇关于我如何可以加快或放慢的背景音乐曲目与iPhone SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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