当前位置:编程学习 > C#/ASP.NET >>

c# 语句录音

我现在要让一个人说一句话
然后他说完我要得到他说的话的WAVE文件
这个问题怎么做? --------------------编程问答-------------------- http://www.codeproject.com/KB/cs/PWR.aspx --------------------编程问答-------------------- 录音的核心代码:


    try
    {
        Stream sw = _cRecorder.CreateStream(_cStreamMemory, _cWaveFormat);
        byte[] bf = new byte[sw.Length - sw.Position];
        sw.Read(bf, 0, bf.Length);
        sw.Dispose();
        FileStream fs = new FileStream(sfdSave.FileName, 
                            create ? FileMode.Create : FileMode.Append);
        fs.Write(bf, 0, bf.Length);
        fs.Close();
        fs.Dispose();
        mnuItemSave.Enabled = true;
        return true;
    }
    catch
    {
        ErrorPrompt("Bad File Name", "Could Not Save File!", 
                    "The Recording could not be saved.");
        return false;
    }




给你提供了个好的源文件,自己下载参考一下吧 --------------------编程问答-------------------- http://www.codeproject.com/KB/audio-video/igotmessage.aspxhttp://www.codeproject.com/KB/audio-video/cswavrec.aspx?print=true

--------------------编程问答-------------------- --------------------编程问答-------------------- 谢谢你们的指点。
但是我要的不是单纯的录音。
说话人一停止说话。
系统就自动停止录音。
这个应该要根据声波判断的吧?
--------------------编程问答-------------------- --------------------编程问答--------------------
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,