# TeeAudioProcessor.AudioBufferSink

# TeeAudioProcessor.AudioBufferSink

Artifact:[androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/audio/TeeAudioProcessor.java+class:androidx.media3.exoplayer.audio.TeeAudioProcessor.AudioBufferSink)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/audio/TeeAudioProcessor.AudioBufferSink "View this page in Java")

<br />

```
interface TeeAudioProcessor.AudioBufferSink
```

<br />

Known direct subclasses  
[CapturingAudioSink.InterceptingBufferSink](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/CapturingAudioSink.InterceptingBufferSink),[TeeAudioProcessor.WavFileAudioBufferSink](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/TeeAudioProcessor.WavFileAudioBufferSink),[WaveformAudioBufferSink](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/WaveformAudioBufferSink)  

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CapturingAudioSink.InterceptingBufferSink](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/CapturingAudioSink.InterceptingBufferSink)    |                                                                                                                                                                            |
| [TeeAudioProcessor.WavFileAudioBufferSink](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/TeeAudioProcessor.WavFileAudioBufferSink) | A sink for audio buffers that writes output audio as .wav files with a given path prefix.                                                                                  |
| [WaveformAudioBufferSink](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/WaveformAudioBufferSink)                                   | A sink for audio buffers that produces[waveform bars](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/WaveformAudioBufferSink.WaveformBar). |

*** ** * ** ***

A sink for audio buffers handled by the audio processor.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [flush](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/TeeAudioProcessor.AudioBufferSink#flush(int,int,int))`(sampleRateHz: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, channelCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, @`[C.PcmEncoding](https://developer.android.com/reference/kotlin/androidx/media3/common/C.PcmEncoding)` encoding: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called when the audio processor is flushed with a format of subsequent input. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [handleBuffer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/TeeAudioProcessor.AudioBufferSink#handleBuffer(java.nio.ByteBuffer))`(buffer: `[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html)`!)` Called when data is written to the audio processor.                                                                                                                                                                                                                                                                                                     |

## Public functions

### flush

```
fun flush(sampleRateHz: Int, channelCount: Int, @C.PcmEncoding encoding: Int): Unit
```

Called when the audio processor is flushed with a format of subsequent input.  

### handleBuffer

```
fun handleBuffer(buffer: ByteBuffer!): Unit
```

Called when data is written to the audio processor.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| `buffer: `[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html)`!` | A read-only buffer containing input which the audio processor will handle. |