Skip to content

AVFAudio tvOS xcode16.2 b3

Rolf Bjarne Kvinge edited this page Nov 22, 2024 · 2 revisions

#AVFAudio.framework https://github.com/xamarin/xamarin-macios/pull/21687

diff -ruN /Applications/Xcode_16.2.0-beta2.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h /Applications/Xcode_16.2.0-beta3.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h
--- /Applications/Xcode_16.2.0-beta2.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h	2024-10-21 20:53:23
+++ /Applications/Xcode_16.2.0-beta3.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h	2024-11-03 20:50:28
@@ -177,6 +177,35 @@
 /// Clients should use this property to determine what to badge content as.
 @property(readonly) AVAudioSessionRenderingMode renderingMode API_AVAILABLE(ios(17.2), tvos(17.2)) API_UNAVAILABLE(watchos, macos, visionos);
 
+/*!
+ @brief Set a preference to enable echo cancelled input on supported hardware
+
+Applications might want to record the built-in microphone's input while also playing audio out via the built-in speaker.
+Enabling echo cancelled input is useful when the application needs the input signal to be clear of any echoes
+from the audio playing out of the built-in speaker.
+
+Audio sessions using Voice Processor don't need this option as echo cancellation is implicitly applied for those routes.
+The Voice Processor solution is tuned for voice signals, unlike this option, which is tuned for better capture
+of wider range of audio signals in the presence of built-in speaker echo.
+
+This option is valid only when used with AVAudioSessionCategoryPlayAndRecord and AVAudioSessionModeDefault and is only available
+on certain 2024 or later iPhone models. Support can be queried using property `isEchoCancelledInputAvailable`.
+Other recording sessions might be interrupted if this option is not compatible with sessions that are already recording.
+
+After an audio session goes active, `isEchoCancelledInputEnabled` property can be queried to check if the option was honored.
+Note that the enabled state may change after route changes, e.g. if user plugs in a headset, that route might not support echo cancellation.
+*/
+- (BOOL)setPrefersEchoCancelledInput:(BOOL)value error:(NSError **)error API_AVAILABLE(ios(18.2)) API_UNAVAILABLE(tvos, watchos, macos, visionos);
+@property (readonly, nonatomic) BOOL prefersEchoCancelledInput API_AVAILABLE(ios(18.2)) API_UNAVAILABLE(tvos, watchos, macos, visionos);
+
+/// Returns YES if echo cancelled input is successfully enabled on an active session.
+/// Please see `prefersEchoCancelledInput` above for more details.
+@property (readonly, nonatomic) BOOL isEchoCancelledInputEnabled API_AVAILABLE(ios(18.2)) API_UNAVAILABLE(tvos, watchos, macos, visionos);
+
+/// Query whether built-in mic / built-in speaker route supports echo cancellation for the session's given category and mode.
+/// Returns YES if device model supports echo cancellation and the audio category is PlayAndRecord and the mode is Default.
+@property(readonly, nonatomic) BOOL isEchoCancelledInputAvailable API_AVAILABLE(ios(18.2)) API_UNAVAILABLE(watchos, tvos) API_UNAVAILABLE(macos);
+
 @end
 
 // -------------------------------------------------------------------------------------------------
Clone this wiki locally