Interface AudioPlayer


public interface AudioPlayer
Streams audio data from the server to clients. A player instance can be obtained by calling VoicechatServerApi.createAudioPlayer(AudioChannel, OpusEncoder, Supplier).
  • Method Details

    • startPlaying

      void startPlaying()
      Starts playing/streaming the audio.
    • stopPlaying

      void stopPlaying()
      Stops playing/streaming the audio.
    • isStarted

      boolean isStarted()
      Returns:
      if the player has been started
    • isPlaying

      boolean isPlaying()
      Returns:
      if the audio is still playing
    • isStopped

      boolean isStopped()
      Returns:
      if the player stopped playing
    • setOnStopped

      void setOnStopped(Runnable onStopped)
      Parameters:
      onStopped - a runnable that's called when the player is finished playing