コード例 #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();
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: svetakorn/DtWPF
        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));
        }