Class ActiverseSound
java.lang.Object
ActiverseEngine.ActiverseSound
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
ConstructorsConstructorDescriptionActiverseSound
(String filename) Constructs a new ActiverseSound object with the specified audio file. -
Method Summary
Modifier and TypeMethodDescriptionGets 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
play()
Plays the loaded audio file.void
setVolume
(float volume) Sets the volume of the audio file.void
stop()
Stops the currently playing audio file.
-
Constructor Details
-
ActiverseSound
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
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).
-