当前位置: 首页>>代码示例>>Java>>正文


Java YoutubeAudioSourceManager类代码示例

本文整理汇总了Java中com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager的典型用法代码示例。如果您正苦于以下问题:Java YoutubeAudioSourceManager类的具体用法?Java YoutubeAudioSourceManager怎么用?Java YoutubeAudioSourceManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


YoutubeAudioSourceManager类属于com.sedmelluq.discord.lavaplayer.source.youtube包,在下文中一共展示了YoutubeAudioSourceManager类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BotApplicationManager

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
public BotApplicationManager() {
  guildContexts = new HashMap<>();
  controllerManager = new BotControllerManager();

  controllerManager.registerController(new MusicController.Factory());

  playerManager = new DefaultAudioPlayerManager();
  //playerManager.useRemoteNodes("localhost:8080");
  playerManager.getConfiguration().setResamplingQuality(AudioConfiguration.ResamplingQuality.LOW);
  playerManager.registerSourceManager(new YoutubeAudioSourceManager());
  playerManager.registerSourceManager(new SoundCloudAudioSourceManager());
  playerManager.registerSourceManager(new BandcampAudioSourceManager());
  playerManager.registerSourceManager(new VimeoAudioSourceManager());
  playerManager.registerSourceManager(new TwitchStreamAudioSourceManager());
  playerManager.registerSourceManager(new BeamAudioSourceManager());
  playerManager.registerSourceManager(new HttpAudioSourceManager());
  playerManager.registerSourceManager(new LocalAudioSourceManager());

  executorService = Executors.newScheduledThreadPool(1, new DaemonThreadFactory("bot"));
}
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:21,代码来源:BotApplicationManager.java

示例2: main

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
public static void main(final String[] args) throws Exception {
    Thread.currentThread().setName("JukeBot-Main");

    ConfigurationFactory.setConfigurationFactory(new Log4JConfig());
    LOG = LogManager.getLogger("JukeBot");

    playerManager = new DefaultAudioPlayerManager();
    defaultPrefix = Database.getPropertyFromConfig("prefix");

    String colour = Database.getPropertyFromConfig("color");
    if (colour.equalsIgnoreCase("")) {
        LOG.error("Missing property 'color' in the database.");
        return;
    }

    embedColour = Color.decode(colour);

    playerManager.setPlayerCleanupThreshold(30000);
    playerManager.getConfiguration().setResamplingQuality(AudioConfiguration.ResamplingQuality.LOW);
    playerManager.getConfiguration().setOpusEncodingQuality(9);
    YoutubeAudioSourceManager yt = new YoutubeAudioSourceManager();
    yt.setPlaylistPageCount(Integer.MAX_VALUE);
    playerManager.registerSourceManager(yt);
    AudioSourceManagers.registerRemoteSources(playerManager);

    printBanner();

    shardManager = new DefaultShardManagerBuilder()
            .setToken(Database.getPropertyFromConfig("token"))
            .setShardsTotal(-1)
            .addEventListeners(new EventListener(), waiter)
            .setAudioSendFactory(new NativeAudioSendFactory())
            .setGame(Game.of(Game.GameType.LISTENING, defaultPrefix + "help | jukebot.xyz"))
            .build();
}
 
开发者ID:Devoxin,项目名称:JukeBot,代码行数:36,代码来源:JukeBot.java

示例3: MusicManager

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
public MusicManager(CommandManager.ParsedCommandInvocation parsedCommandInvocation) {
    this.parsedCommandInvocation = parsedCommandInvocation;
    this.guild = parsedCommandInvocation.getGuild();
    this.args = parsedCommandInvocation.getArgs();
    this.userMusicSQL = new UserMusicSQL(parsedCommandInvocation.getAuthor());
    this.guildMusicSQL = new GuildMusicSQL(guild);
    this.userPermissions = new fun.rubicon.permission.UserPermissions(parsedCommandInvocation.getAuthor().getIdLong(), parsedCommandInvocation.getGuild().getIdLong());

    playerManager = new DefaultAudioPlayerManager();
    playerManager.registerSourceManager(new YoutubeAudioSourceManager());
    playerManager.registerSourceManager(new HttpAudioSourceManager());
    //playerManager.registerSourceManager(new SoundCloudAudioSourceManager()); //TODO Soundcloud support?
}
 
开发者ID:Rubicon-Bot,项目名称:Rubicon,代码行数:14,代码来源:MusicManager.java

