Class AudioProcessingPipeline

    • Constructor Detail

      • AudioProcessingPipeline

        public AudioProcessingPipeline​(ImmutableList<AudioProcessor> audioProcessors)
        Deprecated.
        Creates an instance.
        Parameters:
        audioProcessors - The AudioProcessor instances to be used for processing buffers.
    • Method Detail

      • configure

        @CanIgnoreReturnValue
        public AudioProcessor.AudioFormat configure​(AudioProcessor.AudioFormat inputAudioFormat)
                                             throws AudioProcessor.UnhandledAudioFormatException
        Deprecated.
        Configures the pipeline to process input audio with the specified format. Returns the configured output audio format.

        To apply the new configuration for use, the pipeline must be flushed. Before applying the new configuration, it is safe to queue input and get output in the old input/output formats/configuration. Call queueEndOfStream() when no more input will be supplied for processing in the old configuration.

        Parameters:
        inputAudioFormat - The format of audio that will be queued after the next call to flush().
        Returns:
        The configured output audio format.
        Throws:
        AudioProcessor.UnhandledAudioFormatException - If the specified format is not supported by the pipeline.
      • flush

        public void flush()
        Deprecated.
        Clears any buffered data and pending output. If any underlying audio processors are active, this also prepares them to receive a new stream of input in the last configured (pending) format.

        configure(AudioFormat) must have been called at least once since the last call to reset() before calling this.

      • isOperational

        public boolean isOperational()
        Deprecated.
        Whether the pipeline can be used for processing buffers.

        For this to happen the pipeline must be configured, flushed and have active underlying audio processors that are ready to process buffers with the current configuration.

      • queueInput

        public 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().
        Parameters:
        inputBuffer - The input buffer to process. It must be a direct ByteBuffer 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.
      • getOutput

        public ByteBuffer getOutput()
        Deprecated.
        Returns a ByteBuffer containing processed output data between its position and limit. The buffer will be empty if no output is available.

        Buffers returned from this method are retained by pipeline, and it is necessary to consume the data (or copy it into another buffer) to allow the pipeline to progress.

        Returns:
        A buffer containing processed output data between its position and limit.
      • queueEndOfStream

        public void queueEndOfStream()
        Deprecated.
        Queues an end of stream signal. After this method has been called, queueInput(ByteBuffer) should 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.
      • isEnded

        public boolean isEnded()
        Deprecated.
        Returns whether the pipeline has ended.

        The pipeline is considered ended when:

      • reset

        public void reset()
        Deprecated.
        Resets the pipeline and its underlying AudioProcessor instances to their unconfigured state, releasing any resources.
      • equals

        public boolean equals​(@Nullable
                              Object o)
        Deprecated.
        Indicates whether some other object is "equal to" this one.

        Two instances of AudioProcessingPipeline are considered equal if they have the same underlying AudioProcessor references in the same order.

        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object