Class SNAudioStreamAnalyzer

  • All Implemented Interfaces:
    NSObject

    public class SNAudioStreamAnalyzer
    extends NSObject
    Analyzes a stream of audio data and provides analysis results to the client SNAudioStreamAnalyzer should be used to analyze a stream of audio, represented by a sequence of audio buffers over time.
    • Constructor Detail

      • SNAudioStreamAnalyzer

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • addRequestWithObserverError

        public boolean addRequestWithObserverError​(SNRequest request,
                                                   SNResultsObserving observer,
                                                   org.moe.natj.general.ptr.Ptr<NSError> error)
        Adds a new analysis request to the analyzer Requests can be added while analysis is in progress. If the analyzer cannot perform the requested analysis, an error will be returned. For example, an error could be returned if the request requires a stream format that doesn't match the analyzer's stream format.
        Parameters:
        request - An audio analysis request to be performed on the audio stream
        observer - The object that will receive the analysis results for the supplied request. The observer is weakly retained by the analyzer.
        error - On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
        Returns:
        YES if the request was successfully added, and NO otherwise.
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • analyzeAudioBufferAtAudioFramePosition

        public void analyzeAudioBufferAtAudioFramePosition​(AVAudioBuffer audioBuffer,
                                                           long audioFramePosition)
        Provides the next buffer for analysis The framePosition should be a monotonically increasing sample timestamp. If the sample timeline is detected to be non-continuous, the analyzer's internal state may reset to account for the jump. Some types of audio analysis are performed at a fixed block size, which may differ from the buffer sizes provided for analysis. For this reason, an invocation of analyzeAudioBuffer may cause an analysis request observer to be called zero times, one time, or many times, depending on the relationship between the input buffer size, current analyzer state, and native analysis block size. Any errors produced during analysis will be provided through the request observers. This method may block as a means of indicating backpressure to the caller. These methods are not safe to call from a realtime audio context but may be called from lower priority threads (i.e. AVAudioEngine tap callback or AudioQueue callback).
        Parameters:
        audioBuffer - The buffer containing the audio to be processed
        audioFramePosition - The frame position of the data in the buffer
      • 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()
      • completeAnalysis

        public void completeAnalysis()
        Indicates that the audio stream has ended, and no more audio buffers will be analyzed After this method has been called, it is invalid to provide any more audio data for analysis, and any provided buffers will be ignored. This method is useful for types of analysis that may have final results to provide upon the completion of the stream.
      • 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()
      • initWithFormat

        public SNAudioStreamAnalyzer initWithFormat​(AVAudioFormat format)
        Creates a new analyzer
        Parameters:
        format - The format of the audio stream to be analyzed. Only PCM formats are supported.
      • 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()
      • removeAllRequests

        public void removeAllRequests()
        Removes all requests from the analyzer
      • removeRequest

        public void removeRequest​(SNRequest request)
        Removes an existing analysis request from the analyzer Requests can be removed while analysis is in progress. Once the removeRequest method returns, the previously registered observer will not receive any more callbacks.
        Parameters:
        request - An audio analysis request to be removed
      • 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()
      • version_static

        public static long version_static()