Class OggFileAudioBufferSink

  • All Implemented Interfaces:
    AudioSink

    public final class OggFileAudioBufferSink
    extends ForwardingAudioSink
    A sink for audio buffers that writes output audio as .ogg files with a given path prefix. When new audio data is handled after flushing the audio packetizer, 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.

    • Field Detail

      • SAMPLE_RATE

        public static final int SAMPLE_RATE
        Opus streams are always 48000 Hz.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OggFileAudioBufferSink

        public OggFileAudioBufferSink​(AudioSink audioSink,
                                      String outputFileNamePrefix)
        Creates an instance.
        Parameters:
        audioSink - The base audioSink calls are forwarded to.
        outputFileNamePrefix - The prefix for output files.