Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Unreleased

- ALSA(process_output): pass `silent=true` to `PCM.try_recover`, so it doesn't write to stderr
- WASAPI: Expose IMMDevice from WASAPI host Device.
- ALSA(process_output): pass `silent=true` to `PCM.try_recover`, so it doesn't write to stderr.
- CoreAudio: `Device::supported_configs` now returns a single element containing the available sample rate range when all elements have the same `mMinimum` and `mMaximum` values (which is the most common case).
- iOS: Fix example by properly activating audio session.
- WASAPI: Expose IMMDevice from WASAPI host Device.

# Version 0.16.0 (2025-06-07)

Expand Down
26 changes: 15 additions & 11 deletions examples/ios-feedback/ios-src/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,29 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.

NSError *error;
BOOL success;

// It is necessary to access the sharedInstance so that calls to AudioSessionGetProperty
// will work.
AVAudioSession *session = AVAudioSession.sharedInstance;
// Setting up the category is not necessary, but generally advised.
// Since this demo records and plays, lets use AVAudioSessionCategoryPlayAndRecord.
// Also default to speaker as defaulting to the phone earpiece would be unusual.
// Allowing bluetooth should direct audio to your bluetooth headset.
success = [session setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetooth
error:&error];

if (success) {
NSLog(@"Calling rust_ios_main()");
rust_ios_main();
NSError *categoryError = nil;
BOOL isSetCategorySuccess = [session setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetooth
error:&categoryError];
if (isSetCategorySuccess) {
NSError *activateError = nil;
BOOL isActivateSuccess = [session setActive:YES error:&activateError];

if (isActivateSuccess) {
NSLog(@"Calling rust_ios_main()");
rust_ios_main();
} else {
NSLog(@"Failed to activate audio session: %@", activateError);
}
} else {
NSLog(@"Failed to configure audio session category");
NSLog(@"Failed to set category: %@", categoryError);
}

return YES;
Expand Down
Loading