c# 语句录音 我现在要让一个人说一句话然后他说完我要得到他说的话的WAVE文件这个问题怎么做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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 TabControl的tabpage切换问题 关于C#中 get 和 set 的简单用法,大家看看 .net调用delphi的dll 的问题 C#中Tchart用复选框显示指定的fastline 子窗体问题更改父窗体 .NET Framework\C#\ASP.NET三者之间的关系. c#窗体应用程序可以编译成dll文件并嵌入ie吗? Flash在一个全新的环境中无法播放,需要安装什么插件(谢绝灌水)? 求此正则表达式 请问三层结构中的数据层如何实现? 排列算法问题 还是关于串口编程
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;
}
给你提供了个好的源文件,自己下载参考一下吧