Exemplo n.º 1
0
 public WAV ToWave()
 {
     Int16[][] Channels = new short[Info.StreamInfo.NrChannels][];
     for (int i = 0; i < Info.StreamInfo.NrChannels; i++)
     {
         Channels[i] = GetChannelData(i);
     }
     return(new CommonFiles.WAV(SNDUtil.InterleaveChannels(Channels), Info.StreamInfo.SampleRate, 16, Info.StreamInfo.NrChannels));
 }
Exemplo n.º 2
0
 public void SetWavFile(WAV Wave)
 {
     if (Wave.Wave.FMT.NrChannel > 2)
     {
         byte[] left  = Wave.GetChannelData(0);
         byte[] right = Wave.GetChannelData(1);
         WAV    wav2  = new WAV(SNDUtil.InterleaveChannels(IOUtil.ReadS16sLE(left, 0, left.Length / 2), IOUtil.ReadS16sLE(right, 0, right.Length / 2)), Wave.Wave.FMT.SampleRate, 16, 2);
         Stream = new WaveFileReader(new MemoryStream(wav2.Write()));
     }
     else
     {
         Stream = new WaveFileReader(new MemoryStream(Wave.Write()));
     }
     Output.Init(Stream);
     trackBar1.Maximum = (int)Math.Ceiling(Stream.TotalTime.TotalSeconds);
 }