相关dll下载 链接
using System.IO; using System.Threading; using Alvas.Audio; using NAudio.Wave; namespace Test { internal class Program { public static void Main(string[] args) { //测试 playV3File(@"D:\1404033.v3"); } public static void playV3File(string voxFile) { //设置采样率 var samplesPerSec = 6000; var wavFile = voxFile + ".tmp"; using (var br = new BinaryReader(File.OpenRead(voxFile))) { var format = AudioCompressionManager.GetPcmFormat(1, 16, samplesPerSec); using (var ww = new WaveWriter(File.Create(wavFile), AudioCompressionManager.FormatBytes(format))) { Vox.Vox2Wav(br, ww); } } var audiodata = File.ReadAllBytes(wavFile); File.Delete(wavFile); using (var Stream = new MemoryStream(audiodata)) { using (var wavFileReader = new WaveFileReader(Stream)) { using (var outputDevice = new WaveOutEvent()) { outputDevice.Init(wavFileReader); outputDevice.Play(); while (outputDevice.PlaybackState == PlaybackState.Playing) Thread.Sleep(100); } } } } } }