Ejemplo n.º 1
0
        /// <returns>The audio sample content as wave format byte array.</returns>
        public byte[] GetBytes()
        {
            MemoryStream outStream =
                new MemoryStream(BlockAlignReductionStream.WaveFormat.AverageBytesPerSecond * 4);

            BlockAlignReductionStream.Seek(0, SeekOrigin.Begin);
            WaveFileWriter.WriteWavFileToStream(outStream, BlockAlignReductionStream);
            BlockAlignReductionStream.Seek(0, SeekOrigin.Begin);
            return(outStream.ToArray());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Writes this sample into a wave file with the specified file name.
 /// </summary>
 /// <param name="filename">The output file name.</param>
 public void WriteToWaveFile(string filename)
 {
     BlockAlignReductionStream.Seek(0, SeekOrigin.Begin);
     WaveFileWriter.CreateWaveFile(filename, BlockAlignReductionStream);
     BlockAlignReductionStream.Seek(0, SeekOrigin.Begin);
 }