Exemplo n.º 1
0
        private static void Vox2Wav(string voxFile, string wavFile, int samplesPerSec)
        {
            BinaryReader br     = new BinaryReader(File.OpenRead(voxFile));
            IntPtr       format = AudioCompressionManager.GetPcmFormat(1, 16, samplesPerSec);
            WaveWriter   ww     = new WaveWriter(File.Create(wavFile), AudioCompressionManager.FormatBytes(format));

            Vox.Vox2Wav(br, ww);
            br.Close();
            ww.Close();
        }
Exemplo n.º 2
0
        private static IAudioReader GetVoxReader(string fileName, int sampleRate)
        {
            BinaryReader br     = new BinaryReader(File.OpenRead(fileName));
            MemoryStream ms     = new MemoryStream();
            IntPtr       format = AudioCompressionManager.GetPcmFormat(1, 16, sampleRate);
            WaveWriter   ww     = new WaveWriter(ms, AudioCompressionManager.FormatBytes(format));

            Vox.Vox2Wav(br, ww);
            br.Close();
            return(new WaveReader(ms));
        }