1 .. _xcode-frameworks-label:
3 Using aubio frameworks in Xcode
4 -------------------------------
6 `Binary frameworks`_ are available and ready to use in your XCode project, for
9 #. Download and extract the corresponding ``framework.zip`` file from the `Download`_ page
11 #. Select **Build Phases** in your project setting and unfold **Link Binary with Libraries**
13 #. Add *AudioToolbox* and *Accelerate* system frameworks (or make sure they are listed)
15 #. Add ``aubio.framework`` from the unzipped ``framework.zip``
17 #. Include the aubio header in your code:
23 #include <aubio/aubio.h>
29 #import <aubio/aubio.h>
37 Using aubio from swift
38 ......................
40 Here is a short example showing how to read a sound file in swift:
47 let path = Bundle.main.path(forResource: "example", ofType: "mp4")
49 let hop_size : uint_t = 512
50 let a = new_fvec(hop_size)
51 let b = new_aubio_source(path, 0, hop_size)
53 var total_frames : uint_t = 0
55 aubio_source_do(b, a, &read)
57 if (read < hop_size) { break }
59 print("read", total_frames, "frames at", aubio_source_get_samplerate(b), "Hz")
63 print("could not find file")
67 .. _Binary frameworks: https://aubio.org/download
68 .. _iOS: https://aubio.org/download#ios
69 .. _macOS: https://aubio.org/download#osx
70 .. _Download: https://aubio.org/download