我如何可以加快或放慢的背景音乐曲目与iPhone SDK?

编程入门 行业动态 更新时间:2024-10-26 20:29:42
本文介绍了我如何可以加快或放慢的背景音乐曲目与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?

本文发布于:2023-07-11 09:29:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1093586.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:曲目   背景音乐   SDK   iPhone

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!