sapi

problem with Speech Sdk 5.1?

我们两清 提交于 2019-12-25 06:36:22
问题 I am saving an audio file as test.wav from below SpeechVoiceSpeakFlags SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync; SpVoice Voice = new SpVoice(); SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "All files (*.*)|*.*|wav files (*.wav)|*.wav"; sfd.Title = "Save to a wave file"; sfd.FilterIndex = 2; sfd.RestoreDirectory = true; SpeechStreamFileMode SpFileMode = SpeechStreamFileMode.SSFMCreateForWrite; SpFileStream SpFileStream = new SpFileStream(); SpFileStream.Open(sfd.FileName,

Microsoft SAPI System.Speech for transcription

此生再无相见时 提交于 2019-12-24 15:37:33
问题 I'm currently doing a research on a tool that is able to transcribe audio files. The first thing I look at is the possibility of using Microsoft's System.Speech API. Looking through the msdn documentation, it seems like, this tool is more suitable for short voice commands where you have some knowledge of what to expect from the speaker. It requires you to creation of Grammar for good accuracy. Can someone who has experienced with this API confirm whether this is right? 回答1: Yes and no. While

Creating a In proc speech recognition using sapi c#?

守給你的承諾、 提交于 2019-12-24 13:03:04
问题 My SAPI code for setting up the in proc recognition engine looks like this: ISpeechRecoContext cpRecoCtx; // create the recognition context cpRecoCtx = new SpeechLib.SpInProcRecoContext(); ((SpInProcRecoContext)cpRecoCtx).Recognition += new _ISpeechRecoContextEvents_RecognitionEventHandler(RecoContext_Recognition); /****** END: set up recognition context *****/ So how do I setup my audio input to default audio input in c#? I have found solutions in C++ but need one for C#. 回答1: The default

python text translation to speech

不羁岁月 提交于 2019-12-24 08:19:04
问题 I am working on testing text translation (from English to other language) and translation to audio code using python. I am using google translate api for translation and win32 for audio. While testing i found that google supports https://gist.github.com/jseabold/1473363 these languages. The translation part of code seem to be working fine for many options but audio part only works with a few languages (english , spanish , italian etc works). as you can see in example below I can see text is

Can't save to wav from python, can't import SpeechLib from comtypes.gen, what next?

时间秒杀一切 提交于 2019-12-24 02:37:10
问题 First the setup: Windows 8.1 64bit, Python 3.4 32bit. I wanted to run the code here. So I installed comtypes pip install comtypes I then tried to run the code, i got ImportError: cannot import name 'SpeechLib' Then tried this code here to try and generate the needed SpeechLib module. I am however still getting the same error, what should I try next? 回答1: Running these lines made it work: from comtypes.client import CreateObject engine = CreateObject("SAPI.SpVoice") stream = CreateObject("SAPI

How do I load a text grammar in a SAPI 5.4 C# program?

杀马特。学长 韩版系。学妹 提交于 2019-12-24 00:37:49
问题 I've been using SRGS grammars with SAPI 5.4 to define command and control grammars. Now I'd like to switch to text grammars so they'd be compatible with SAPI 5.1 (and possibly even SAPI 4?). I found an example of a SAPI 5.4 compatible text grammar here I'd like to load that grammar from it's XML file at runtime as opposed to using the grammar compiler tool and then including the binary version of the grammar as a resource. Ideally I'd like to be able to create an XDocument in memory and then

how to convert SAPI's MS LANG ID to BCP 47 language tag?

被刻印的时光 ゝ 提交于 2019-12-22 01:32:54
问题 The call to SAPI's get language method returns an MS LangID, but for my purpose, it needs to be converted to a BCP 47 language tag (eg. en-GB) . how do we do it? I am not able to do it using LCIDToLocalName, as to use this function, I need to convert the returned value into the LCID format first. For eg, it returns "809" for english, now how do I convert it into LCID first, as LCIDHex for English is "0809", and LCIDec is "2057". Any help would be appreciated. Edit: Following is the code if (S

Specifying a pronunciation of a word in Microsoft Speech API

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 21:39:00
问题 I'm working on a small application in C# which performs speech recognition using Microsoft Speech API. I need to add some non-english words to grammar, whose pronunciation don't obey english pronunciation rules. Is it possible specify their pronunciation using International Phonetic Alphabet ? If yes, which methods should be used ? 回答1: The way to achieve custom pronunciation here is by passing an SrgsDocument to the Grammar constructor. This allows specification per http://www.w3.org/TR

SAPI identifying more than 2 properties

偶尔善良 提交于 2019-12-20 04:12:17
问题 I found this on google while searching on some information on SAPI identifying phrases. This example shows if there is only one property in the rule. So what if there are 2 or more properties in that rule? How would one go about writing the code for this? I am still confused about SAPI and trying to understand it. Any help is welcome, thanks! The alternate method is add a property to your list tag/items [you appear to be familiar with properties], iterate through the property tree to find the

SAPI identifying more than 2 properties

筅森魡賤 提交于 2019-12-20 04:12:01
问题 I found this on google while searching on some information on SAPI identifying phrases. This example shows if there is only one property in the rule. So what if there are 2 or more properties in that rule? How would one go about writing the code for this? I am still confused about SAPI and trying to understand it. Any help is welcome, thanks! The alternate method is add a property to your list tag/items [you appear to be familiar with properties], iterate through the property tree to find the