Package net.runelite.client.audio
Class AudioPlayer
- java.lang.Object
-
- net.runelite.client.audio.AudioPlayer
-
@Singleton public class AudioPlayer extends Object
General audio playback manager. Not all audio formats are supported. Refer toAudioFileFormat.Type
for a list of formats supported by the sound system.
-
-
Constructor Summary
Constructors Constructor Description AudioPlayer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
play(File file, float gain)
Plays an audio stream loaded from a file object.void
play(InputStream stream, float gain)
Plays an audio stream from the provided input stream.void
play(Class<?> c, String path, float gain)
Plays an audio stream loaded from a class resource.
-
-
-
Method Detail
-
play
public void play(File file, float gain) throws IOException, UnsupportedAudioFileException, LineUnavailableException
Plays an audio stream loaded from a file object.- Parameters:
file
- The file object pointing to the audio data.gain
- Gain control (in dB) to apply to audio playback.- Throws:
IOException
UnsupportedAudioFileException
LineUnavailableException
-
play
public void play(Class<?> c, String path, float gain) throws IOException, UnsupportedAudioFileException, LineUnavailableException
Plays an audio stream loaded from a class resource.- Parameters:
c
- The class with which to load the resource.path
- The class resource path.gain
- Gain control (in dB) to apply to audio playback.- Throws:
IOException
UnsupportedAudioFileException
LineUnavailableException
-
play
public void play(InputStream stream, float gain) throws IOException, UnsupportedAudioFileException, LineUnavailableException
Plays an audio stream from the provided input stream.- Parameters:
stream
- The input stream containing the audio data.gain
- Gain control (in dB) to apply to audio playback.- Throws:
IOException
UnsupportedAudioFileException
LineUnavailableException
-
-