Interface AudioSink


  • public interface AudioSink
    • Method Detail

      • isInitialized

        boolean isInitialized()
        Returns the initialized state of this instance.

        The initialized state is affected by this instance overall availability, i.e. after instantiation, as well as by destroy().

      • getPlaySpeed

        float getPlaySpeed()
        Returns the playback speed.
      • setPlaySpeed

        boolean setPlaySpeed​(float s)
        Sets the playback speed.

        To simplify test, play speed is normalized, i.e.

        • 1.0f: if Math.abs(1.0f - rate) < 0.01f

        Returns:
        true if successful, otherwise false, i.e. due to unsupported value range of implementation.
      • getVolume

        float getVolume()
        Returns the volume.
      • setVolume

        boolean setVolume​(float v)
        Sets the volume [0f..1f].

        To simplify test, volume is normalized, i.e.

        • 0.0f: if Math.abs(v) < 0.01f
        • 1.0f: if Math.abs(1.0f - v) < 0.01f

        Returns:
        true if successful, otherwise false, i.e. due to unsupported value range of implementation.
      • getMaxSupportedChannels

        int getMaxSupportedChannels()
        Return the maximum number of supported channels.
      • isPlaying

        boolean isPlaying()
        Returns true, if play() has been requested and the sink is still playing, otherwise false.
      • play

        void play()
        Play buffers queued via #enqueueData(AudioFrame) from current internal position. If no buffers are yet queued or the queue runs empty, playback is being continued when buffers are enqueued later on.
        See Also:
        #enqueueData(AudioFrame), pause()
      • pause

        void pause()
        Pause playing buffers while keeping enqueued data incl. it's internal position.
        See Also:
        play(), flush(), #enqueueData(AudioFrame)
      • destroy

        void destroy()
        Destroys this instance, i.e. closes all streams and devices allocated.
      • getPTS

        int getPTS()
        Return the current audio presentation timestamp (PTS) in milliseconds.