cpal/examples/ios-feedback
mbodmer 0a3e8c2208
add timeout paramter to DeviceTrait stream builders (#696)
* add timeout paramter to DeviceTrait stream builders

This makes it possible for the library client to handle situations where the host
takes too long to respond or even blocks forever, eg. a retry can be applied.

if the timeout passed is "None" the current behaviour is applied, eg. blocking forever.
if the timeout passed is a Duration then it will be applied to the Device Streams.
This is only implemented for ALSA, the other hosts will ignore the parameter for now.

Signed-off-by: Marc Bodmer <marc.bodmer@securiton.ch>
2022-10-18 18:15:31 +02:00
..
cpal-ios-example.xcodeproj Maybe fix ci 2021-12-31 11:06:14 -05:00
ios-src Refactor coreaudio host and add iOS support + ios-feedback example 2021-01-02 02:04:13 +11:00
src add timeout paramter to DeviceTrait stream builders (#696) 2022-10-18 18:15:31 +02:00
build_rust_deps.sh Maybe fix ci 2021-12-31 11:06:14 -05:00
Cargo.toml Refactor coreaudio host and add iOS support + ios-feedback example 2021-01-02 02:04:13 +11:00
README.md Fix some typo and warnings 2021-06-29 11:30:26 -04:00

iOS Feedback Example

This example is an Xcode project that exercises both input and output audio streams. Audio samples are read in from your microphone and then routed to your audio output device with a small but noticeable delay, so you can verify it is working correctly.

To build the example you will need to still cargo-lipo. While not necessary for building iOS binaries, it is used to build a universal binary (x86 for simulator and aarch64 for device.)

cargo install cargo-lipo

Then open the XCode project and click run. A hook in the iOS application lifecycle calls into the Rust code to start the input/output feedback loop and immediately returns back control.

Before calling into Rust, the AVAudioSession category is configured. This is important for controlling how audio is shared with the rest of the system when your app is in the foreground. One example is controlling whether other apps can play music in the background. More information here.