| Lift freeq's AV media plane out of sleek 90f8b89 nandi 19d ago | 1 | # iOS Feedback Example |
| 2 | |
| 3 | This example is an Xcode project that exercises both input and output |
| 4 | audio streams. Audio samples are read in from your microphone and then |
| 5 | routed to your audio output device with a small but noticeable delay, |
| 6 | so you can verify it is working correctly. |
| 7 | |
| 8 | To build the example you will need to install `cargo-lipo`. While not |
| 9 | necessary for building iOS binaries, it is used to build a universal |
| 10 | binary (x86 for simulator and aarch64 for device.) |
| 11 | |
| 12 | ``` |
| 13 | cargo install cargo-lipo |
| 14 | ``` |
| 15 | |
| 16 | Then open the XCode project and click run. A hook in the iOS application |
| 17 | lifecycle calls into the Rust code to start the input/output feedback |
| 18 | loop and immediately returns back control. |
| 19 | |
| 20 | Before calling into Rust, the AVAudioSession category is configured. |
| 21 | This is important for controlling how audio is shared with the rest |
| 22 | of the system when your app is in the foreground. One example is |
| 23 | controlling whether other apps can play music in the background. |
| 24 | More information [here](https://developer.apple.com/library/archive/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html#//apple_ref/doc/uid/TP40007875-CH10). |
| 25 | |