public Sample(byte[] sampleData, int sampleNumber, int offset, int loopOffset, int aramAddress, int loopAddress) { this.SampleOffset = offset; this.LoopOffset = loopOffset; this.SampleARAMAddress = aramAddress; this.SampleLoopAddress = loopAddress; this.SampleNumber = sampleNumber; this.BRR = new BRR(sampleData, SampleOffset, LoopOffset); }
public static void ExportWAVSamples(string fullPath, int rate) { byte[][] samples = new byte[BRRSamples.Length][]; int i = 0; foreach (var brr in BRRSamples) { samples[i++] = BRR.BRRToWAV(brr.Sample, rate); } Do.Export(samples, fullPath + "\\" + LazyShell.Model.GetFileNameWithoutPath() + " - WAV Samples\\" + "wav-sample", "SAMPLE", true); }
public static bool ImportWAVSample(int index, string fullPath) { try { byte[] sample = (byte[])Do.Import(new byte[1], fullPath); BRRSamples[index].Sample = BRR.Encode(sample); } catch { MessageBox.Show("Error encoding .wav file.", "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } return(true); }
public static bool ImportWAVSamples(string fullPath) { byte[][] samples = new byte[BRRSamples.Length][]; try { Do.Import(samples, fullPath + "\\" + "sampleWAV", "WAV SAMPLE", true); } catch { MessageBox.Show("Error encoding .wav file(s).", "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } int i = 0; foreach (var sample in BRRSamples) { sample.Sample = BRR.Encode(samples[i++]); } // return(true); }
private void RefreshWAVBuffer() { wav = BRR.BRRToWAV(sample.Sample, sample.Rate); loop = BRR.BRRToWAV(sample.Sample, sample.Rate, sample.LoopStart); picture.Invalidate(); }
public static void ExportWAVSample(string fullPath, int index, int rate) { Do.Export(BRR.BRRToWAV(BRRSamples[index].Sample, rate), "wav-sample-" + index.ToString("d3") + ".wav", fullPath); }