當前位置: 首頁>>代碼示例>>Java>>正文


Java IAudioSendFactory類代碼示例

本文整理匯總了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;
        }
    }
}
 
開發者ID:DV8FromTheWorld,項目名稱:JDA,代碼行數:25,代碼來源:AudioConnection.java

示例2: getAudioSendFactory

import net.dv8tion.jda.core.audio.factory.IAudioSendFactory; //導入依賴的package包/類
public IAudioSendFactory getAudioSendFactory()
{
    return audioSendFactory;
}
 
開發者ID:DV8FromTheWorld,項目名稱:JDA,代碼行數:5,代碼來源:JDAImpl.java

示例3: setAudioSendFactory

import net.dv8tion.jda.core.audio.factory.IAudioSendFactory; //導入依賴的package包/類
public void setAudioSendFactory(IAudioSendFactory factory)
{
    Checks.notNull(factory, "Provided IAudioSendFactory");
    this.audioSendFactory = factory;
}
 
開發者ID:DV8FromTheWorld,項目名稱:JDA,代碼行數:6,代碼來源:JDAImpl.java

示例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);
}
 
開發者ID:Shredder121,項目名稱:jda-async-packetprovider,代碼行數:10,代碼來源:AsyncPacketProviderFactory.java

示例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;
}
 
開發者ID:DV8FromTheWorld,項目名稱:JDA,代碼行數:17,代碼來源:DefaultShardManagerBuilder.java

示例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;
}
 
開發者ID:DV8FromTheWorld,項目名稱:JDA,代碼行數:17,代碼來源:JDABuilder.java


注:本文中的net.dv8tion.jda.core.audio.factory.IAudioSendFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。