hex/native/voice_processing_guard.m
Dax Raad 3c2182ad19 voice isolation: harden the macOS bridge and keep the fallback raw
Adds an NSLock gate around the tap and configuration observer with a clean teardown, an Objective-C @try/@catch guard for AVAudioEngine exceptions, format and device verification, a channel-0 Float32 tap, configuration-change reporting, and a remembered raw fallback per microphone. Fixes the iOS category comparison for voiceChat's implicit hands-free Bluetooth and rewords the experiment's copy.
2026-11-22 16:46:29 -05:00

18 lines
474 B
Objective-C

#import "voice_processing_guard.h"
#import <Foundation/Foundation.h>
#include <stdlib.h>
int32_t hex_voice_processing_guard(hex_voice_processing_guard_body body, char **error) {
@try {
body();
return 0;
} @catch (NSException *exception) {
if (error != NULL) {
NSString *reason = exception.reason ?: exception.name ?: @"Objective-C exception";
*error = strdup(reason.UTF8String);
}
return 1;
}
}