Class PullAudioOutputStream

  • All Implemented Interfaces:
    AutoCloseable

    public final class PullAudioOutputStream
    extends AudioOutputStream
    Represents memory backed push audio output stream used for custom audio output configurations.
    • Constructor Detail

      • PullAudioOutputStream

        public PullAudioOutputStream​(IntRef stream)
        Internal constructor for PullAudioOutputStream.
        Parameters:
        stream - the native handle of the audio output stream.
    • Method Detail

      • create

        public static PullAudioOutputStream create()
        Creates a memory backed PullAudioOutputStream.
        Returns:
        The pull audio output stream being created.
      • read

        public long read​(byte[] dataBuffer)
        Reads the audio data specified by making an internal copy of the data. The maximal number of bytes to be read is determined by the size of dataBuffer. If there is no data immediately available, read() blocks until the next data becomes available.
        Parameters:
        dataBuffer - The audio buffer of which this function will make a copy to.
        Returns:
        The number of bytes filled, or 0 in case the stream hits its end and there is no more data available.