• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AudioPlayerManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public static void main(String[] args) throws LineUnavailableException, IOException {
  AudioPlayerManager manager = new DefaultAudioPlayerManager();
  AudioSourceManagers.registerRemoteSources(manager);
  manager.getConfiguration().setOutputFormat(new AudioDataFormat(2, 44100, 960, AudioDataFormat.Codec.PCM_S16_BE));

  AudioPlayer player = manager.createPlayer();

  manager.loadItem("ytsearch: epic soundtracks", new FunctionalResultHandler(null, playlist -> {
    player.playTrack(playlist.getTracks().get(0));
  }, null, null));

  AudioDataFormat format = manager.getConfiguration().getOutputFormat();
  AudioInputStream stream = AudioPlayerInputStream.createStream(player, format, 10000L, false);
  SourceDataLine.Info info = new DataLine.Info(SourceDataLine.class, stream.getFormat());
  SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);

  line.open(stream.getFormat());
  line.start();

  byte[] buffer = new byte[format.bufferSize(2)];
  int chunkSize;

  while ((chunkSize = stream.read(buffer)) >= 0) {
    line.write(buffer, 0, chunkSize);
  }
}
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:27,代码来源:LocalPlayerDemo.java


示例2: initAudioPlayerManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的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


示例3: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
/**
 * Creates a player and a track scheduler.
 * @param manager Audio player manager to use for creating the player.
 */
public GuildMusicManager(AudioPlayerManager manager)
{
    player = manager.createPlayer();
    scheduler = new TrackScheduler(player);
    sendHandler = new AudioPlayerSendHandler(player);
    player.addListener(scheduler);
}
 
开发者ID:ExidCuter,项目名称:JDodoBot,代码行数:12,代码来源:GuildMusicManager.java


示例4: GuildMusic

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public GuildMusic(IGuild guild, AudioPlayerManager audioPlayerManager) {
	this.guild = guild;
	this.audioPlayer = audioPlayerManager.createPlayer();
	this.audioProvider = new AudioProvider(audioPlayer);
	this.trackScheduler = new TrackScheduler(audioPlayer, Database.getDBGuild(guild).getDefaultVol());
	this.audioPlayer.addListener(new AudioEventListener(this));
}
 
开发者ID:Shadorc,项目名称:Shadbot,代码行数:8,代码来源:GuildMusic.java


示例5: registerRemoteSources

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的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


示例6: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
/**
 * Creates a player and a track scheduler.
 * @param manager Audio player manager to use for creating the player.
 */
public GuildMusicManager(AudioPlayerManager manager, CommandContext context, boolean meme) {
    player = manager.createPlayer();
    scheduler = new TrackScheduler(player, context);
    memeScheduler = new MemeScheduler(player, context.getGuild());
    channel = context.getTextChannel();
    this.meme = meme;
    if (meme) {
        player.addListener(memeScheduler);
    } else {
        player.addListener(scheduler);
    }
}
 
开发者ID:Godson777,项目名称:KekBot,代码行数:17,代码来源:GuildMusicManager.java


示例7: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public GuildMusicManager(AudioPlayerManager manager, String guildId) {
	this.audioPlayer = manager.createPlayer();
	this.trackManager = new GuildTrackManager(audioPlayer, guildId);
	this.audioPlayer.addListener(trackManager);
	this.skipVoters = new HashSet<String>();
	this.audioProvider = new AudioProvider(this.audioPlayer);
}
 
开发者ID:paul-io,项目名称:momo-discord-old,代码行数:8,代码来源:GuildMusicManager.java


示例8: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public GuildMusicManager(AudioPlayerManager manager) {
    player = manager.createPlayer();
    scheduler = new TrackScheduler(player);
    sendHandler = new AudioPlayerSendHandler(player);
    player.addListener(scheduler);
}
 
开发者ID:Rubicon-Bot,项目名称:Rubicon,代码行数:7,代码来源:GuildMusicManager.java


示例9: getManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public AudioPlayerManager getManager() {
	return manager;
}
 
开发者ID:JessWalters,项目名称:Vinny-Redux,代码行数:4,代码来源:Bot.java


示例10: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
/**
 * Creates a player and a track scheduler.
 * @param manager Audio player manager to use for creating the player.
 */
public GuildMusicManager(AudioPlayerManager manager) {
  player = manager.createPlayer();
  scheduler = new TrackScheduler(player);
  player.addListener(scheduler);
}
 
开发者ID:elgoupil,项目名称:GoupilBot,代码行数:10,代码来源:GuildMusicManager.java


示例11: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
/**
 * Creates a player and a track scheduler.
 * @param manager Audio player manager to use for creating the player.
 * @param guild The Guild this Music Manager is linked to.
 */
public GuildMusicManager(AudioPlayerManager manager, Guild guild) {
    player = manager.createPlayer();
    scheduler = new TrackScheduler(player, guild);
    player.addListener(scheduler);
}
 
开发者ID:greatman,项目名称:legendarybot,代码行数:11,代码来源:GuildMusicManager.java


示例12: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public GuildMusicManager(AudioPlayerManager manager) {
    player = manager.createPlayer();
    scheduler = new TrackScheduler(this, player);
    player.addListener(scheduler);
}
 
开发者ID:avaire,项目名称:avaire,代码行数:6,代码来源:GuildMusicManager.java


示例13: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public GuildMusicManager(AudioPlayerManager manager, String guildId) {
	this.audioPlayer = manager.createPlayer();
	this.trackManager = new GuildTrackManager(audioPlayer, guildId);
	this.audioPlayer.addListener(trackManager);
	this.skipVoters = new HashSet<String>();
}
 
开发者ID:paul-io,项目名称:momo-2,代码行数:7,代码来源:GuildMusicManager.java


示例14: getMasterManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public static AudioPlayerManager getMasterManager() {
	return playerManager;
}
 
开发者ID:paul-io,项目名称:momo-2,代码行数:4,代码来源:AudioManager.java


示例15: getAudioPlayerManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public AudioPlayerManager getAudioPlayerManager() {
	return audioPlayerManager;
}
 
开发者ID:LXGaming,项目名称:DiscordBot,代码行数:4,代码来源:Discord.java


示例16: getAudioManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public AudioPlayerManager getAudioManager()
{
    return manager;
}
 
开发者ID:jagrosh,项目名称:MusicBot,代码行数:5,代码来源:Bot.java


示例17: createLocalExecutor

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
@Override
public AudioTrackExecutor createLocalExecutor(AudioPlayerManager playerManager) {
  return null;
}
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:5,代码来源:BaseAudioTrack.java


示例18: getPlayerManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public AudioPlayerManager getPlayerManager() {
  return playerManager;
}
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:4,代码来源:BotApplicationManager.java


示例19: getPm

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
public AudioPlayerManager getPm() {
    return pm;
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:4,代码来源:KarrenBot.java


示例20: GuildMusicManager

import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; //导入依赖的package包/类
/**
 * Creates a player and a track scheduler.
 * @param manager Audio player manager to use for creating the player.
 */
public GuildMusicManager(AudioPlayerManager manager, IGuild guild) {
  player = manager.createPlayer();
  scheduler = new TrackScheduler(player, guild);
  player.addListener(scheduler);
}
 
开发者ID:ripxfrostbite,项目名称:karren-sama,代码行数:10,代码来源:GuildMusicManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ARBVertexBufferObject类代码示例发布时间:2022-05-21
下一篇:
Java Movie类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap