public class AVAudioTime extends NSObject
Represent a moment in time.
AVAudioTime is used in AVAudioEngine to represent time. Instances are immutable.
A single moment in time may be represented in two different ways: 1. mach_absolute_time(), the system's basic clock. Commonly referred to as "host time." 2. audio samples at a particular sample rate
A single AVAudioTime instance may contain either or both representations; it might represent only a sample time, only a host time, or both.
Rationale for using host time: [a] internally we are using AudioTimeStamp, which uses host time, and it seems silly to divide [b] it is consistent with a standard system timing service [c] we do provide conveniences to convert between host ticks and seconds (host time divided by frequency) so client code wanting to do what should be straightforward time computations can at least not be cluttered by ugly multiplications and divisions by the host clock frequency.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
AVAudioTime(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static AVAudioTime |
alloc() |
static AVAudioTime |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
AudioTimeStamp |
audioTimeStamp()
[@property] audioTimeStamp
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
AVAudioTime |
extrapolateTimeFromAnchor(AVAudioTime anchorTime)
extrapolateTimeFromAnchor:
|
static long |
hash_static() |
long |
hostTime()
[@property] hostTime
|
static long |
hostTimeForSeconds(double seconds)
hostTimeForSeconds:
|
AVAudioTime |
init() |
AVAudioTime |
initWithAudioTimeStampSampleRate(AudioTimeStamp ts,
double sampleRate)
initWithAudioTimeStamp:sampleRate:
|
AVAudioTime |
initWithHostTime(long hostTime)
initWithHostTime:
|
AVAudioTime |
initWithHostTimeSampleTimeAtRate(long hostTime,
long sampleTime,
double sampleRate)
initWithHostTime:sampleTime:atRate:
|
AVAudioTime |
initWithSampleTimeAtRate(long sampleTime,
double sampleRate)
initWithSampleTime:atRate:
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
boolean |
isHostTimeValid()
[@property] hostTimeValid
|
boolean |
isSampleTimeValid()
[@property] sampleTimeValid
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static AVAudioTime |
new_objc() |
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
double |
sampleRate()
[@property] sampleRate
|
long |
sampleTime()
[@property] sampleTime
|
static double |
secondsForHostTime(long hostTime)
secondsForHostTime:
|
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static AVAudioTime |
timeWithAudioTimeStampSampleRate(AudioTimeStamp ts,
double sampleRate)
timeWithAudioTimeStamp:sampleRate:
|
static AVAudioTime |
timeWithHostTime(long hostTime)
timeWithHostTime:
|
static AVAudioTime |
timeWithHostTimeSampleTimeAtRate(long hostTime,
long sampleTime,
double sampleRate)
timeWithHostTime:sampleTime:atRate:
|
static AVAudioTime |
timeWithSampleTimeAtRate(long sampleTime,
double sampleRate)
timeWithSampleTime:atRate:
|
static long |
version_static() |
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, isEqual, 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, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static AVAudioTime alloc()
public static AVAudioTime allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public AudioTimeStamp audioTimeStamp()
The time expressed as an AudioTimeStamp structure.
This may be useful for compatibility with lower-level CoreAudio and AudioToolbox API's.
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public AVAudioTime extrapolateTimeFromAnchor(AVAudioTime anchorTime)
Converts between host and sample time.
If anchorTime is an AVAudioTime where both host time and sample time are valid, and self is another timestamp where only one of the two is valid, this method returns a new AVAudioTime copied from self and where any additional valid fields provided by the anchor are also valid.
Note that the anchorTime must have both host and sample time valid, and self must have sample rate and at least one of host or sample time valid. Otherwise this method returns nil.
// time0 has a valid audio sample representation, but no host time representation. AVAudioTime *time0 = [AVAudioTime timeWithSampleTime: 0.0 atRate: 44100.0]; // anchor has a valid host time representation and sample time representation. AVAudioTime *anchor = [player playerTimeForNodeTime: player.lastRenderTime]; // fill in valid host time representation AVAudioTime *fullTime0 = [time0 extrapolateTimeFromAnchor: anchor];
anchorTime - An AVAudioTime with a more complete AudioTimeStamp than that of the receiver (self).public static long hash_static()
public long hostTime()
The host time.
public static long hostTimeForSeconds(double seconds)
Convert seconds to host time.
public AVAudioTime init()
public AVAudioTime initWithAudioTimeStampSampleRate(AudioTimeStamp ts, double sampleRate)
public AVAudioTime initWithHostTime(long hostTime)
public AVAudioTime initWithHostTimeSampleTimeAtRate(long hostTime, long sampleTime, double sampleRate)
public AVAudioTime initWithSampleTimeAtRate(long sampleTime, double sampleRate)
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public boolean isHostTimeValid()
Whether the hostTime property is valid.
public boolean isSampleTimeValid()
Whether the sampleTime and sampleRate properties are valid.
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static AVAudioTime new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public double sampleRate()
The sample rate at which sampleTime is being expressed.
public long sampleTime()
The time as a number of audio samples, as tracked by the current audio device.
public static double secondsForHostTime(long hostTime)
Convert host time to seconds.
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static AVAudioTime timeWithAudioTimeStampSampleRate(AudioTimeStamp ts, double sampleRate)
public static AVAudioTime timeWithHostTime(long hostTime)
public static AVAudioTime timeWithHostTimeSampleTimeAtRate(long hostTime, long sampleTime, double sampleRate)
public static AVAudioTime timeWithSampleTimeAtRate(long sampleTime, double sampleRate)
public static long version_static()