Class ActiverseSound

java.lang.Object
ActiverseEngine.ActiverseSound

public class ActiverseSound extends Object
Represents a sound player for playing audio files. This class provides methods to load, play, stop, and manage the volume of audio files.
Version:
1.3.2
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new ActiverseSound object with the specified audio file.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the filename of the audio file.
    float
    Gets the current volume of the audio file.
    boolean
    Checks if the audio file is currently playing.
    void
    Plays the loaded audio file.
    void
    setVolume(float volume)
    Sets the volume of the audio file.
    void
    Stops the currently playing audio file.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ActiverseSound

      public ActiverseSound(String filename)
      Constructs a new ActiverseSound object with the specified audio file.
      Parameters:
      filename - The path to the audio file.
  • Method Details

    • play

      public void play()
      Plays the loaded audio file.
    • stop

      public void stop()
      Stops the currently playing audio file.
    • isPlaying

      public boolean isPlaying()
      Checks if the audio file is currently playing.
      Returns:
      true if the audio file is playing, false otherwise.
    • getFilename

      public String getFilename()
      Gets the filename of the audio file.
      Returns:
      The filename of the audio file.
    • getVolume

      public float getVolume()
      Gets the current volume of the audio file.
      Returns:
      The current volume level (range: 0.0 to 1.0).
    • setVolume

      public void setVolume(float volume)
      Sets the volume of the audio file.
      Parameters:
      volume - The volume level to set (range: 0.0 to 1.0).