Class AudioMixingPushBufferStream

  • All Implemented Interfaces:
    javax.media.Controls, javax.media.protocol.Controls, javax.media.protocol.PushBufferStream, javax.media.protocol.SourceStream

    public class AudioMixingPushBufferStream
    extends ControlsAdapter
    implements javax.media.protocol.PushBufferStream
    Represents a PushBufferStream containing the result of the audio mixing of DataSources.
    Author:
    Lyubomir Marinov
    • Method Detail

      • endOfStream

        public boolean endOfStream()
        Implements SourceStream.endOfStream(). Delegates to the wrapped AudioMixerPushBufferStream because this instance is just a facet to it.
        Specified by:
        endOfStream in interface javax.media.protocol.SourceStream
        Returns:
        true if this SourceStream has reached the end of the media it makes available; otherwise, false
      • getContentDescriptor

        public javax.media.protocol.ContentDescriptor getContentDescriptor()
        Implements SourceStream.getContentDescriptor(). Delegates to the wrapped AudioMixerPushBufferStream because this instance is just a facet to it.
        Specified by:
        getContentDescriptor in interface javax.media.protocol.SourceStream
        Returns:
        a ContentDescriptor which describes the content being made available by this SourceStream
      • getContentLength

        public long getContentLength()
        Implements SourceStream.getContentLength(). Delegates to the wrapped AudioMixerPushBufferStream because this instance is just a facet to it.
        Specified by:
        getContentLength in interface javax.media.protocol.SourceStream
        Returns:
        the length of the media being made available by this SourceStream
      • getDataSource

        public AudioMixingPushBufferDataSource getDataSource()
        Gets the AudioMixingPushBufferDataSource which created and owns this instance and defines the input data which is to not be mixed in the output of this PushBufferStream.
        Returns:
        the AudioMixingPushBufferDataSource which created and owns this instance and defines the input data which is to not be mixed in the output of this PushBufferStream
      • getFormat

        public javax.media.format.AudioFormat getFormat()
        Implements PushBufferStream.getFormat(). Delegates to the wrapped AudioMixerPushBufferStream because this instance is just a facet to it.
        Specified by:
        getFormat in interface javax.media.protocol.PushBufferStream
        Returns:
        the Format of the audio being made available by this PushBufferStream
      • read

        public void read​(javax.media.Buffer buffer)
                  throws IOException
        Implements PushBufferStream.read(Buffer). If inSamples are available, mixes them and writes the mix to the specified Buffer performing the necessary data type conversions.
        Specified by:
        read in interface javax.media.protocol.PushBufferStream
        Parameters:
        buffer - the Buffer to receive the data read from this instance
        Throws:
        IOException - if anything wrong happens while reading from this instance
      • setTransferHandler

        public void setTransferHandler​(javax.media.protocol.BufferTransferHandler transferHandler)
        Implements PushBufferStream.setTransferHandler(BufferTransferHandler). Sets the BufferTransferHandler which is to be notified by this instance when it has media available for reading.
        Specified by:
        setTransferHandler in interface javax.media.protocol.PushBufferStream
        Parameters:
        transferHandler - the BufferTransferHandler to be notified by this instance when it has media available for reading