# CapturingAudioSink.SampleInterceptingBufferSink

Artifact: [androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/CapturingAudioSink.java+class:androidx.media3.test.utils.CapturingAudioSink.SampleInterceptingBufferSink)

*** ** * ** ***


```
public final class CapturingAudioSink.SampleInterceptingBufferSink implements TeeAudioProcessor.AudioBufferSink
```

<br />

*** ** * ** ***

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/CapturingAudioSink.SampleInterceptingBufferSink#SampleInterceptingBufferSink()()` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/CapturingAudioSink.SampleInterceptingBufferSink#flush(int,int,int)(int sampleRateHz, int channelCount, @https://developer.android.com/reference/androidx/media3/common/C.PcmEncoding int encoding)` Called when the audio processor is flushed with a format of subsequent input. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/CapturingAudioSink.SampleInterceptingBufferSink#handleBuffer(java.nio.ByteBuffer)(https://developer.android.com/reference/java/nio/ByteBuffer.html buffer)` Called when data is written to the audio processor. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/CapturingAudioSink.SampleInterceptingBufferSink#setCapturingAudioSink(androidx.media3.test.utils.CapturingAudioSink)(https://developer.android.com/reference/androidx/media3/test/utils/CapturingAudioSink capturingAudioSink)` |

## Public constructors

### SampleInterceptingBufferSink

```
public SampleInterceptingBufferSink()
```

## Public methods

### flush

```
public void flush(int sampleRateHz, int channelCount, @C.PcmEncoding int encoding)
```

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

### handleBuffer

```
public void handleBuffer(ByteBuffer buffer)
```

Called when data is written to the audio processor.

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

### setCapturingAudioSink

```
public void setCapturingAudioSink(CapturingAudioSink capturingAudioSink)
```