Back to Exoplayer

TeeAudioProcessor.WavFileAudioBufferSink (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/audio/TeeAudioProcessor.WavFileAudioBufferSink.html

latest3.4 KB
Original Source

Package com.google.android.exoplayer2.audio

Class TeeAudioProcessor.WavFileAudioBufferSink

  • java.lang.Object

    • com.google.android.exoplayer2.audio.TeeAudioProcessor.WavFileAudioBufferSink
  • All Implemented Interfaces:TeeAudioProcessor.AudioBufferSinkEnclosing class:TeeAudioProcessor


public static final classTeeAudioProcessor.WavFileAudioBufferSinkextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[TeeAudioProcessor.AudioBufferSink](TeeAudioProcessor.AudioBufferSink.html "interface in com.google.android.exoplayer2.audio")

A sink for audio buffers that writes output audio as .wav files with a given path prefix. When new audio data is handled after flushing the audio processor, a counter is incremented and its value is appended to the output file name.

Note: if writing to external storage it's necessary to grant the WRITE_EXTERNAL_STORAGE permission.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | WavFileAudioBufferSink​(String outputFileNamePrefix) | Creates a new audio buffer sink that writes to .wav files with the given prefix. |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | flush​(int sampleRateHz, int channelCount, @com.google.android.exoplayer2.C.PcmEncoding int encoding) | Called when the audio processor is flushed with a format of subsequent input. | | void | handleBuffer​(ByteBuffer buffer) | Called when data is written to the audio processor. |

- 

Methods inherited from class java.lang.Object

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

Constructor Detail

- 

WavFileAudioBufferSink

public WavFileAudioBufferSink​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")outputFileNamePrefix)

Creates a new audio buffer sink that writes to .wav files with the given prefix. Parameters:outputFileNamePrefix - The prefix for output files.

Method Detail

- 

flush

public void flush​(int sampleRateHz,
                  int channelCount,
                  @com.google.android.exoplayer2.C.PcmEncoding int encoding)

Description copied from interface: TeeAudioProcessor.AudioBufferSink

Called when the audio processor is flushed with a format of subsequent input. Specified by:flush in interface TeeAudioProcessor.AudioBufferSink

- 

handleBuffer

public void handleBuffer​([ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")buffer)

Description copied from interface: TeeAudioProcessor.AudioBufferSink

Called when data is written to the audio processor. Specified by:handleBuffer in interface TeeAudioProcessor.AudioBufferSinkParameters:buffer - A read-only buffer containing input which the audio processor will handle.