private void OnFormClose(object sender, FormClosedEventArgs e) { try { BotTools.DumpToTextFile("RazBot 2.0 is Offline: Request Playing Disabled", "datasources\\now_playing"); } catch { } try { using (StreamWriter sw = File.AppendText(BotTools.SessionLogFile)) { sw.WriteLine($"\t--End of Session [{DateTime.Now:HH:mm:ss}]--\n"); } } catch { } try { Music.ClearRequests(); } catch { } try { NAudioTools.DeleteAllWavs(); } catch { } }
private void OnNormalizeCheckboxCheckChange(object sender, EventArgs e) { cbNormalize.BackColor = cbNormalize.Checked ? Color.FromArgb(30, 225, 255) : Color.FromArgb(34, 15, 34); cbNormalize.ForeColor = cbNormalize.Checked ? Color.FromArgb(14, 0, 20) : Color.FromArgb(255, 35, 255); cbNormalize.BackgroundImage.Dispose(); cbNormalize.BackgroundImage = cbNormalize.Checked ? Properties.Resources.normalize_black_noborder : Properties.Resources.normalize_noborder; if (cbNormalize.Checked) { bgwAudioNormalizer.RunWorkerAsync(); } else { NAudioTools.DeleteAllWavs(); } }
private void NormalizeDownloadedAudio(object sender, DoWorkEventArgs e) { normalizingAudio = true; string songID = Music.DownloadedSong.ID; string playlistName = Music.DownloadedSong.IsRequest ? "request" : Music.LoadedPlaylist; NAudioTools.Mp4ToWav($"playlists\\{playlistName}\\{songID}"); NAudioTools.Normalize($"playlists\\{playlistName}\\{songID}"); File.Delete($"{BotTools.BasePath}\\playlists\\{playlistName}\\{songID}.wav"); if (unloadPath != null) { File.Delete(unloadPath); unloadPath = null; } normalizingAudio = false; BotTools.LogLine($"Normalized {Music.DownloadedSong.Title}"); }
private void DeleteAllMusicFiles() { NAudioTools.DeleteAllMp4s(); NAudioTools.DeleteAllWavs(); }