use of net.dv8tion.jda.api.audio.factory.IAudioSendFactory in project JDA by DV8FromTheWorld.
the class AudioConnection method setupSendSystem.
/* Internals */
private synchronized void setupSendSystem() {
if (udpSocket != null && !udpSocket.isClosed() && sendHandler != null && sendSystem == null) {
IAudioSendFactory factory = getJDA().getAudioSendFactory();
sendSystem = factory.createSendSystem(new PacketProvider(new TweetNaclFast.SecretBox(webSocket.getSecretKey())));
sendSystem.setContextMap(getJDA().getContextMap());
sendSystem.start();
} else if (sendHandler == null && sendSystem != null) {
sendSystem.shutdown();
sendSystem = null;
if (opusEncoder != null) {
Opus.INSTANCE.opus_encoder_destroy(opusEncoder);
opusEncoder = null;
}
}
}
Aggregations