public static byte[] MakePCMDataBlockType2(byte dataType, clsPcmDatSeq pds, byte[] data) { List <byte> desDat = new List <byte>(); desDat.Add(0x67); //Data block command desDat.Add(0x66); //compatibility command desDat.Add(dataType); //data type int length = pds.SrcLength == -1 ? data.Length : pds.SrcLength; if (data.Length < pds.SrcStartAdr + length) { length = data.Length - pds.SrcStartAdr; } byte[] dmy = new byte[length]; Array.Copy(data, pds.SrcStartAdr, dmy, 0, length); Common.Add32bits(desDat, (uint)(length + 2) | (pds.chipNumber != 0 ? 0x8000_0000 : 0x0000_0000)); //size of data, in bytes Common.Add16bits(desDat, (uint)pds.DesStartAdr); //start address of data desDat.AddRange(dmy); pds.DatStartAdr = pds.DesStartAdr; pds.DatEndAdr = pds.DatStartAdr + length - 1; return(desDat.ToArray()); }
public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option) { if (!isRaw) { //Rawファイルは何もしない //Wavファイルはエンコ buf = Encode(buf, false); } pcmDataDirect.Add(Common.MakePCMDataBlockType2(dataType, pds, buf)); }
public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option) { if (!isRaw) { //Rawファイルは何もしない //Wavファイルはエンコ EncAdpcmA ea = new EncAdpcmA(); buf = ea.YM_ADPCM_B_Encode(buf, is16bit, true); } pcmDataDirect.Add(Common.MakePCMDataBlock((byte)dataType, pds, buf)); }
public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option) { bool isCPCM = false; //Optionをチェック が0以外の場合、bufに対し13bitCompPCM向け圧縮処理を行う if (pds.Option != null && pds.Option.Length > 0) { isCPCM = pds.Option[0].ToString() != "0"; } List <byte> dBuf = new List <byte>(); if (isRaw) { //Rawファイル //圧縮指定がある時 圧縮処理を実施 //それ以外は そのまま if (isCPCM) { EncC140CompressedPCM(dBuf, buf, true, true); } else { dBuf.AddRange(buf); } } else { //Wavファイル //16bitWavの時 圧縮処理を実施 //それ以外は8bitLiner処理を実施 if (is16bit) { EncC140CompressedPCM(dBuf, buf, true, true); } else { EncC140LinerSigned8bitPCM(dBuf, buf, false, false); } } buf = dBuf.ToArray(); pcmDataDirect.Add(Common.MakePCMDataBlock(dataType, pds, buf)); }
public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option) { if (!isRaw) { //Rawファイルは何もしない //Wavファイルはエンコ EncAdpcmA ea = new EncAdpcmA(); buf = pds.DatLoopAdr == 0 ? ea.YM_ADPCM_A_Encode(buf, is16bit) : ea.YM_ADPCM_B_Encode(buf, is16bit, true); } if (pds.DatLoopAdr == 0) { pcmDataDirectA.Add(Common.MakePCMDataBlock(dataType, pds, buf)); } else { pcmDataDirectB.Add(Common.MakePCMDataBlock((byte)(dataType + 1), pds, buf)); } }
public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option) { throw new NotImplementedException(); }
public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option) { msgBox.setWrnMsg(msg.get("E12007"), new LinePos(null, "-")); }
public virtual void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option) { throw new NotImplementedException("継承先で要実装"); }
public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option) { }