Interface AudioProcessor

    • Method Detail

      • configure

        @CanIgnoreReturnValue
        AudioProcessor.AudioFormat configure​(AudioProcessor.AudioFormat inputAudioFormat)
                                      throws AudioProcessor.UnhandledAudioFormatException
        Deprecated.
        Configures the processor to process input audio with the specified format. After calling this method, call isActive() to determine whether the audio processor is active. Returns the configured output audio format if this instance is active.

        After calling this method, it is necessary to flush() the processor to apply the new configuration. Before applying the new configuration, it is safe to queue input and get output in the old input/output formats. Call queueEndOfStream() when no more input will be supplied in the old input format.

        Parameters:
        inputAudioFormat - The format of audio that will be queued after the next call to flush().
        Returns:
        The configured output audio format if this instance is active.
        Throws:
        AudioProcessor.UnhandledAudioFormatException - Thrown if the specified format can't be handled as input.
      • isActive

        boolean isActive()
        Deprecated.
        Returns whether the processor is configured and will process input buffers.
      • queueInput

        void queueInput​(ByteBuffer inputBuffer)
        Deprecated.
        Queues audio data between the position and limit of the inputBuffer for processing. After calling this method, processed output may be available via getOutput(). Calling queueInput(ByteBuffer) again invalidates any pending output.
        Parameters:
        inputBuffer - The input buffer to process. It must be a direct byte buffer with native byte order. Its contents are treated as read-only. Its position will be advanced by the number of bytes consumed (which may be zero). The caller retains ownership of the provided buffer.
      • queueEndOfStream

        void queueEndOfStream()
        Deprecated.
        Queues an end of stream signal. After this method has been called, queueInput(ByteBuffer) may not be called until after the next call to flush(). Calling getOutput() will return any remaining output data. Multiple calls may be required to read all of the remaining output data. isEnded() will return true once all remaining output data has been read.
      • getOutput

        ByteBuffer getOutput()
        Deprecated.
        Returns a buffer containing processed output data between its position and limit. The buffer will always be a direct byte buffer with native byte order. Calling this method invalidates any previously returned buffer. The buffer will be empty if no output is available.
        Returns:
        A buffer containing processed output data between its position and limit.
      • isEnded

        boolean isEnded()
        Deprecated.
        Returns whether this processor will return no more output from getOutput() until flush() has been called and more input has been queued.
      • flush

        void flush()
        Deprecated.
        Clears any buffered data and pending output. If the audio processor is active, also prepares the audio processor to receive a new stream of input in the last configured (pending) format.
      • reset

        void reset()
        Deprecated.
        Resets the processor to its unconfigured state, releasing any resources.