public GcAdpcmChannelBuilder WithLoopContext(int loopStart, short predScale, short loopHist1, short loopHist2, bool isSelfCalculated = false) { LoopContextStart = loopStart; LoopContext = new GcAdpcmContext(predScale, loopHist1, loopHist2); LoopContextIsSelfCalculated = isSelfCalculated; return(this); }
internal GcAdpcmChannel(GcAdpcmChannelBuilder b) { if (b.AlignedAdpcm.Length < GcAdpcmMath.SampleCountToByteCount(b.SampleCount)) { throw new ArgumentException("Audio array length is too short for the specified number of samples."); } UnalignedSampleCount = b.SampleCount; Adpcm = b.Adpcm; Pcm = b.Pcm; Coefs = b.Coefs; Gain = b.Gain; StartContext = new GcAdpcmContext(Adpcm[0], b.StartContext.Hist1, b.StartContext.Hist2); Alignment = b.GetAlignment(); LoopContextEx = b.GetLoopContext(); SeekTable = b.GetSeekTable(); //Grab the PCM data in case it was generated for the loop context or seek table if (!AlignmentNeeded) { Pcm = b.AlignedPcm; } }