示例4: initAudioPlayerManager

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
private static AudioPlayerManager initAudioPlayerManager() {
    AudioPlayerManager apm = new DefaultAudioPlayerManager();

    apm.registerSourceManager(new YoutubeAudioSourceManager());
    apm.registerSourceManager(new TwitchStreamAudioSourceManager());
    apm.registerSourceManager(new BeamAudioSourceManager());
    apm.registerSourceManager(new HttpAudioSourceManager());

    return apm;
}
 
开发者ID:Frederikam,项目名称:GensokyoBot,代码行数:11,代码来源:GuildPlayer.java

示例5: PlayerControl

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
public PlayerControl()
{
    java.util.logging.Logger.getLogger("org.apache.http.client.protocol.ResponseProcessCookies").setLevel(Level.OFF);

    this.playerManager = new DefaultAudioPlayerManager();
    playerManager.registerSourceManager(new YoutubeAudioSourceManager());
    playerManager.registerSourceManager(new SoundCloudAudioSourceManager());
    playerManager.registerSourceManager(new BandcampAudioSourceManager());
    playerManager.registerSourceManager(new VimeoAudioSourceManager());
    playerManager.registerSourceManager(new TwitchStreamAudioSourceManager());
    playerManager.registerSourceManager(new HttpAudioSourceManager());
    playerManager.registerSourceManager(new LocalAudioSourceManager());

    musicManagers = new HashMap<String, GuildMusicManager>();
}
 
开发者ID:ExidCuter,项目名称:JDodoBot,代码行数:16,代码来源:PlayerControl.java

示例6: Bot

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
public Bot(EventWaiter waiter, Config config)
{
    this.config = config;
    this.waiter = waiter;
    this.settings = new HashMap<>();
    this.lastNP = new HashMap<>();
    manager = new DefaultAudioPlayerManager();
    threadpool = Executors.newSingleThreadScheduledExecutor();
    AudioSourceManagers.registerRemoteSources(manager);
    AudioSourceManagers.registerLocalSource(manager);
    manager.source(YoutubeAudioSourceManager.class).setPlaylistPageCount(10);
    try {
        JSONObject loadedSettings = new JSONObject(new String(Files.readAllBytes(Paths.get("serversettings.json"))));
        loadedSettings.keySet().forEach((id) -> {
            JSONObject o = loadedSettings.getJSONObject(id);
            
            settings.put(id, new Settings(
                    o.has("text_channel_id") ? o.getString("text_channel_id") : null,
                    o.has("voice_channel_id")? o.getString("voice_channel_id"): null,
                    o.has("dj_role_id")      ? o.getString("dj_role_id")      : null,
                    o.has("volume")          ? o.getInt("volume")             : 100,
                    o.has("default_playlist")? o.getString("default_playlist"): null,
                    o.has("repeat")          ? o.getBoolean("repeat")         : false));
        });
    } catch(IOException | JSONException e) {
        LoggerFactory.getLogger("Settings").warn("Failed to load server settings (this is normal if no settings have been set yet): "+e);
    }
}
 
开发者ID:jagrosh,项目名称:MusicBot,代码行数:29,代码来源:Bot.java

示例7: registerRemoteSources

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
/**
 * Registers all built-in remote audio sources to the specified player manager. Local file audio source must be
 * registered separately.
 *
 * @param playerManager Player manager to register the source managers to
 */
public static void registerRemoteSources(AudioPlayerManager playerManager) {
  playerManager.registerSourceManager(new YoutubeAudioSourceManager(true));
  playerManager.registerSourceManager(new SoundCloudAudioSourceManager());
  playerManager.registerSourceManager(new BandcampAudioSourceManager());
  playerManager.registerSourceManager(new VimeoAudioSourceManager());
  playerManager.registerSourceManager(new TwitchStreamAudioSourceManager());
  playerManager.registerSourceManager(new BeamAudioSourceManager());
  playerManager.registerSourceManager(new HttpAudioSourceManager());
}
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:16,代码来源:AudioSourceManagers.java

示例8: getSourceManagerClass

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
@Override
public Class<? extends AudioSourceManager> getSourceManagerClass() {
    return YoutubeAudioSourceManager.class;
}
 
开发者ID:ArsenArsen,项目名称:FlareBot,代码行数:5,代码来源:YouTubeExtractor.java

示例9: hex

import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager; //导入依赖的package包/类
@BotCommandHandler
private void hex(Message message, int pageCount) {
  manager.source(YoutubeAudioSourceManager.class).setPlaylistPageCount(pageCount);
}
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:5,代码来源:MusicController.java


注:本文中的com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。