Class AVAudioConverter

  • All Implemented Interfaces:
    NSObject

    public class AVAudioConverter
    extends NSObject
    AVAudioConverter Converts streams of audio between various formats. API-Since: 9.0
    • Constructor Detail

      • AVAudioConverter

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static AVAudioConverter allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • applicableEncodeBitRates

        @Nullable
        public @Nullable 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

        @Nullable
        public @Nullable 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.
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • availableEncodeBitRates

        @Nullable
        public @Nullable 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

        @Nullable
        public @Nullable 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

        @Nullable
        public @Nullable 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

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

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • channelMap

        @NotNull
        public @NotNull 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.
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • convertToBufferErrorWithInputFromBlock

        public long convertToBufferErrorWithInputFromBlock​(@NotNull
                                                           @NotNull AVAudioBuffer outputBuffer,
                                                           @Nullable
                                                           @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError,
                                                           @NotNull
                                                           @NotNull 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​(@NotNull
                                                      @NotNull AVAudioPCMBuffer outputBuffer,
                                                      @NotNull
                                                      @NotNull AVAudioPCMBuffer inputBuffer,
                                                      @Nullable
                                                      @Nullable 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.
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • 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.
      • hash_static

        public static long hash_static()
      • initFromFormatToFormat

        public AVAudioConverter initFromFormatToFormat​(@NotNull
                                                       @NotNull AVAudioFormat fromFormat,
                                                       @NotNull
                                                       @NotNull 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

        @NotNull
        public @NotNull AVAudioFormat inputFormat()
        [@property] inputFormat The format of the input audio stream. (NB. AVAudioFormat includes the channel layout)
      • 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

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • magicCookie

        @Nullable
        public @Nullable 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

        @NotNull
        public @NotNull 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.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • sampleRateConverterAlgorithm

        @Nullable
        public @Nullable 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​(@Nullable
                                       @Nullable 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​(@NotNull
                                  @NotNull 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​(@Nullable
                                   @Nullable 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​(@Nullable
                                                    @Nullable 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.
      • 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()
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.