void LoadCustomMidis() { string[] paths = System.IO.Directory.GetFiles(UnityEngine.Application.persistentDataPath, "*.mid"); if (paths.Length == 0) { return; } foreach (string path in paths) { var fileName = System.IO.Path.GetFileName(path); var midiProto = new Protos.Api.MidiProto { _id = path, name = fileName, sourceSongName = "Unknown".Translate(), sourceAlbumName = "Local Midis".Translate(), }; midiProtoList.Add(midiProto); } }
public static byte[] ReadMidiBytes(Protos.Api.MidiProto midi) { return(System.IO.File.Exists(midi._id) ? System.IO.File.ReadAllBytes(midi._id) : System.IO.File.ReadAllBytes(System.IO.Path.Combine(WebCache.instance.rootPath, midi.hash))); }