Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play decoded audio data through hardware on IOS?

Tags:

ios

core-audio

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.

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.

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?

I saw @hotpaw2 s answer but I need an example with a reason why his answer is better than other available options.

like image 958
cs guy Avatar asked Mar 02 '23 16:03

cs guy


1 Answers

The iOS Audio Queue API is (currently) non-deprecated and callback based.

See: https://developer.apple.com/documentation/audiotoolbox/audio_queue_services

like image 174
hotpaw2 Avatar answered Mar 04 '23 23:03

hotpaw2