iPhone sdk 中的 OGG Vorbis
我想知道是否可以使用 iPhone SDK 播放 Ogg Vorbis 音频文件,或者是否存在允许这样做的库或框架。
我读过一些有关 OpenAL 的内容,但没有找到任何教程...... 有人可以帮助我吗?
I want to know if it's possible to play Ogg Vorbis audio file with iPhone SDK or if exist a library or a framework that allow this.
I've read something about OpenAL but I don't find any tutorial...
Can anyone help me??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
迟到总比不到好;)
我在这里找到了答案在我的项目中使用cocos2d播放ogg文件? 。
他们提到了 PASoundMgr。这对我有用。我刚刚从 cocos2d 框架复制了 SoundEngineTest 所基于的所有文件 -> 库。并删除了不必要的代码。
这是我的 demoProject,展示了如何在 ios 上玩 ogg。
请小心 iOS 5.* 模拟器,它们在声音库方面存在一些问题 。我的演示适用于 4.3 模拟器和设备。
以下是我创建演示的步骤:
首先,您需要 cocos2d-iphone 框架。我已经有了它,但你可以在这里找到它 cocos-2d_download。
正如您所注意到的,SoundEngineTest 依赖于 libvorbis.a。它是一个由
external/Tremor
组的文件组成的库。它还依赖于 OpenAl、AudioToolbox 框架。我将所有文件从tremor组复制到我的项目中。创建了“vorbis”Cocoa Touch 静态库,没有 ARC。并将所有源文件和标头添加到构建阶段选项卡中的“vorbis”目标。
在 OggPlayDemo 的构建阶段中,将库(libvorbis、OpenAl、AudioToolbox)添加到链接二进制文件与库框中。
向项目添加了 PA 类。并检查 OggPlayDemo 作为目标。为了避免 ARC 出现问题,我禁用了这 3 个 PA 文件的 ARC 编译。 (请参阅禁用单个文件的 ARC< /a>)
删除了所有 cocos2d 引用。有一些与根据方向纠正侦听器位置相关的代码......我评论了它。我不需要这个功能来播放音频。
已复制的音频文件。
最后将这段代码添加到 ViewController 中:
Better late than never ;)
I have found the answer here Use cocos2d for playing ogg file in my project?.
They mentioned PASoundMgr. It worked for me. I just copied from cocos2d framework all files->libraries that SoundEngineTest was based on. And got rid of unnecessary code.
Here is my demoProject that shows how to play ogg on ios.
Be careful with iOS 5.* simulators, they have some problems with sound library. My demo works on 4.3 simulator and on Device.
Here are steps that I made to create demo:
First you will need cocos2d-iphone framework. I've already had it, but you can find it here cocos-2d_download.
As you can notice SoundEngineTest depends on libvorbis.a. It's a library that made of files from
external/Tremor
group. Also it depends on OpenAl, AudioToolbox frameworks.I copied all files from tremor group to my project. Crearted "vorbis" Cocoa Touch Static Library, without ARC. And added all source files and header to the "vorbis" target in Build Phases tab.
In the Build Phases of OggPlayDemo Added libraries (libvorbis, OpenAl, AudioToolbox) to the Link Binary with Libraries box.
Added PA classes to project. And checked OggPlayDemo as a target. To avoid problems with ARC, I disabled ARC compilation for this 3 PA files. (see disable ARC for single file)
Removed all cocos2d references. There were some code related to correcting position of listener depending on orientation... I commented it. I don't need this feature for just playing audio.
Copied audio file.
And finally added this code to ViewController:
Cricket Audio 将播放 ogg 文件等,并适用于 iOS/Android/WP8。
Cricket Audio will play ogg files, among others, and works on iOS/Android/WP8.