Forgive me, I very new at iOS - and programming at this scale in general.
I have been digging through iOS documentation, I know there are some functions like ExtAudiofile... for decoding MP3/AAC files, but are there any that will operate on Mp3/aac data that's already in memory?
I will probably have to extract the media data (byte by byte; iOS does allow that right?) from inside another file, so I can't just give it the URL.
Edit: the mp3 data will be in a non-standard file format, Apple provided function should not be able to read them. I heard iOS has a hardware decoder that works on one audio stream and the OS will fallback to software decoding if there are multiple streams.
I would rather use what Apple provides then integrate a MP3 decoder into the app.
You can use ExtAudioFileRead to read a file that is in memory, but you have to use AudioFileOpenWithCallbacks. I'm not by my work computer so I can't give you exact code, but here's the general process:
If you Google +AudioFileOpenWithCallbacks +ExtAudioFileWrapAudioFileID, you'll find that some folks have already done this and published their code.
I'm not sure what you mean by non-standard mp3 data, so you should try to play the file using another app to see if it will be compatible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With