Class AVAudioConverter

  • All Implemented Interfaces:
    NSObject

    public class AVAudioConverter
    extends NSObject
    AVAudioConverter Converts streams of audio between various formats.
    • Constructor Detail

      • AVAudioConverter

        protected AVAudioConverter​(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()
      • 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()
      • version_static

        public static long version_static()
      • applicableEncodeBitRates

        public NSArray<? extends NSNumber> applicableEncodeBitRates()
        [@property] applicableEncodeBitRates When encoding, an NSArray of NSNumber of bit rates that can be applied based on the current formats and settings. Returns nil if not encoding.
      • applicableEncodeSampleRates

        public NSArray<? extends NSNumber> applicableEncodeSampleRates()
        [@property] applicableEncodeSampleRates When encoding, an NSArray of NSNumber of output sample rates that can be applied based on the current formats and settings. Returns nil if not encoding.
      • availableEncodeBitRates

        public NSArray<? extends NSNumber> availableEncodeBitRates()
        [@property] availableEncodeBitRates When encoding, an NSArray of NSNumber of all bit rates provided by the codec. Returns nil if not encoding.
      • availableEncodeChannelLayoutTags

        public NSArray<? extends NSNumber> availableEncodeChannelLayoutTags()
        [@property] availableEncodeChannelLayoutTags When encoding, an NSArray of NSNumber of all output channel layout tags provided by the codec. Returns nil if not encoding.
      • availableEncodeSampleRates

        public NSArray<? extends NSNumber> availableEncodeSampleRates()
        [@property] availableEncodeSampleRates When encoding, an NSArray of NSNumber of all output sample rates provided by the codec. Returns nil if not encoding.
      • bitRate

        public long bitRate()
        [@property] bitRate bitRate in bits per second. Only applies when encoding.
      • bitRateStrategy

        public java.lang.String bitRateStrategy()
        [@property] bitRateStrategy When encoding, an AVEncoderBitRateStrategyKey value constant as defined in AVAudioSettings.h. Returns nil if not encoding.
      • channelMap

        public NSArray<? extends NSNumber> channelMap()
        [@property] channelMap An array of integers indicating from which input to derive each output. The array has size equal to the number of output channels. Each element's value is the input channel number, starting with zero, that is to be copied to that output. A negative value means that the output channel will have no source and will be silent. Setting a channel map overrides channel mapping due to any channel layouts in the input and output formats that may have been supplied.
      • convertToBufferErrorWithInputFromBlock

        public long convertToBufferErrorWithInputFromBlock​(AVAudioBuffer outputBuffer,
                                                           org.moe.natj.general.ptr.Ptr<NSError> outError,
                                                           AVAudioConverter.Block_convertToBufferErrorWithInputFromBlock inputBlock)
        convertToBuffer:error:withInputFromBlock: Perform any supported conversion. It attempts to fill the buffer to its capacity. On return, the buffer's length indicates the number of sample frames successfully converted.
        Parameters:
        inputBlock - A block which will be called to get input data as needed. See description for AVAudioConverterInputBlock.
        outputBuffer - The output buffer.
        outError - An error if the conversion fails.
        Returns:
        An AVAudioConverterOutputStatus is returned.
      • convertToBufferFromBufferError

        public boolean convertToBufferFromBufferError​(AVAudioPCMBuffer outputBuffer,
                                                      AVAudioPCMBuffer inputBuffer,
                                                      org.moe.natj.general.ptr.Ptr<NSError> outError)
        convertToBuffer:fromBuffer:error: Perform a simple conversion. That is, a conversion which does not involve codecs or sample rate conversion. The output buffer's frameCapacity should be at least at large as the inputBuffer's frameLength. If the conversion involves a codec or sample rate conversion, you instead must use convertToBuffer:error:withInputFromBlock:.
        Parameters:
        inputBuffer - The input buffer.
        outputBuffer - The output buffer.
        outError - An error if the conversion fails.
        Returns:
        YES is returned on success, NO when an error has occurred.
      • dither

        public boolean dither()
        [@property] dither Setting YES will turn on dither, if dither makes sense in given the current formats and settings. Default value is NO.
      • downmix

        public boolean downmix()
        [@property] downmix If YES and channel remapping is necessary, then channels will be mixed as appropriate instead of remapped. Default value is NO.
      • initFromFormatToFormat

        public AVAudioConverter initFromFormatToFormat​(AVAudioFormat fromFormat,
                                                       AVAudioFormat toFormat)
        initFromFormat:toFormat: Initialize from input and output formats. Returns nil if the format conversion is not possible.
        Parameters:
        fromFormat - The input format.
        toFormat - The output format.
      • inputFormat

        public AVAudioFormat inputFormat()
        [@property] inputFormat The format of the input audio stream. (NB. AVAudioFormat includes the channel layout)
      • magicCookie

        public NSData magicCookie()
        [@property] magicCookie Decoders require some data in the form of a magicCookie in order to decode properly. Encoders will produce a magicCookie.
      • maximumOutputPacketSize

        public long maximumOutputPacketSize()
        [@property] maximumOutputPacketSize The maximum size of an output packet, in bytes. When encoding it is useful to know how large a packet can be in order to allocate a buffer to receive the output.
      • outputFormat

        public AVAudioFormat outputFormat()
        [@property] outputFormat The format of the output audio stream. (NB. AVAudioFormat includes the channel layout)
      • primeMethod

        public long primeMethod()
        [@property] primeMethod Indicates the priming method to be used by the sample rate converter or decoder.
      • reset

        public void reset()
        reset Resets the converter so that a new stream may be converted.
      • sampleRateConverterAlgorithm

        public java.lang.String sampleRateConverterAlgorithm()
        [@property] sampleRateConverterAlgorithm An AVSampleRateConverterAlgorithmKey value as defined in AVAudioSettings.h.
      • sampleRateConverterQuality

        public long sampleRateConverterQuality()
        [@property] sampleRateConverterQuality An AVAudioQuality value as defined in AVAudioSettings.h.
      • setBitRate

        public void setBitRate​(long value)
        [@property] bitRate bitRate in bits per second. Only applies when encoding.
      • setBitRateStrategy

        public void setBitRateStrategy​(java.lang.String value)
        [@property] bitRateStrategy When encoding, an AVEncoderBitRateStrategyKey value constant as defined in AVAudioSettings.h. Returns nil if not encoding.
      • setChannelMap

        public void setChannelMap​(NSArray<? extends NSNumber> value)
        [@property] channelMap An array of integers indicating from which input to derive each output. The array has size equal to the number of output channels. Each element's value is the input channel number, starting with zero, that is to be copied to that output. A negative value means that the output channel will have no source and will be silent. Setting a channel map overrides channel mapping due to any channel layouts in the input and output formats that may have been supplied.
      • setDither

        public void setDither​(boolean value)
        [@property] dither Setting YES will turn on dither, if dither makes sense in given the current formats and settings. Default value is NO.
      • setDownmix

        public void setDownmix​(boolean value)
        [@property] downmix If YES and channel remapping is necessary, then channels will be mixed as appropriate instead of remapped. Default value is NO.
      • setMagicCookie

        public void setMagicCookie​(NSData value)
        [@property] magicCookie Decoders require some data in the form of a magicCookie in order to decode properly. Encoders will produce a magicCookie.
      • setPrimeInfo

        public void setPrimeInfo​(AVAudioConverterPrimeInfo value)
        [@property] primeInfo Indicates the the number of priming frames.
      • setPrimeMethod

        public void setPrimeMethod​(long value)
        [@property] primeMethod Indicates the priming method to be used by the sample rate converter or decoder.
      • setSampleRateConverterAlgorithm

        public void setSampleRateConverterAlgorithm​(java.lang.String value)
        [@property] sampleRateConverterAlgorithm An AVSampleRateConverterAlgorithmKey value as defined in AVAudioSettings.h.
      • setSampleRateConverterQuality

        public void setSampleRateConverterQuality​(long value)
        [@property] sampleRateConverterQuality An AVAudioQuality value as defined in AVAudioSettings.h.