source: doc/xcode_frameworks.rst @ 63fc1df

feature/cnnfeature/crepefeature/crepe_orgfix/ffmpeg5
Last change on this file since 63fc1df was 18373d8, checked in by Paul Brossier <piem@piem.org>, 8 years ago

doc/xcode_frameworks.rst: remove duplicated label

  • Property mode set to 100644
File size: 1.8 KB

Frameworks for Xcode

Binary frameworks are available and ready to use in your XCode project, for iOS and macOS.

  1. Download and extract the corresponding framework.zip file from the `Download`_ page
  2. Select Build Phases in your project setting and unfold Link Binary with Libraries
  3. Add AudioToolbox and Accelerate system frameworks (or make sure they are listed)
  4. Add aubio.framework from the unzipped framework.zip
  5. Include the aubio header in your code:
  • in C/C++:
#include <aubio/aubio.h>
  • in Obj-C:
#import <aubio/aubio.h>
  • in Swift:
import aubio

Using aubio from swift

Once you have downloaded and installed :ref:`aubio.framework <xcode-frameworks-label>`, you sould be able to use aubio from C, Obj-C, and Swift source files.

?

Here is a short example showing how to read a sound file in swift:

import aubio
let path = Bundle.main.path(forResource: "example", ofType: "mp4")
if (path != nil) {
    let hop_size : uint_t = 512
    let a = new_fvec(hop_size)
    let b = new_aubio_source(path, 0, hop_size)
    var read: uint_t = 0
    var total_frames : uint_t = 0
    while (true) {
        aubio_source_do(b, a, &read)
        total_frames += read
        if (read < hop_size) { break }
    }
    print("read", total_frames, "frames at", aubio_source_get_samplerate(b), "Hz")
    del_aubio_source(b)
    del_fvec(a)
} else {
    print("could not find file")
}

Docutils System Messages

?
Note: See TracBrowser for help on using the repository browser.