private bool CreateAndSaveSoundbank(string path, string name) { // Get path to save in string fileName = Path.Combine(path, name.ToLower() + ".json"); // Generate soundbank try { FolderEntry bank = SoundbankGenerator.CreateSoundbank(path, name); // Save it string json = SoundbankSerializer.Serialize(bank); File.WriteAllText(fileName, json); } catch (Exception ex) { MessageBox.Show("Cannot create Soundbank!\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } textBoxSoundbank.Text = fileName; return(true); }
private FolderEntry LoadSoundbank() { return(SoundbankSerializer.Deserialize(File.ReadAllText(textBoxSoundbank.Text))); }