Exemplo n.º 1
0
        public WaveStream(List <WaveSample> fullAudioStream)
        {
            WaveAudioFormat audioFormat = fullAudioStream?[0]?.SampleFormat;

            byte[] audioData = WaveGenerator.ToByteArray(fullAudioStream.ToArray());
            this.riff = new WaveFileFormat.RIFF_CHUNK();
            this.fmt  = new WaveFileFormat.FMT_CHUNK(audioFormat);
            this.data = new WaveFileFormat.DATA_CHUNK(audioData);
            this.riff.SetChunkSize(4 + (8 + this.fmt.GetChunkSize()) + (8 + this.data.GetChunkSize()));
        }
Exemplo n.º 2
0
 internal void Dispose(bool disposing)
 {
     if (!this._disposed)
     {
         if (disposing)
         {
             this.riff = null;  this.fmt = null; this.data = null;
         }
         // Indicate the instance has been disposed.
         this._disposed = true;
     }
 }