Package apple.avfoundation
Class AVAudioFormat
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.avfoundation.AVAudioFormat
-
- All Implemented Interfaces:
NSCoding,NSSecureCoding,NSObject
public class AVAudioFormat extends NSObject implements NSSecureCoding
AVAudioFormat A representation of an audio format. AVAudioFormat wraps a Core Audio AudioStreamBasicDescription struct, with convenience initializers and accessors for common formats, including Core Audio's standard deinterleaved 32-bit floating point. Instances of this class are immutable.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAVAudioFormat(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.static booleanaccessInstanceVariablesDirectly()static AVAudioFormatalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)intchannelCount()[@property] channelCount The number of channels of audio data.AVAudioChannelLayoutchannelLayout()[@property] channelLayout The underlying AVAudioChannelLayout, if any.static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()longcommonFormat()[@property] commonFormat An `AVAudioCommonFormat` identifying the formatstatic java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()voidencodeWithCoder(NSCoder coder)CMFormatDescriptionRefformatDescription()[@property] formatDescription Converts to a CMAudioFormatDescriptionRef, for use with Core Media API's.static longhash_static()AVAudioFormatinit()AVAudioFormatinitStandardFormatWithSampleRateChannelLayout(double sampleRate, AVAudioChannelLayout layout)initStandardFormatWithSampleRate:channelLayout: Initialize to deinterleaved float with the specified sample rate and channel layout.AVAudioFormatinitStandardFormatWithSampleRateChannels(double sampleRate, int channels)initStandardFormatWithSampleRate:channels: Initialize to deinterleaved float with the specified sample rate and channel count.AVAudioFormatinitWithCMAudioFormatDescription(CMFormatDescriptionRef formatDescription)initWithCMAudioFormatDescription: initialize from a CMAudioFormatDescriptionRef.AVAudioFormatinitWithCoder(NSCoder coder)NS_DESIGNATED_INITIALIZERAVAudioFormatinitWithCommonFormatSampleRateChannelsInterleaved(long format, double sampleRate, int channels, boolean interleaved)initWithCommonFormat:sampleRate:channels:interleaved: Initialize to float with the specified sample rate, channel count and interleavedness.AVAudioFormatinitWithCommonFormatSampleRateInterleavedChannelLayout(long format, double sampleRate, boolean interleaved, AVAudioChannelLayout layout)initWithCommonFormat:sampleRate:interleaved:channelLayout: Initialize to float with the specified sample rate, channel layout and interleavedness.AVAudioFormatinitWithSettings(NSDictionary<java.lang.String,?> settings)initWithSettings: Initialize using a settings dictionary.AVAudioFormatinitWithStreamDescription(AudioStreamBasicDescription asbd)initWithStreamDescription: Initialize from an AudioStreamBasicDescription.AVAudioFormatinitWithStreamDescriptionChannelLayout(AudioStreamBasicDescription asbd, AVAudioChannelLayout layout)initWithStreamDescription:channelLayout: Initialize from an AudioStreamBasicDescription and optional channel layout.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisEqual(java.lang.Object object)isEqual: Determine whether another format is functionally equivalent.booleanisInterleaved()[@property] interleaved Describes whether the samples are interleaved.booleanisStandard()[@property] standard Describes whether the format is deinterleaved native-endian float.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)NSDatamagicCookie()[@property] magicCookie The underlying magic cookie, if any.static java.lang.Objectnew_objc()static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)doublesampleRate()[@property] sampleRate A sampling rate in Hertz.voidsetMagicCookie(NSData value)[@property] magicCookie The underlying magic cookie, if any.NSDictionary<java.lang.String,?>settings()[@property] settings Returns the format represented as a dictionary with keys from AVAudioSettings.h.static voidsetVersion_static(long aVersion)AudioStreamBasicDescriptionstreamDescription()[@property] streamDescription Returns the AudioStreamBasicDescription, for use with lower-level audio API's.static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static AVAudioFormat alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
version_static
public static long version_static()
-
channelCount
public int channelCount()
[@property] channelCount The number of channels of audio data.
-
channelLayout
public AVAudioChannelLayout channelLayout()
[@property] channelLayout The underlying AVAudioChannelLayout, if any. Only formats with more than 2 channels are required to have channel layouts.
-
commonFormat
public long commonFormat()
[@property] commonFormat An `AVAudioCommonFormat` identifying the format
-
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
- Specified by:
encodeWithCoderin interfaceNSCoding
-
formatDescription
public CMFormatDescriptionRef formatDescription()
[@property] formatDescription Converts to a CMAudioFormatDescriptionRef, for use with Core Media API's.
-
init
public AVAudioFormat init()
-
initStandardFormatWithSampleRateChannelLayout
public AVAudioFormat initStandardFormatWithSampleRateChannelLayout(double sampleRate, AVAudioChannelLayout layout)
initStandardFormatWithSampleRate:channelLayout: Initialize to deinterleaved float with the specified sample rate and channel layout.- Parameters:
sampleRate- the sample ratelayout- the channel layout. must not be nil.
-
initStandardFormatWithSampleRateChannels
public AVAudioFormat initStandardFormatWithSampleRateChannels(double sampleRate, int channels)
initStandardFormatWithSampleRate:channels: Initialize to deinterleaved float with the specified sample rate and channel count. If the format specifies more than 2 channels, this method fails (returns nil).- Parameters:
sampleRate- the sample ratechannels- the channel count
-
initWithCMAudioFormatDescription
public AVAudioFormat initWithCMAudioFormatDescription(CMFormatDescriptionRef formatDescription)
initWithCMAudioFormatDescription: initialize from a CMAudioFormatDescriptionRef. If formatDescription is invalid, this method fails (returns nil).- Parameters:
formatDescription- the CMAudioFormatDescriptionRef.
-
initWithCoder
public AVAudioFormat initWithCoder(NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
initWithCommonFormatSampleRateChannelsInterleaved
public AVAudioFormat initWithCommonFormatSampleRateChannelsInterleaved(long format, double sampleRate, int channels, boolean interleaved)
initWithCommonFormat:sampleRate:channels:interleaved: Initialize to float with the specified sample rate, channel count and interleavedness. If the format specifies more than 2 channels, this method fails (returns nil).- Parameters:
format- the common format typesampleRate- the sample ratechannels- the channel countinterleaved- true if interleaved
-
initWithCommonFormatSampleRateInterleavedChannelLayout
public AVAudioFormat initWithCommonFormatSampleRateInterleavedChannelLayout(long format, double sampleRate, boolean interleaved, AVAudioChannelLayout layout)
initWithCommonFormat:sampleRate:interleaved:channelLayout: Initialize to float with the specified sample rate, channel layout and interleavedness.- Parameters:
format- the common format typesampleRate- the sample rateinterleaved- true if interleavedlayout- the channel layout. must not be nil.
-
initWithSettings
public AVAudioFormat initWithSettings(NSDictionary<java.lang.String,?> settings)
initWithSettings: Initialize using a settings dictionary. See AVAudioSettings.h. Note that many settings dictionary elements pertain to encoder settings, not the basic format, and will be ignored. Returns nil if a format cannot be constructed with the provided settings, e.g. when: - AVNumberOfChannelsKey specifies more than 2 channels, but AVChannelLayoutKey hasn't been specified or the layout does not match - AVLinearPCMBitDepthKey for linear PCM format specifies less than 8 or greater than 32 bits - values for the keys are not of the expected types
-
initWithStreamDescription
public AVAudioFormat initWithStreamDescription(AudioStreamBasicDescription asbd)
initWithStreamDescription: Initialize from an AudioStreamBasicDescription. If the format specifies more than 2 channels, this method fails (returns nil).- Parameters:
asbd- the AudioStreamBasicDescription
-
initWithStreamDescriptionChannelLayout
public AVAudioFormat initWithStreamDescriptionChannelLayout(AudioStreamBasicDescription asbd, AVAudioChannelLayout layout)
initWithStreamDescription:channelLayout: Initialize from an AudioStreamBasicDescription and optional channel layout. If the format specifies more than 2 channels, this method fails (returns nil) unless layout is non-nil.- Parameters:
asbd- the AudioStreamBasicDescriptionlayout- the channel layout. Can be nil only if asbd specifies 1 or 2 channels.
-
isEqual
public boolean isEqual(java.lang.Object object)
isEqual: Determine whether another format is functionally equivalent. For PCM, interleavedness is ignored for mono. Differences in the AudioStreamBasicDescription alignment and packedness are ignored when they are not significant (e.g. with 1 channel, 2 bytes per frame and 16 bits per channel, neither alignment, the format is implicitly packed and can be interpreted as either high- or low-aligned.) For AVAudioChannelLayout, a layout with standard mono/stereo tag is considered to be equivalent to a nil layout. Otherwise, the layouts are compared for equality.
-
isInterleaved
public boolean isInterleaved()
[@property] interleaved Describes whether the samples are interleaved. For non-PCM formats, the value is undefined.
-
isStandard
public boolean isStandard()
[@property] standard Describes whether the format is deinterleaved native-endian float.
-
magicCookie
public NSData magicCookie()
[@property] magicCookie The underlying magic cookie, if any. A magic cookie contains metadata associated with encoders and decoders. Encoders produce a magic cookie, and some decoders require a magic cookie to decode properly.
-
sampleRate
public double sampleRate()
[@property] sampleRate A sampling rate in Hertz.
-
setMagicCookie
public void setMagicCookie(NSData value)
[@property] magicCookie The underlying magic cookie, if any. A magic cookie contains metadata associated with encoders and decoders. Encoders produce a magic cookie, and some decoders require a magic cookie to decode properly.
-
settings
public NSDictionary<java.lang.String,?> settings()
[@property] settings Returns the format represented as a dictionary with keys from AVAudioSettings.h.
-
streamDescription
public AudioStreamBasicDescription streamDescription()
[@property] streamDescription Returns the AudioStreamBasicDescription, for use with lower-level audio API's.
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.- Specified by:
_supportsSecureCodingin interfaceNSSecureCoding
-
-