Package de.presti.ree6.audio
Class AudioPlayerSendHandler
java.lang.Object
de.presti.ree6.audio.AudioPlayerSendHandler
- All Implemented Interfaces:
net.dv8tion.jda.api.audio.AudioSendHandler
public class AudioPlayerSendHandler
extends Object
implements net.dv8tion.jda.api.audio.AudioSendHandler
This is a wrapper around AudioPlayer which makes it behave as an AudioSendHandler for JDA. As JDA calls canProvide
before every call to provide20MsAudio(), we pull the frame in canProvide() and use the frame we already pulled in
provide20MsAudio().
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.audio.AudioSendHandler
INPUT_FORMAT
-
Constructor Summary
ConstructorDescriptionAudioPlayerSendHandler
(lavalink.client.player.LavaplayerPlayerWrapper audioPlayer) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if the AudioPlayer can provide Audio.boolean
isOpus()
Check if it is using the Opus Audio Library.Let the AudioPlayer provide a ByteBuffer of the Audio.
-
Constructor Details
-
AudioPlayerSendHandler
public AudioPlayerSendHandler(lavalink.client.player.LavaplayerPlayerWrapper audioPlayer) - Parameters:
audioPlayer
- Audio player to wrap.
-
-
Method Details
-
canProvide
public boolean canProvide()Check if the AudioPlayer can provide Audio.- Specified by:
canProvide
in interfacenet.dv8tion.jda.api.audio.AudioSendHandler
- Returns:
- true if audio was provided.
-
provide20MsAudio
Let the AudioPlayer provide a ByteBuffer of the Audio.- Specified by:
provide20MsAudio
in interfacenet.dv8tion.jda.api.audio.AudioSendHandler
- Returns:
- the ByteBuffer.
-
isOpus
public boolean isOpus()Check if it is using the Opus Audio Library.- Specified by:
isOpus
in interfacenet.dv8tion.jda.api.audio.AudioSendHandler
- Returns:
- true, if yes.
-