4 `Binary frameworks`_ are available and ready to use in your XCode project, for
7 #. Download and extract the corresponding ``framework.zip`` file from the `Download`_ page
9 #. Select **Build Phases** in your project setting and unfold **Link Binary with Libraries**
11 #. Add *AudioToolbox* and *Accelerate* system frameworks (or make sure they are listed)
13 #. Add ``aubio.framework`` from the unzipped ``framework.zip``
15 #. Include the aubio header in your code:
21 #include <aubio/aubio.h>
27 #import <aubio/aubio.h>
35 Using aubio from swift
36 ----------------------
38 Once you have downloaded and installed :ref:`aubio.framework
39 <xcode-frameworks-label>`, you sould be able to use aubio from C, Obj-C, and
43 Here is a short example showing how to read a sound file in swift:
50 let path = Bundle.main.path(forResource: "example", ofType: "mp4")
52 let hop_size : uint_t = 512
53 let a = new_fvec(hop_size)
54 let b = new_aubio_source(path, 0, hop_size)
56 var total_frames : uint_t = 0
58 aubio_source_do(b, a, &read)
60 if (read < hop_size) { break }
62 print("read", total_frames, "frames at", aubio_source_get_samplerate(b), "Hz")
66 print("could not find file")
70 .. _Binary frameworks: https://aubio.org/download
71 .. _iOS: https://aubio.org/download#ios
72 .. _macOS: https://aubio.org/download#osx