如何通过IOS上的硬件播放解码的音频数据? [英] How to play decoded audio data through hardware on IOS?
问题描述
我有自己的用C ++编写的声音引擎,它具有一些自定义功能.我的引擎中已解码并处理了PCM值,但我需要通过IOS上的库以某种方式播放此值.它基于回调系统工作.第三方请求具有给定参数的回调,例如numberOfFrames,pointerToFillData等.
I have my own sound engine written in C++ and it has some custom abilities. I have the decoded + processed PCM values in my engine but I need to somehow play this through a library on IOS. It works based on a callback system. A 3rd party requests callbacks with given parameters such as numberOfFrames, pointerToFillData etc.
我是IOS Audio的新手,我不知道如何完成这项工作.在Android上, Oboe 是执行此操作的库.
I am very new to IOS Audio and I do not know what gets this job done. On Android Oboe is the lib that does this.
我找到了一些自定义库,例如 novocaine ,它与我需要的库非常相似,但是它不完全是.我查看了Core Audio,但在我看来Core Audio SDK已过时.但是,与Core Audio打包在一起的Audio Unit似乎是我需要的东西.
I have found some custom libraries written like novocaine that is very similiar to what I need but its not exactly it. I looked at Core Audio but it seems to me that Core Audio SDK is deprecated. However, Audio Unit that was packed with Core Audio seems like the thing I need.
有多种方法可以做到这一点.这就是为什么我真的可以使用示例+建议来说明为什么您的方式是更可取的方式...
There are multiple ways to do this. This is why I could really use an example + suggestions on why your way is the preferable way...
任何人都可以通过示例指导我正确的方向吗?
Can anyone guide me in the right direction with examples?
我看到了@ hotpaw2的答案,但我需要一个例子,说明他的答案比其他可用选项更好的原因.
I saw @hotpaw2 s answer but I need an example with a reason why his answer is better than other available options.
推荐答案
(目前)iOS Audio Queue API不推荐使用,并且基于回调.
The iOS Audio Queue API is (currently) non-deprecated and callback based.
请参阅: https://developer.apple.com/documentation/audiotoolbox/audio_queue_services
这篇关于如何通过IOS上的硬件播放解码的音频数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!