Prev: An Unexpected Error has occurred
Next: IDE Edit Crash
From: MM on 10 Apr 2010 11:31 On my new PC, which is running XP, I have been playing around with speech recognition. How can I get my VB6 program to respond to voice commands? VC works with, say, Word straight away. I don't have to configure XP or install anything. I just rand through a couple of the training exercises and then I could dictate into Word or switch to Voice Command mode and say things like "file open". I once experimented with Microsoft DirectSpeech in VB6, but I had to download a ton of SAPI stuff first. Ideally, I would not want a user to have to install anything other than what comes with XP/Vista out of the box. Possible? MM
From: Patrice on 10 Apr 2010 13:00 Hi, > How can I get my VB6 program to respond to voice commands? VC works > with, say, Word straight away. I don't have to configure XP or install > anything. According to http://en.wikipedia.org/wiki/Microsoft_Speech_API the trick is that it ships with Office in XP and is part of the OS only beginning with Vista... > I once experimented with Microsoft DirectSpeech in VB6, but I had to > download a ton of SAPI stuff first. Here under Vista I see a "Microsoft Speech Object Library" in the available references that seems the automation library to use ? Do you see this one under XP ? > Ideally, I would not want a user to have to install anything other > than what comes with XP/Vista out of the box. Seems could Work with Vista or later but that the SAPI needs to be installed under XP if not already done... -- Patrice
From: Mayayana on 10 Apr 2010 16:13 | > Ideally, I would not want a user to have to install anything other | > than what comes with XP/Vista out of the box. | | Seems could Work with Vista or later but that the SAPI needs to be installed | under XP if not already done... | SAPI is pre-installed in XP but it's partial and somewhat confusing. I can find and use the TTS functionality. And the typelib from sapi.dll is there. It even contains the SR entries. But the SR DLLs are not installed. If I download the SAPI5 SDK and run the samples without installing the SDK itself, I get errors with the SR sample, even though intellisense works for the objects. So, yes, SAPI is on XP, and one can add the "Microsoft Speech Object Library" reference. But SR doesn't work without installing the SDK or redist. files!
From: MM on 11 Apr 2010 06:38 On Sat, 10 Apr 2010 16:13:00 -0400, "Mayayana" <mayayana(a)invalid.nospam> wrote: >| > Ideally, I would not want a user to have to install anything other >| > than what comes with XP/Vista out of the box. >| >| Seems could Work with Vista or later but that the SAPI needs to be >installed >| under XP if not already done... >| > > SAPI is pre-installed in XP but it's partial and >somewhat confusing. I can find and use the TTS >functionality. And the typelib from sapi.dll is there. >It even contains the SR entries. But the SR DLLs >are not installed. If I download the SAPI5 SDK and >run the samples without installing the SDK itself, >I get errors with the SR sample, even though >intellisense works for the objects. > > So, yes, SAPI is on XP, and one can add the >"Microsoft Speech Object Library" reference. But >SR doesn't work without installing the SDK or >redist. files! I wonder, then, what XP itself is using in, say, Word 2003 to accept dictation or voice commands, both of which work without my needing to install anything. Sure, I needed to configure the "Language Bar" and check a few other boxes, train the microphone and so on, but XP itself seemed to provide everything that is needed to recognise voice input. I'm thinking of a daemon that accepts a few command words and interacts with the main app via, say, a textbox change event (textbox's hwnd transmitted to the dameon beforehand). The daemon could be written in any language, not only VB. I really only need two or three commands to be automated by voice. You see, at the moment I have another dameon that accepts MIDI input from my digital piano. It "knows" the hwnd of a hidden textbox in the main app. When a specific key on the piano is depressed, or the soft or loud pedal is pressed, a trigger word is sent (SendMessage with WM_SETTEXT) to the textbox and I have the main app responding in some way to the change event that occurs. So I thought, now wouldn't it be really useful to be able to control several other aspects of the main app without taking one's hands off the piano keyboard, and that's when I, once again, thought of voice recognition and command and control. MM
From: Mayayana on 11 Apr 2010 10:09
| | I wonder, then, what XP itself is using in, say, Word 2003 to accept | dictation or voice commands, both of which work without my needing to | install anything. Sure, I needed to configure the "Language Bar" and | check a few other boxes, train the microphone and so on, but XP itself | seemed to provide everything that is needed to recognise voice input. | Wasn't Office 2000 a 500MB install? I don't even want to know what it looks like now. In other words, MS Office is incredibly bloated. I've no doubt that the kitchen sink is in there somewhere. So shipping the SR libs should have been no problem. :) You can redistribute SAPI SR. There's a catch there, though, in that SAPI is only provided in the form of MSMs for building MSI installers, and as an SDK: http://support.microsoft.com/kb/320207 You can dissect the MSMs and ship only what you actually need, avoiding the Windows Installer fiasco, but that would also require some work. Microsoft has ignored their own rules for Windows Installer. (Surprise, surprise. :) With an MSI a Feature is supposed to be a standalone set of files and/or Registry settings -- something that is not required for the program to run. A component is supposed to be a coherent piece of a feature. So one would think that the TTS feature and SR feature would be easy to split out. Microsoft themselves have done it on XP. But nooooo. SAPI comes as 135 MB of MSMs, and only one feature: SAPI. The components are a cross-linked mess, with TTS and SR each "requiring" several components. http://support.microsoft.com/kb/320207 So your options: * Require Word on the target machine. * Find a free, small, third-party SR lib. (That's probably a long shot. Anything you find is likely to be a SAPI wrapper.) * Switch to Windows Installer and ship SAPI 5 SR. * Dissect the SAPI MSMs and ship only the files you need. (I've done that myself for TTS, but I've never used SR.) It would take some work to figure out exactly what you need to ship. I think it's basically what's in C:\Program Files\Common Files\SpeechEngines\Microsoft\SR But there might be more files. And there are Registry settings required. (Note that on a basic XP install there's a TTS folder but not an SR folder on the above path.) It might make sense to download the SDK and try the SR sample in that, to see if SAPI SR will serve the purpose. (I've used the TTS but never the SR.) If so then you might be able to create a small SR installer or find one online that someone else has already created. You can use the SDK MSI to build the installer, if you decide to do that. I wrote a set of scripts that are in this download: http://www.jsware.net/jsware/msicode.php5#unpack They comprise tool scripts, an HTA-based MSI/MSM unpacker utility, and a sample script-based TTS installer. The info. and tools are all there to create your own SR-only installer. But as explained above, it will probably take some trial and error to figure out exactly which parts you need because the SAPI installer that MS built is so disorganized. | I'm thinking of a daemon that accepts a few command words and | interacts with the main app via, say, a textbox change event | (textbox's hwnd transmitted to the dameon beforehand). The daemon | could be written in any language, not only VB. I really only need two | or three commands to be automated by voice. | | You see, at the moment I have another dameon that accepts MIDI input | from my digital piano. It "knows" the hwnd of a hidden textbox in the | main app. When a specific key on the piano is depressed, or the soft | or loud pedal is pressed, a trigger word is sent (SendMessage with | WM_SETTEXT) to the textbox and I have the main app responding in some | way to the change event that occurs. | | So I thought, now wouldn't it be really useful to be able to control | several other aspects of the main app without taking one's hands off | the piano keyboard, and that's when I, once again, thought of voice | recognition and command and control. | | MM |