How to use aubio framework in iOS?

I am trying to detect the bit, step, start and fast Fourier transform (FFT) of an audio file in iOS, and I found that aubio provides these features and the iOS infrastructure .

So far, I'm using the Amazing Audio Engine to get audio in terms of Core Audio AudioBufferList as follows:

 id<AEAudioReceiver> receiver = [AEBlockAudioReceiver audioReceiverWithBlock: ^(void *source, const AudioTimeStamp *time, UInt32 frames, AudioBufferList *audio) { // I don't know how to use audio library. }]; 

Can I detect the rhythm, step, start and fast Fourier transform (FFT) using aubio from this AudioBufferList and how? If I am wrong, please give me some suggestion?

+6
source share
4 answers

Take a look at the aubio download page, I believe that they compiled it into an iOS framework, and you can directly import your Xcode.

Link: http://aubio.org/download#ios

+1
source

There is a compiled framework for use with iOS on the download page.

You have to drag and drop the library into the project, make sure that you also have a recharge frame:

  • Accelerate.framework
  • AudioToolbox.framework

Now, if you download the Aubio source, you will have a folder with examples. There you will find code for detecting a bit, pitch, start (there is also FFT) written in C, which, since ObjC is a superset of C, will also work in your project.

0
source

My solution for this was to write an audio buffer to a file and then send the file to aubio. Whenever you get a new sound buffer, you can either add to the file (if you want to analyze all this so far), or simply overwrite if you are only interested in the incremental fragment.

0
source

UPDATE So, it looks like Cocoa Pod for Aubio is not the latest, in my subfile, I use this code to add Aubio to my Xcode workspace:

 pod 'aubio-iOS-SDK', '~> 0.4' 

This installs Aubio 0.4.1, and it is not the last. Finding documentation for Aubio, in general, is a slightly obscure process in which you break up several Internet search results together into a work solution.

For iOS, this is even more obscure if you go to the Aubio downloads page, you find version 0.4.2 for iOS, highlight below, that is, a later version than Aubio Cocoa Pod. And yet here , in the comments, I found the later iOS Aubio module, 0.4.3, here is a direct download of what might be the latest Aubio for iOS:

https://aubio.org/bin/tmp/aubio-0.4.3~const.iosuniversal_framework.zip

You still need a link to the aubio.h header header if you are using Swift, as I mentioned in my original answer

ORIGINAL ANSWER There is CocoaPod for aubio, which really makes it easy to access aubio libraries in Swift. Here is the Aubio CocoaPod iOS:

https://cocoapods.org/pods/aubio-iOS-SDK

After installation, note that in Swift you will NOT write:

 import aubio 

at the top of your Swift file.

You need to make sure that you add the object header of the C bridge to expose the aubio C library in Swift, in this header you write the following:

 #import <aubio/aubio.h> 

Swift will now have access to the aubio library / structure.

0
source

All Articles