com.sedmelluq.discord.lavaplayer.source.twitch.TwitchStreamAudioSourceManager Java Examples
The following examples show how to use
com.sedmelluq.discord.lavaplayer.source.twitch.TwitchStreamAudioSourceManager.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AudioUtils.java From SkyBot with GNU Affero General Public License v3.0 | 6 votes |
public AudioUtils(DunctebotConfig.Apis config, Variables variables) { this.variables = variables; musicManagers = MapUtils.newLongObjectMap(); playerManager = new UserContextAudioPlayerManager(); //playerManager.enableGcMonitoring(); final YoutubeAudioSourceManagerOverride youtubeAudioSourceManager = new YoutubeAudioSourceManagerOverride( variables.getYoutubeCache(), config.googl ); playerManager.registerSourceManager(new SpotifyAudioSourceManager(youtubeAudioSourceManager, config)); playerManager.registerSourceManager(youtubeAudioSourceManager); setCustomSourcesOn(playerManager, false); setCustomSourcesOn(LavalinkUtil.getPlayerManager(), true); playerManager.registerSourceManager(SoundCloudAudioSourceManager.createDefault()); playerManager.registerSourceManager(new BandcampAudioSourceManager()); playerManager.registerSourceManager(new VimeoAudioSourceManager()); playerManager.registerSourceManager(new TwitchStreamAudioSourceManager()); playerManager.registerSourceManager(new BeamAudioSourceManager()); playerManager.registerSourceManager(new HttpAudioSourceManager()); }
Example #2
Source File: JbAudioPlayerManagerImpl.java From JuniperBot with GNU General Public License v3.0 | 6 votes |
@PostConstruct public void init() { WorkerProperties.Audio configuration = workerProperties.getAudio(); getConfiguration().setResamplingQuality(AudioConfiguration.ResamplingQuality .valueOf(configuration.getResamplingQuality())); setFrameBufferDuration(configuration.getFrameBufferDuration()); setItemLoaderThreadPoolSize(configuration.getItemLoaderThreadPoolSize()); registerSourceManager(new YoutubeAudioSourceManager(true)); registerSourceManager(new SoundCloudAudioSourceManager()); registerSourceManager(new BandcampAudioSourceManager()); registerSourceManager(new VimeoAudioSourceManager()); registerSourceManager(new TwitchStreamAudioSourceManager()); registerSourceManager(new BeamAudioSourceManager()); if (CollectionUtils.isNotEmpty(audioSourceManagers)) { audioSourceManagers.forEach(this::registerSourceManager); } }
Example #3
Source File: BotApplicationManager.java From lavaplayer with Apache License 2.0 | 6 votes |
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(SoundCloudAudioSourceManager.createDefault()); 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")); }
Example #4
Source File: AudioSourceManagers.java From lavaplayer with Apache License 2.0 | 5 votes |
/** * 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 * @param containerRegistry Media container registry to be used by any probing sources. */ public static void registerRemoteSources(AudioPlayerManager playerManager, MediaContainerRegistry containerRegistry) { playerManager.registerSourceManager(new YoutubeAudioSourceManager(true)); playerManager.registerSourceManager(SoundCloudAudioSourceManager.createDefault()); playerManager.registerSourceManager(new BandcampAudioSourceManager()); playerManager.registerSourceManager(new VimeoAudioSourceManager()); playerManager.registerSourceManager(new TwitchStreamAudioSourceManager()); playerManager.registerSourceManager(new BeamAudioSourceManager()); playerManager.registerSourceManager(new GetyarnAudioSourceManager()); playerManager.registerSourceManager(new HttpAudioSourceManager(containerRegistry)); }
Example #5
Source File: PlayerControl.java From Yui with Apache License 2.0 | 5 votes |
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>(); }
Example #6
Source File: LocalPlayerWrapper.java From kyoko with MIT License | 4 votes |
private boolean canChangeSpeed(AudioTrack track) { if (track == null) return false; if (track.getSourceManager() instanceof YoutubeAudioSourceManager && track.getDuration() == Long.MAX_VALUE) return false; return !(track.getSourceManager() instanceof TwitchStreamAudioSourceManager); }
Example #7
Source File: MantaroAudioManager.java From MantaroBot with GNU General Public License v3.0 | 4 votes |
@SuppressWarnings("rawtypes") public MantaroAudioManager() { this.musicManagers = new ConcurrentHashMap<>(); this.playerManager = new DefaultAudioPlayerManager(); //Youtube is special because rotation stuff. YoutubeAudioSourceManager youtubeAudioSourceManager = new YoutubeAudioSourceManager(true); //IPv6 rotation config start Config config = MantaroData.config().get(); if (!config.getIpv6Block().isEmpty()) { AbstractRoutePlanner planner; String block = config.getIpv6Block(); List<IpBlock> blocks = Collections.singletonList(new Ipv6Block(block)); //Damn you, YouTube. if (config.getExcludeAddress().isEmpty()) planner = new RotatingNanoIpRoutePlanner(blocks); else { try { InetAddress blacklistedGW = InetAddress.getByName(config.getExcludeAddress()); planner = new RotatingNanoIpRoutePlanner(blocks, inetAddress -> !inetAddress.equals(blacklistedGW)); } catch (Exception e) { //Fallback: did I screw up putting the IP in? lmao planner = new RotatingNanoIpRoutePlanner(blocks); e.printStackTrace(); } } new YoutubeIpRotatorSetup(planner) .forSource(youtubeAudioSourceManager) .setup(); } //IPv6 rotation config end //Register source manager and configure the Player playerManager.registerSourceManager(youtubeAudioSourceManager); playerManager.registerSourceManager(SoundCloudAudioSourceManager.createDefault()); playerManager.registerSourceManager(new BandcampAudioSourceManager()); playerManager.registerSourceManager(new VimeoAudioSourceManager()); playerManager.registerSourceManager(new TwitchStreamAudioSourceManager()); playerManager.registerSourceManager(new BeamAudioSourceManager()); if (!ExtraRuntimeOptions.DISABLE_NON_ALLOCATING_BUFFER) { log.info("Enabled non-allocating audio buffer."); playerManager.getConfiguration().setFrameBufferFactory(NonAllocatingAudioFrameBuffer::new); } }