Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 private void RefreshWAVBuffer()
 {
     wav  = BRR.BRRToWAV(sample.Sample, sample.Rate);
     loop = BRR.BRRToWAV(sample.Sample, sample.Rate, sample.LoopStart);
     picture.Invalidate();
 }
Exemplo n.º 6
0
 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);
 }