我键入时手腕疼痛,我想开始使用语音识别编写SQL语句,存储过程和视图.
sql ergonomics speech-recognition code-by-voice naturallyspeaking
无论如何将Dragon NaturallySpeaking纳入事件驱动程序?如果我使用DNS录制用户语音输入而不将其写入屏幕并将其直接保存到XML,我的老板会非常喜欢它.我一直在做了好几天的研究,我不能看到这没有(真贵)SDK发生的一种方式,我甚至不知道它会工作,然后.
微软有能力编写一个(Python)程序,它的语音识别器可以等到检测到语音事件然后处理它.它还具有能提出替代短语,它认为是最好的猜测和记录以备后用.wav文件的一个得心应手的质量.示例代码:
spEngine = MsSpeech()
spEngine.setEventHandler(RecoEventHandler(spEngine.context))
class RecoEventHandler(SpRecoContext):
def OnRecognition(self, StreamNumber, StreamPosition, RecognitionType, Result):
res = win32com.client.Dispatch(Result)
phrase = res.PhraseInfo.GetText()
#from here I would save it as XML
# write reco phrases
altPhrases = reco.Alternates(NBEST)
for phrase in altPhrases:
nodePhrase = self.doc.createElement(TAG_PHRASE)
Run Code Online (Sandbox Code Playgroud)
我似乎无法让DNS做到这一点.我能做的最接近的是:
while keepGoing == True:
yourWords = raw_input("Your input: ")
transcript_el = createTranscript(doc, "user", yourWords)
speech_el.appendChild(transcript_el)
if yourWords == 'bye':
break
Run Code Online (Sandbox Code Playgroud)
甚至还有一个可怕的副作用,就是让用户在每个句子后都说出"新行"!根本不是首选的解决方案!反正有没有让DNS做Microsoft Speech所做的事情?
仅供参考:我知道合乎逻辑的解决方案是简单地切换到微软语音,但我们假设,只是为了咧嘴笑笑,这不是一个选择.
更新 - 有没有人买过SDK?你觉得它有用吗?
当启用Natlink时,Dragon冻结并且无法完全启动.我用这个 natlink下载.并按照网站上的指示.任何煽动为什么会发生这种情况的人都非常感激.
我目前正在编写一个AI程序,它接收来自Dragon NaturallySpeaking(使用Natlink)的输入,处理它,并返回语音输出.我能够拿出一个Receiver GrammarBase来捕获Dragon的所有输入并将其发送给我的解析器.
class Receiver(GrammarBase):
gramSpec = """ <start> exported = {emptyList}; """
def initialize(self):
self.load(self.gramSpec, allResults = 1)
self.activateAll()
def gotResultsObject(self, recogType, resObj):
if recogType == 'reject':
inpt, self.best_guess = [], []
else:
inpt = extract_words(resObj)
inpt = process_input(inpt) # Forms a list of possible interpretations
self.best_guess = resObj.getWords(0)
self.send_input(inpt)
def send_input(self, inpt):
send = send_to_parser(inpt) # Sends first possible interpretation to parser
try:
while True:
send.next() # Sends the next possible interpretation if the first is rejected
except …Run Code Online (Sandbox Code Playgroud) python speech-recognition speech naturallyspeaking speech-to-text
我希望能够通过语音识别编写代码,他目前在Mac OS X 10.6.8上使用Aquamacs 2.4和Dragon Dictate 2.有人知道这是否可能,如果可能,如何?我见过shorttalk,emacs listen和语音代码,但它们只适用于使用Dragon Naturally Speaking的Windows机器.
任何线索都会非常感激.
我也是通过ESS写的.