高手请进,如何实现在线录音[如果你有好的方案,我也可以支付一定酬金] ?

kwklover 2005-05-17 11:32:36
需求:
用户通过登陆web站点,直接在线录音,然后可以把声音文件存储在服务器

其他:
可以用其他语言实现一个客户端插件,但不能要求客户端安装其他框架

非常感谢!
...全文
213 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
brando_beat 2005-05-18
  • 打赏
  • 举报
回复
关注~这个想法顶!
luckyprg 2005-05-18
  • 打赏
  • 举报
回复
关注一下。
游戏Lan 2005-05-18
  • 打赏
  • 举报
回复
http://www.saltforum.org/

要准备的条件:
1. 我们需要 SAPI5 (ships with XP)。
2. Microsoft Engine for english(如果没找到,就从 Microsoft 的站点上下载)。
检查有没有语音控件的最简单的办法就是进到你的控制面板 -- > 语音。在这里你可以看见,“更改文本语音和语音识别设置”的标签。如果你没有看见“语音识别”的标签,你就要从microsoft 的站点上下载它了。
http://www.microsoft.com/downloads/details.aspx?FamilyID=5e86ec97-40a7-453f-b0ee-6583171b4530&DisplayLang=en#filelist

http://www.edi-son.com/VoiceSMSFunction.htm

语音识别的class

public class ClassSpRecognition
{
private static ClassSpRecognition _Instance = null ;
private SpeechLib.ISpeechRecoGrammar isrg ;
private SpeechLib.SpSharedRecoContextClass ssrContex =null;
private System.Windows.Forms.Control cDisplay ;

public ClassSpRecognition()
{
ssrContex = new SpSharedRecoContextClass() ;
isrg = ssrContex.CreateGrammar(1) ;
SpeechLib._ISpeechRecoContextEvents_RecognitionEventHandler recHandle =
new _ISpeechRecoContextEvents_RecognitionEventHandler(ContexRecognition) ;
ssrContex.Recognition += recHandle ;
}
public void BeginRec(Control tbResult)
{
isrg.DictationSetState(SpeechRuleState.SGDSActive) ;
cDisplay = tbResult ;
}
public static ClassSpRecognition instance()
{
if (_Instance == null)
_Instance = new ClassSpRecognition() ;
return _Instance ;
}
public void CloseRec()
{
isrg.DictationSetState(SpeechRuleState.SGDSInactive) ;
}
private void ContexRecognition(int iIndex,object obj,SpeechLib.SpeechRecognitionType type,SpeechLib.ISpeechRecoResult result)
{
cDisplay.Text += result.PhraseInfo.GetText(0,-1,true) ;
}

}





发音的class

public class ClassSpeach
{
private static ClassSpeach _Instance= null ;
private SpeechLib.SpVoiceClass voice=null;

public ClassSpeach()
{
BuildSpeach() ;
}
public static ClassSpeach instance()
{
if (_Instance == null)
_Instance = new ClassSpeach() ;
return _Instance ;
}
private void SetChinaVoice()
{
voice.Voice = voice.GetVoices(string.Empty,string.Empty).Item(0) ;
}
private void SetEnglishVoice()
{
voice.Voice = voice.GetVoices(string.Empty,string.Empty).Item(1) ;
}
private void SpeakChina(string strSpeak)
{
SetChinaVoice() ;
Speak(strSpeak) ;
}
private void SpeakEnglishi(string strSpeak)
{
SetEnglishVoice() ;
Speak(strSpeak) ;
}

public void AnalyseSpeak(string strSpeak)
{
int iCbeg = 0 ;
int iEbeg = 0 ;
bool IsChina = true ;
for(int i=0;i<strSpeak.Length;i++)
{
char chr = strSpeak[i] ;
if (IsChina)
{
if (chr<=122&&chr>=65)
{
int iLen = i - iCbeg ;
string strValue = strSpeak.Substring(iCbeg,iLen) ;
SpeakChina(strValue) ;
iEbeg = i ;
IsChina = false ;
}
}
else
{
if (chr>122||chr<65)
{
int iLen = i - iEbeg ;
string strValue = strSpeak.Substring(iEbeg,iLen) ;
this.SpeakEnglishi(strValue) ;
iCbeg = i ;
IsChina = true ;
}
}

}//end for
if (IsChina)
{
int iLen = strSpeak.Length - iCbeg ;
string strValue = strSpeak.Substring(iCbeg,iLen) ;
SpeakChina(strValue) ;
}
else
{
int iLen = strSpeak.Length - iEbeg ;
string strValue = strSpeak.Substring(iEbeg,iLen) ;
SpeakEnglishi(strValue) ;
}

}
private void BuildSpeach()
{
if (voice == null)
voice = new SpVoiceClass() ;
}
public int Volume
{
get
{
return voice.Volume ;
}
set
{
voice.SetVolume((ushort)(value)) ;
}
}
public int Rate
{
get
{
return voice.Rate ;
}
set
{
voice.SetRate(value) ;
}
}
private void Speak(string strSpeack)
{
try
{
voice.Speak(strSpeack,SpeechVoiceSpeakFlags.SVSFlagsAsync) ;
}
catch(Exception err)
{
throw(new Exception("发生一个错误:"+err.Message)) ;
}
}

public void Stop()
{
voice.Speak(string.Empty,SpeechLib.SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak) ;
}
public void Pause()
{
voice.Pause() ;
}
public void Continue()
{
voice.Resume() ;
}

}
leeyeefeng2004 2005-05-18
  • 打赏
  • 举报
回复
关注~这个想法顶!
liuqinglq 2005-05-18
  • 打赏
  • 举报
回复
语音聊天室的插件

把源程序修改一下,就可以录音了,绝对没问题。
kwklover 2005-05-18
  • 打赏
  • 举报
回复
谢谢各位支持

realchan 2005-05-17
  • 打赏
  • 举报
回复
“用户通过登陆web站点,直接在线录音,然后可以把声音文件存储在服务器”

似乎需要做一个流媒体服务器才行~
reddeephehe 2005-05-17
  • 打赏
  • 举报
回复
这个不就成了窃听器了?呵呵
  • 打赏
  • 举报
回复
这个需求有意思,关注一下,随带帮顶

62,244

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