使用 AVToolbox 或 openAL 拖动滚动条即可流畅播放 mp3 文件

发布于 2024-10-22 08:00:36 字数 474 浏览 3 评论 0原文

我已经面对这个问题很多天了,但还没有得出任何结论。

我的问题是:我想播放 mp3 文件,但不仅仅是单击播放按钮。

我就是想这样玩。

*有一个我可以用手指拖动的滑块,我希望 mp3 应该以我拖动手指的频率(或我拖动手指的速度)播放,这样它就会给出快进的效果(有趣的声音类型)),或者如果我慢慢拖动滑块,输出会很慢*

问题是声音的输出不流畅。它的声音非常扭曲和不安。 我希望输出更平滑。

请帮忙。有什么建议请。目前我正在使用 AVAudioPlayer 并根据滑块输入传递时间值来播放文件。 (不过这似乎不太可行)。 我觉得只使用openAL是可能的,没有其他方法。因为使用 openAL 我们可以修改声音文件的频率(音调)

请给我参考 iPhone 的 openAL 实现的链接 。我从未使用 openAL 播放过声音文件

求助!

I have been facing this since so many days but I have not reach to any conclusion.

My problem is : I want to play an mp3 file but not simply by clicking on a play button.

It is this way I want to play it.

*There is a slider that I can drag using finger, I want that the mp3 should play with the frequency with which I am dragging the finger (or speed with which I am dragging my finger, so that it will give an effect of fast forwarding (funny type of voice)) or if I drag slider slowyly the output will be slow *

The problem is the output of the sound is not coming out smooth. its very distorted and disturbed voice.
I want the outuput to be smoother.

Please help. Any suggestions please. Presently I am using AVAudioPlayer and passing the time value based upon slider input to play the file. (It does not seems to be feasible though).
I feel that it is possible using openAL only and no other way. Because using openAL we can modify the frequency of the sound file (pitch)

CAN SOME ONE PLEASE REFER ME A LINK TO openAL implementation for iPhone . I have never played a sound file using openAL

Help!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

混吃等死 2024-10-29 08:00:36

您将无法使用 AVAudioPlayer 来执行此操作,因为它不支持音高操作。

您可以将整个轨道加载并解码到内存中,以便使用 OpenAL(支持音调)进行播放,或者您可以使用音频单元(级别低得多,但更复杂)进行实时加载/解码和音调更改。

You won't be able to do it with AVAudioPlayer, as it does not support pitch operations.

You can load and decode the entire track into memory for playback with OpenAL (which supports pitch), or you can do realtime loading/decoding and pitch changing using Audio Units (MUCH lower level, and more complicated, though).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文