日期:2014-05-17 浏览次数:20490 次
protected void btnStart_Click(object sender, EventArgs e)
{
wave.waveInStream = new NAudio.Wave.WaveIn();
wave.writer = new NAudio.Wave.WaveFileWriter("C:/origin.wav", new NAudio.Wave.WaveFormat(16000, 16, 1));
wave.StartRecord("C:/origin.wav");
Thread.Sleep(6000);
wave.StopRecord();
}
protected void btnStop_Click(object sender, EventArgs e)
{
//todo: 跨线程进行访问
//if (wave != null)
//{
// wave.waveInStream.Dispose();
// wave.writer.Close();
//}
//wave.StopRecord();
}
static CommonCode.WavaHelper wave = new CommonCode.WavaHelper();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnStart_Click(object sender, EventArgs e)
{
wave.waveInStream = new NAudio.Wave.WaveIn();
wave.writer = new NAudio.Wave.WaveFileWriter("C:/origin.wav", new NAudio.Wave.WaveFormat(16000, 16, 1));