test try 3

This commit is contained in:
Master Kwoth 2017-07-07 10:30:19 +02:00
parent a0a6de855d
commit 9196c1e368
2 changed files with 14 additions and 2 deletions

View File

@ -204,9 +204,17 @@ namespace NadekoBot.Services.Music
&& (MaxPlaytimeSeconds <= 0 || MaxPlaytimeSeconds >= CurrentTime.TotalSeconds))
{
AdjustVolume(buffer, Volume);
//await pcm.WriteAsync(buffer, 0, bytesRead, cancelToken).ConfigureAwait(false);
if (VoiceChannel.GuildId == 117523346618318850)
await pcm.WriteAsync(buffer, 0, bytesRead, cancelToken).ConfigureAwait(false);
else
{
for (int i = 0; i < 38400; i++)
{
//kek
}
await Task.Delay(20);
}
unchecked { _bytesSent += bytesRead; }
await Task.Delay(20);
await (pauseTaskSource?.Task ?? Task.CompletedTask);
}

View File

@ -15,6 +15,7 @@ using System.Text.RegularExpressions;
using System.Net.Http;
using NadekoBot.Services.Impl;
using System.Globalization;
using System.Threading;
namespace NadekoBot.Services.Music
{
@ -53,6 +54,8 @@ namespace NadekoBot.Services.Music
_defaultVolumes = new ConcurrentDictionary<ulong, float>(gcs.ToDictionary(x => x.GuildId, x => x.DefaultMusicVolume));
Directory.CreateDirectory(MusicDataPath);
_t = new Timer(_ => _log.Info(MusicPlayers.Count(x => x.Value.Current.Current != null)), null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5));
}
public float GetDefaultVolume(ulong guildId)
@ -407,6 +410,7 @@ namespace NadekoBot.Services.Music
private readonly Regex asxRegex = new Regex("<ref href=\"(?<url>.*?)\"", RegexOptions.Compiled);
private readonly Regex xspfRegex = new Regex("<location>(?<url>.*?)</location>", RegexOptions.Compiled);
private readonly YouTube _yt;
private readonly Timer _t;
private async Task<string> HandleStreamContainers(string query)
{