static int Main(string[] args) { if (args.Length == 0) { Console.Error.WriteLine("No input music file specified"); return(-1); } var opl = new WoodyEmulatorOpl(OplType.Opl3); opl.Init(Rate); var players = Factory.GetPlayers(opl); foreach (var player in players) { if (!player.Load(args[0])) { continue; } var alPlayer = new AlPlayer(player, Rate); alPlayer.Play(); Console.WriteLine("Hit a key to stop!"); Console.Read(); return(0); } Console.Error.WriteLine("This music file is not supported"); return(-1); }
public override void _Ready() { IOpl imfOpl = new WoodyEmulatorOpl(OplType.Opl2); AddChild(ImfOplPlayer = new OplPlayer() { Opl = imfOpl, MusicPlayer = new ImfPlayer() { Opl = imfOpl, }, }); IOpl idAdlOpl = new WoodyEmulatorOpl(OplType.Opl2); AddChild(IdAdlOplPlayer = new OplPlayer() { Opl = idAdlOpl, MusicPlayer = new IdAdlPlayer() { Opl = idAdlOpl, }, }); string imfFile = "SEARCHN_MUS.imf"; if (!System.IO.File.Exists(imfFile)) { throw new FileNotFoundException(); } else { using (FileStream imfStream = new FileStream(imfFile, FileMode.Open)) ((ImfPlayer)ImfOplPlayer.MusicPlayer).Imf = Imf.ReadImf(imfStream); } string idAdlFile = "GETAMMOSND.adl"; if (!System.IO.File.Exists(idAdlFile)) { throw new FileNotFoundException(); } else { using (FileStream idAdlStream = new FileStream(idAdlFile, FileMode.Open)) Adl = new Adl(idAdlStream); } }