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.Typefor 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 voidplay(File file, float gain)Plays an audio stream loaded from a file object.voidplay(InputStream stream, float gain)Plays an audio stream from the provided input stream.voidplay(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:
IOExceptionUnsupportedAudioFileExceptionLineUnavailableException
-
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:
IOExceptionUnsupportedAudioFileExceptionLineUnavailableException
-
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:
IOExceptionUnsupportedAudioFileExceptionLineUnavailableException
-
-