Class AVAudioTime

  • All Implemented Interfaces:
    NSObject

    public class AVAudioTime
    extends NSObject
    AVAudioTime 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.
    • Constructor Detail

      • AVAudioTime

        protected AVAudioTime​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • 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()
      • hostTimeForSeconds

        public static long hostTimeForSeconds​(double seconds)
        hostTimeForSeconds: Convert seconds to host time.
      • 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)
      • secondsForHostTime

        public static double secondsForHostTime​(long hostTime)
        secondsForHostTime: Convert host time to seconds.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • timeWithAudioTimeStampSampleRate

        public static AVAudioTime timeWithAudioTimeStampSampleRate​(AudioTimeStamp ts,
                                                                   double sampleRate)
        timeWithAudioTimeStamp:sampleRate:
      • timeWithHostTime

        public static AVAudioTime timeWithHostTime​(long hostTime)
        timeWithHostTime:
      • timeWithHostTimeSampleTimeAtRate

        public static AVAudioTime timeWithHostTimeSampleTimeAtRate​(long hostTime,
                                                                   long sampleTime,
                                                                   double sampleRate)
        timeWithHostTime:sampleTime:atRate:
      • timeWithSampleTimeAtRate

        public static AVAudioTime timeWithSampleTimeAtRate​(long sampleTime,
                                                           double sampleRate)
        timeWithSampleTime:atRate:
      • version_static

        public static long version_static()
      • audioTimeStamp

        public AudioTimeStamp audioTimeStamp()
        [@property] audioTimeStamp The time expressed as an AudioTimeStamp structure. This may be useful for compatibility with lower-level CoreAudio and AudioToolbox API's.
      • extrapolateTimeFromAnchor

        public AVAudioTime extrapolateTimeFromAnchor​(AVAudioTime anchorTime)
        extrapolateTimeFromAnchor: 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];
         
        Parameters:
        anchorTime - An AVAudioTime with a more complete AudioTimeStamp than that of the receiver (self).
        Returns:
        the extrapolated time
      • hostTime

        public long hostTime()
        [@property] hostTime The host time.
      • initWithAudioTimeStampSampleRate

        public AVAudioTime initWithAudioTimeStampSampleRate​(AudioTimeStamp ts,
                                                            double sampleRate)
        initWithAudioTimeStamp:sampleRate:
      • initWithHostTime

        public AVAudioTime initWithHostTime​(long hostTime)
        initWithHostTime:
      • initWithHostTimeSampleTimeAtRate

        public AVAudioTime initWithHostTimeSampleTimeAtRate​(long hostTime,
                                                            long sampleTime,
                                                            double sampleRate)
        initWithHostTime:sampleTime:atRate:
      • initWithSampleTimeAtRate

        public AVAudioTime initWithSampleTimeAtRate​(long sampleTime,
                                                    double sampleRate)
        initWithSampleTime:atRate:
      • isHostTimeValid

        public boolean isHostTimeValid()
        [@property] hostTimeValid Whether the hostTime property is valid.
      • isSampleTimeValid

        public boolean isSampleTimeValid()
        [@property] sampleTimeValid Whether the sampleTime and sampleRate properties are valid.
      • sampleRate

        public double sampleRate()
        [@property] sampleRate The sample rate at which sampleTime is being expressed.
      • sampleTime

        public long sampleTime()
        [@property] sampleTime The time as a number of audio samples, as tracked by the current audio device.