Skip to content

AVFAudio tvOS xcode13.0 beta1

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_12.5.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioBuffer.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioBuffer.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioBuffer.h	2021-03-16 13:56:47.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioBuffer.h	2021-06-02 11:07:35.000000000 -0400
@@ -82,6 +82,34 @@
 */
 - (nullable instancetype)initWithPCMFormat:(AVAudioFormat *)format frameCapacity:(AVAudioFrameCount)frameCapacity NS_DESIGNATED_INITIALIZER;
 
+/*!	@method initWithPCMFormat:bufferListNoCopy:deallocator:
+	@abstract Initialize a buffer that is to contain PCM audio samples with a given AudioBufferList
+			  without copying samples and a custom deallocator block.
+	@param format
+		The format of the PCM audio to be contained in the buffer.
+	@param bufferList
+		The buffer list with allocated memory to contain the PCM audio data.
+	@param deallocator
+		A block to invoke when the resulting AVAudioPCMBuffer object is deallocated.
+	@discussion
+		An exception is raised if the format is not PCM.
+
+		Returns nil in the following cases:
+		- if the format has zero bytes per frame (format.streamDescription->mBytesPerFrame == 0)
+		- if supplied buffer has zero number of buffers
+		- if each buffer's data byte size are not equal or if any of the buffers' data byte size is zero
+		- if there is a mismatch between the format's number of buffers and the AudioBufferList's size
+			(1 if interleaved, mChannelsPerFrame if deinterleaved)
+		- if the AudioBufferList's pointer to the buffer of audio data is null.
+
+		Use the deallocator block to define your own deallocation behavior for the provided AudioBufferList's
+		underlying memory.
+
+		The AudioBufferList passed to the deallocator is identical to the one which was passed to the initializer,
+		in terms of the buffer count, and each buffer's mData and mDataByteSize members.
+*/
+- (nullable instancetype)initWithPCMFormat:(AVAudioFormat *)format bufferListNoCopy:(const AudioBufferList*)bufferList deallocator:(nullable void (^)(const AudioBufferList*))deallocator NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
+
 /*! @property frameCapacity
 	@abstract
 		The buffer's capacity, in audio sample frames.
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioUnitSampler.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioUnitSampler.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioUnitSampler.h	2021-03-16 13:56:49.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/AVFAudio.framework/Headers/AVAudioUnitSampler.h	2021-06-02 05:35:45.000000000 -0400
@@ -81,13 +81,22 @@
  */
 @property (nonatomic) float     stereoPan;
 
+
+/*! @property overallGain
+	@abstract
+		adjusts the gain of all the notes played
+		Range:     -90.0 -> +12 db
+		Default: 0 db
+ */
+@property (nonatomic) float     overallGain API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos) ;
+
 /*! @property masterGain
 	@abstract
-    	adjusts the gain of all the notes played
+		adjusts the gain of all the notes played
 		Range:     -90.0 -> +12 db
 		Default: 0 db
  */
-@property (nonatomic) float     masterGain;
+@property (nonatomic) float     masterGain API_DEPRECATED_WITH_REPLACEMENT("overallGain", ios(8.0, 15.0), macos(10.10, 12.0), tvos(9.0, 15.0)) ;
 
 /*! @property globalTuning
 	@abstract
Clone this wiki locally