Class PushAudioInputStream

  • All Implemented Interfaces:
    AutoCloseable

    public final class PushAudioInputStream
    extends AudioInputStream
    Represents memory backed push audio input stream used for custom audio input configurations. Note: close() must be called in order to release underlying resources held by the object.
    • Method Detail

      • create

        public static PushAudioInputStream create()
        Creates a memory backed PushAudioInputStream using the default format (16 kHz, 16 bit, mono PCM).
        Returns:
        The push audio input stream being created.
      • create

        public static PushAudioInputStream create​(AudioStreamFormat format)
        Creates a memory backed PushAudioInputStream with the specified audio format.
        Parameters:
        format - The audio data format in which audio will be written to the push audio stream's write() method.
        Returns:
        The push audio input stream being created.
      • write

        public void write​(byte[] dataBuffer)
        Writes the audio data specified by making an internal copy of the data. Note: The dataBuffer should not contain any audio header.
        Parameters:
        dataBuffer - The audio buffer of which this function will make a copy.
      • close

        public void close()
        Closes the stream. Note: close() must be called in order to release underlying resources held by the object.
        Specified by:
        close in interface AutoCloseable
        Overrides:
        close in class AudioInputStream