public static void initial(byte[] mucompcmbin, enmFormat format) { uint samplingBuffer = 1024; MDSound.MDSound.Chip[] chips = new MDSound.MDSound.Chip[1]; MDSound.MDSound.Chip chip = null; chip = new MDSound.MDSound.Chip(); chip.type = MDSound.MDSound.enmInstrumentType.YM2608; chip.ID = 0; MDSound.ym2608 ym2608 = new MDSound.ym2608(); chip.Instrument = ym2608; chip.Update = ym2608.Update; chip.Start = ym2608.Start; chip.Stop = ym2608.Stop; chip.Reset = ym2608.Reset; chip.SamplingRate = format == enmFormat.VGM ? vgmSamplingRate : xgmSamplingRate; chip.Clock = 7987200; chip.Volume = 0; chip.Option = null; chips[0] = chip; mds = new MDSound.MDSound(format == enmFormat.VGM ? vgmSamplingRate : xgmSamplingRate, samplingBuffer, chips); mds.WriteYM2608(0, 0, 0x2d, 0x00); mds.WriteYM2608(0, 0, 0x29, 0x82); mds.WriteYM2608(0, 0, 0x07, 0x38); byte[] adpcmBuffer = mds.GetADPCMBufferYM2608(0); lstMucomPCMInfo = setPCMData(mucompcmbin, adpcmBuffer); }
private void SetFormat(string val) { switch (val.ToUpper()) { case "VGM": default: format = enmFormat.VGM; tempo = DEFAULT_TEMPO; clockCount = DEFAULT_CLOCK_COUNT; samplesPerClock = DEFAULT_SAMPLES_PER_CLOCK; break; case "XGM": format = enmFormat.XGM; tempo = DEFAULT_TEMPO; clockCount = XGM_DEFAULT_CLOCK_COUNT; samplesPerClock = XGM_DEFAULT_SAMPLES_PER_CLOCK; //samplesPerClock = xgmSamplesPerSecond * 60.0 * 4.0 / (tempo * clockCount); break; case "ZGM": format = enmFormat.ZGM; tempo = DEFAULT_TEMPO; clockCount = DEFAULT_CLOCK_COUNT; samplesPerClock = DEFAULT_SAMPLES_PER_CLOCK; break; } }
private void SetFormat(string val) { switch (val.ToUpper()) { case "VGM": default: format = enmFormat.VGM; tempo = DEFAULT_TEMPO; //clockCount = DEFAULT_CLOCK_COUNT; //samplesPerClock = DEFAULT_SAMPLES_PER_CLOCK; break; } }