本文整理匯總了Java中net.dv8tion.jda.core.audio.factory.IAudioSendFactory類的典型用法代碼示例。如果您正苦於以下問題:Java IAudioSendFactory類的具體用法?Java IAudioSendFactory怎麽用?Java IAudioSendFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IAudioSendFactory類屬於net.dv8tion.jda.core.audio.factory包,在下文中一共展示了IAudioSendFactory類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupSendSystem
import net.dv8tion.jda.core.audio.factory.IAudioSendFactory; //導入依賴的package包/類
private synchronized void setupSendSystem()
{
if (udpSocket != null && !udpSocket.isClosed() && sendHandler != null && sendSystem == null)
{
IntBuffer error = IntBuffer.allocate(4);
opusEncoder = Opus.INSTANCE.opus_encoder_create(OPUS_SAMPLE_RATE, OPUS_CHANNEL_COUNT, Opus.OPUS_APPLICATION_AUDIO, error);
IAudioSendFactory factory = ((JDAImpl) channel.getJDA()).getAudioSendFactory();
sendSystem = factory.createSendSystem(new PacketProvider());
sendSystem.setContextMap(contextMap);
sendSystem.start();
}
else if (sendHandler == null && sendSystem != null)
{
sendSystem.shutdown();
sendSystem = null;
if (opusEncoder != null)
{
Opus.INSTANCE.opus_encoder_destroy(opusEncoder);
opusEncoder = null;
}
}
}
示例2: getAudioSendFactory
import net.dv8tion.jda.core.audio.factory.IAudioSendFactory; //導入依賴的package包/類
public IAudioSendFactory getAudioSendFactory()
{
return audioSendFactory;
}
示例3: setAudioSendFactory
import net.dv8tion.jda.core.audio.factory.IAudioSendFactory; //導入依賴的package包/類
public void setAudioSendFactory(IAudioSendFactory factory)
{
Checks.notNull(factory, "Provided IAudioSendFactory");
this.audioSendFactory = factory;
}
示例4: adapt
import net.dv8tion.jda.core.audio.factory.IAudioSendFactory; //導入依賴的package包/類
/**
* Wrap the given factory with the default backlog. ({@value CommonAsync#DEFAULT_BACKLOG})
*
* @param factory the factory to be wrapped
* @return
*/
public static AsyncPacketProviderFactory adapt(IAudioSendFactory factory) {
return AsyncPacketProviderFactory.adapt(factory, CommonAsync.DEFAULT_BACKLOG);
}
示例5: setAudioSendFactory
import net.dv8tion.jda.core.audio.factory.IAudioSendFactory; //導入依賴的package包/類
/**
* Changes the factory used to create {@link net.dv8tion.jda.core.audio.factory.IAudioSendSystem IAudioSendSystem}
* objects which handle the sending loop for audio packets.
* <br>By default, JDA uses {@link net.dv8tion.jda.core.audio.factory.DefaultSendFactory DefaultSendFactory}.
*
* @param factory
* The new {@link net.dv8tion.jda.core.audio.factory.IAudioSendFactory IAudioSendFactory} to be used
* when creating new {@link net.dv8tion.jda.core.audio.factory.IAudioSendSystem} objects.
*
* @return The {@link net.dv8tion.jda.bot.sharding.DefaultShardManagerBuilder DefaultShardManagerBuilder} instance. Useful for chaining.
*/
public DefaultShardManagerBuilder setAudioSendFactory(final IAudioSendFactory factory)
{
this.audioSendFactory = factory;
return this;
}
示例6: setAudioSendFactory
import net.dv8tion.jda.core.audio.factory.IAudioSendFactory; //導入依賴的package包/類
/**
* Changes the factory used to create {@link net.dv8tion.jda.core.audio.factory.IAudioSendSystem IAudioSendSystem}
* objects which handle the sending loop for audio packets.
* <br>By default, JDA uses {@link net.dv8tion.jda.core.audio.factory.DefaultSendFactory DefaultSendFactory}.
*
* @param factory
* The new {@link net.dv8tion.jda.core.audio.factory.IAudioSendFactory IAudioSendFactory} to be used
* when creating new {@link net.dv8tion.jda.core.audio.factory.IAudioSendSystem} objects.
*
* @return The JDABuilder instance. Useful for chaining.
*/
public JDABuilder setAudioSendFactory(IAudioSendFactory factory)
{
this.audioSendFactory = factory;
return this;
}