Package com.google.android.exoplayer2.audio

## Class TeeAudioProcessor

- java.lang.Object
- - com.google.android.exoplayer2.audio.BaseAudioProcessor
  - - com.google.android.exoplayer2.audio.TeeAudioProcessor

- All Implemented Interfaces:
    `AudioProcessor`

      public final class TeeAudioProcessor
      extends BaseAudioProcessor

  Audio processor that outputs its input unmodified and also outputs its input to a given sink. This is intended to be used for diagnostics and debugging.

  This audio processor can be inserted into the audio processor chain to access audio data before/after particular processing steps have been applied. For example, to get audio output after playback speed adjustment and silence skipping have been applied it is necessary to pass a custom `AudioProcessorChain` when creating the audio sink, and include this audio processor after all other audio processors.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `TeeAudioProcessor.AudioBufferSink` | A sink for audio buffers handled by the audio processor.
    `static class` | `TeeAudioProcessor.WavFileAudioBufferSink` | A sink for audio buffers that writes output audio as .wav files with a given path prefix.

    - ### Nested classes/interfaces inherited from interface com.google.android.exoplayer2.audio.AudioProcessor

      `AudioProcessor.AudioFormat, AudioProcessor.UnhandledAudioFormatException`

  - ### Field Summary

    - ### Fields inherited from class com.google.android.exoplayer2.audio.BaseAudioProcessor

      `inputAudioFormat, outputAudioFormat`

    - ### Fields inherited from interface com.google.android.exoplayer2.audio.AudioProcessor

      `EMPTY_BUFFER`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TeeAudioProcessor​(TeeAudioProcessor.AudioBufferSink audioBufferSink)` | Creates a new tee audio processor, sending incoming data to the given `TeeAudioProcessor.AudioBufferSink`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `AudioProcessor.AudioFormat` | `onConfigure​(AudioProcessor.AudioFormat inputAudioFormat)` | Called when the processor is configured for a new input format.
    `protected void` | `onFlush()` | Called when the processor is flushed, directly or as part of resetting.
    `protected void` | `onQueueEndOfStream()` | Called when the end-of-stream is queued to the processor.
    `protected void` | `onReset()` | Called when the processor is reset.
    `void` | `queueInput​(ByteBuffer inputBuffer)` | Queues audio data between the position and limit of the `inputBuffer` for processing.

    - ### Methods inherited from class com.google.android.exoplayer2.audio.BaseAudioProcessor

      `configure, flush, getOutput, hasPendingOutput, isActive, isEnded, queueEndOfStream, replaceOutputBuffer, reset`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TeeAudioProcessor

          public TeeAudioProcessor​(TeeAudioProcessor.AudioBufferSink audioBufferSink)

      Creates a new tee audio processor, sending incoming data to the given `TeeAudioProcessor.AudioBufferSink`.
      Parameters:
        `audioBufferSink` - The audio buffer sink that will receive input queued to this audio processor.

  - ### Method Detail

    - #### onConfigure

          public AudioProcessor.AudioFormat onConfigure​(AudioProcessor.AudioFormat inputAudioFormat)

      Description copied from class: `BaseAudioProcessor`
      Called when the processor is configured for a new input format.
      Overrides:
        `onConfigure` in class `BaseAudioProcessor`

    - #### queueInput

          public void queueInput​(ByteBuffer inputBuffer)

      Description copied from interface: `AudioProcessor`
      Queues audio data between the position and limit of the `inputBuffer` for processing. After calling this method, processed output may be available via `AudioProcessor.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.

    - #### onFlush

          protected void onFlush()

      Description copied from class: `BaseAudioProcessor`
      Called when the processor is flushed, directly or as part of resetting.
      Overrides:
        `onFlush` in class `BaseAudioProcessor`

    - #### onQueueEndOfStream

          protected void onQueueEndOfStream()

      Description copied from class: `BaseAudioProcessor`
      Called when the end-of-stream is queued to the processor.
      Overrides:
        `onQueueEndOfStream` in class `BaseAudioProcessor`

    - #### onReset

          protected void onReset()

      Description copied from class: `BaseAudioProcessor`
      Called when the processor is reset.
      Overrides:
        `onReset` in class `BaseAudioProcessor`