~h for help too, more work on yotube playlist queue, music debugging

This commit is contained in:
Master Kwoth
2016-02-03 10:55:14 +01:00
parent 6f53bfcf16
commit aa961bbe65
5 changed files with 17 additions and 6 deletions

View File

@@ -61,8 +61,12 @@ namespace NadekoBot.Classes.Music {
}
try {
if (VoiceClient == null)
if (VoiceClient == null) {
Console.WriteLine($"Joining voice channel [{DateTime.Now.Second}]");
//todo add a new event, to tell people nadeko is trying to join
VoiceClient = await NadekoBot.client.Audio().Join(VoiceChannel);
Console.WriteLine($"Joined voicechannel [{DateTime.Now.Second}]");
}
await CurrentSong.Start();
} catch (Exception ex) {
Console.WriteLine($"Starting failed: {ex}");

View File

@@ -156,6 +156,7 @@ namespace NadekoBot.Classes.Music {
Arguments = $"-i {Url} -f s16le -ar 48000 -ac 2 pipe:1",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = false,
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden,
});
@@ -165,7 +166,7 @@ namespace NadekoBot.Classes.Music {
//wait for the read pos to catch up with write pos
while (buffer.writePos - buffer.readPos > 5.MB() && State != StreamState.Completed) {
prebufferingComplete = true;
await Task.Delay(500);
await Task.Delay(200);
}
if (State == StreamState.Completed) {
@@ -258,7 +259,7 @@ namespace NadekoBot.Classes.Music {
if (readCount == 0) {
if (attempt == 2) {
Console.WriteLine($"Failed to read {attempt} times. Stopping playback.");
Console.WriteLine($"Failed to read {attempt} times. Breaking out. [{DateTime.Now.Second}]");
break;
} else {
++attempt;
@@ -287,7 +288,7 @@ namespace NadekoBot.Classes.Music {
}
internal void Stop() {
Console.WriteLine("Stopping playback");
Console.WriteLine($"Stopping playback [{DateTime.Now.Second}]");
if (State != StreamState.Completed) {
State = StreamState.Completed;
parent.OnCompleted();