Skip to content

AVFAudio macOS xcode13.0 beta2

Manuel de la Pena edited this page Aug 25, 2021 · 2 revisions

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

diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h	2021-06-02 12:47:32.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h	2021-06-17 14:34:08.000000000 -0400
@@ -405,6 +405,15 @@
 - (BOOL)setAggregatedIOPreference:(AVAudioSessionIOType)inIOType
 							error:(NSError **)outError API_AVAILABLE(ios(10.0)) API_UNAVAILABLE(tvos, watchos, macos);
 
+/// Set YES to inform the system if the app can supply multichannel audio content.
+/// Default value is NO. This property is intended to be used by 'Now Playing' applications.
+/// See https://developer.apple.com/documentation/mediaplayer/becoming_a_now_playable_app for more information
+/// about what it means to be a 'Now Playing' application. Typically 'Now Playing' applications will also use
+/// AVAudioSessionRouteSharingPolicyLongFormAudio or AVAudioSessionRouteSharingPolicyLongFormVideo.
+- (BOOL)setSupportsMultichannelContent:(BOOL)inValue error:(NSError **)outError API_AVAILABLE(ios(15.0), watchos(8.0), tvos(15.0)) API_UNAVAILABLE(macos);
+
+@property(readonly) BOOL supportsMultichannelContent API_AVAILABLE(ios(15.0), watchos(8.0), tvos(15.0)) API_UNAVAILABLE(macos);
+
 @end // interface for AVAudioSession (RoutingConfiguration)
 
 #pragma mark-- Names for NSNotifications --
@@ -456,9 +465,26 @@
 */
 OS_EXPORT NSNotificationName const  AVAudioSessionSilenceSecondaryAudioHintNotification API_AVAILABLE(ios(8.0), watchos(2.0), tvos(9.0));
 
+/*!
+    @brief  Notification sent to registered listeners when spatial playback capabilities are changed due to a
+    change in user preference.
+
+    Check the notification's userInfo dictionary for AVAudioSessionSpatialAudioEnabledKey to check if spatial
+    audio is enabled.
+    
+    Observers of this notification should also observe AVAudioSessionRouteChangeNotification since a route change
+    may also result in a change in the ability for the system to play spatial audio. Use
+    AVAudioSessionPortDescription's isSpatialAudioEnabled property to check if the current route supports
+    spatialized playback.
+*/
+OS_EXPORT NSNotificationName const  AVAudioSessionSpatialPlaybackCapabilitiesChangedNotification API_AVAILABLE(ios(15.0), watchos(8.0), tvos(15.0)) API_UNAVAILABLE(macos) NS_SWIFT_NAME(AVAudioSession.spatialPlaybackCapabilitiesChangedNotification);
 
 #pragma mark-- Keys for NSNotification userInfo dictionaries --
 
+/// keys for AVAudioSessionSpatialPlaybackCapabilitiesChangedNotification
+/// value is an NSNumber whose boolean value indicates if spatial audio enabled.
+OS_EXPORT NSString *const AVAudioSessionSpatialAudioEnabledKey API_AVAILABLE(ios(15.0), watchos(8.0), tvos(15.0)) API_UNAVAILABLE(macos);
+
 /// keys for AVAudioSessionInterruptionNotification
 /// Value is an NSNumber representing an AVAudioSessionInterruptionType
 OS_EXPORT NSString *const AVAudioSessionInterruptionTypeKey API_AVAILABLE(ios(6.0), watchos(2.0), tvos(9.0));
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSessionRoute.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSessionRoute.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSessionRoute.h	2021-06-02 11:07:36.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioSessionRoute.h	2021-06-17 04:14:06.000000000 -0400
@@ -150,6 +150,25 @@
 */
 @property (readonly) BOOL hasHardwareVoiceCallProcessing API_AVAILABLE(ios(10.0), watchos(3.0), tvos(10.0)) API_UNAVAILABLE(macos);
 
+/*!
+    @brief This property's value will be true if the port supports spatial audio playback and the feature is
+    enabled.
+     
+    'Now Playing' apps should also inform the system if they support multichannel audio content using
+    -setSupportsMultichannelContent:error: method. Apps may also register to receive the
+    AVAudioSessionSpatialPlaybackCapabilitiesChanged notification to detect changes in user preferences that
+    affect spatial audio playback.
+   
+    This property is only relevant in the context of ports that have a small number of hardware channels
+    (typically 2), but have enhanced capabilities for rendering multi-channel content. Note that some port
+    types such as USB and HDMI may support multi-channel playback because they have hardware formats supporting
+    more than 2 channels. For example, many HDMI receivers are connected to multiple speakers and are capable of
+    rendering 5.1, 7.1, or other popular surround sound formats. Applications interested in utilizing multi-channel
+    formats should also query AVAudioSession's maximumOutputNumberOfChannels property and make use of
+    -setPreferredOutputNumberOfChannels:error: to set the preferred number of hardware channels.
+*/
+@property (readonly, getter=isSpatialAudioEnabled) BOOL spatialAudioEnabled API_AVAILABLE(ios(15.0), watchos(8.0), tvos(15.0)) API_UNAVAILABLE(macos);
+
 @property (readonly, nonatomic, nullable) NSArray<AVAudioSessionChannelDescription *> *channels API_AVAILABLE(ios(6.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 
 /// Will be nil if there are no selectable data sources.
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVFAudio.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVFAudio.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVFAudio.h	2021-06-01 20:33:09.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVFAudio.h	2021-06-11 10:34:58.000000000 -0400
@@ -19,7 +19,9 @@
 #import <AVFAudio/AVAudioPlayerNode.h>
 #if !0
 #import <AVFAudio/AVAudioRecorder.h>
+#import <AVFAudio/AVAudioRoutingArbiter.h>
 #endif
+
 #import <AVFAudio/AVAudioSequencer.h>
 #import <AVFAudio/AVAudioSettings.h>
 #import <AVFAudio/AVAudioSinkNode.h>
@@ -52,7 +54,5 @@
 #import <AVFAudio/AVAudioSessionDeprecated.h>
 #endif
 
-#if TARGET_OS_OSX
-#import <AVFAudio/AVAudioRoutingArbiter.h>
-#endif
+
 
Clone this wiki locally