473,692 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Voice recognition

43 New Member
Hi I have created a voice regnocnition program but I can't get it to work. The problem comes when my program comes to the command: VoiceCmd.Initia lized = 1. It says access denied exception from HRESULT: 0x80030005 (STG_E_ACCESSDE NIED.
Expand|Select|Wrap|Line Numbers
  1. Option Strict Off
  2. Option Explicit On
  3. Friend Class Frm_Voice_Command
  4.     Inherits System.Windows.Forms.Form
  5.     Private My_menu As Integer
  6.     Private Loop_1 As Integer
  7.     Private TCount As Integer
  8.  
  9.     Private Sub Cmd_Exit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cmd_Exit.Click
  10.         ' Code to 'EXIT' the application
  11.         Me.Close()
  12.     End Sub
  13.  
  14.     Private Sub Cmd_Open_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cmd_Open.Click
  15.         ' Code to 'OPEN' a database
  16.         CD1Open.ShowDialog()
  17.         CD1Save.FileName = CD1Open.FileName
  18.         ' I've only opened the Common dialog 'ShowOpen' form but you add
  19.         ' the rest of the 'Open' code here
  20.     End Sub
  21.  
  22.     Private Sub Cmd_Save_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cmd_Save.Click
  23.         ' Code to 'SAVE' a database
  24.         CD1Save.ShowDialog()
  25.         CD1Open.FileName = CD1Save.FileName
  26.         ' I've only opened the Common dialog 'ShowSave' form but you add
  27.         ' the rest of the 'Save' code here
  28.     End Sub
  29.  
  30.     Private Sub Cmd_Start_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cmd_Start.Click
  31.         If Cmd_Start.Text = "Listen" Then
  32.             ' Activate my list of commands. These will show in the 'What can I say' form of
  33.             ' Microsoft Voice apllication
  34.             VoiceCmd.Activate(My_menu)
  35.             Cmd_Start.Text = "Stop Listening" 'Change the command text
  36.             Lst_Commands.Enabled = True 'enable the List of commands (Visual)
  37.         Else
  38.             ' Deactivate my list of commands. These will now not show in the
  39.             ' 'What can I say' form of Microsoft Voice apllication
  40.             VoiceCmd.Deactivate(My_menu)
  41.             Cmd_Start.Text = "Listen" 'Change the command text
  42.             Lst_Commands.Enabled = False 'disable the List of commands (Visual)
  43.         End If
  44.     End Sub
  45.  
  46.     Private Sub Frm_Voice_Command_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
  47.         ' Dim some variables used for retriving commands from 'VoiceCmd'
  48.         'UPGRADE_NOTE: Command was upgraded to Command_Renamed. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
  49.         Dim Category, Command_Renamed, Description, Action As String
  50.         Dim Flags As Integer
  51.  
  52.         ' Initialize the voice control...
  53.         VoiceCmd.Initialized = 1
  54.         ' Create and return a Menu control
  55.         My_menu = VoiceCmd.get_MenuCreate("My Commands", "commands State", 4)
  56.         ' Enable our voice control
  57.         'UPGRADE_NOTE: Enabled was upgraded to CtlEnabled. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
  58.         VoiceCmd.CtlEnabled = 1
  59.         ' Suppress any voice errors that may occur
  60.         'VoiceCmd.SuppressExceptions = 1
  61.         ' Load our list of commands into the menu.
  62.         VoiceCmd.AddCommand(My_menu, 1, "white", "white colour", "listen list", 0, "")
  63.         VoiceCmd.AddCommand(My_menu, 1, "red", "red colour", "listen list", 0, "")
  64.         VoiceCmd.AddCommand(My_menu, 1, "green", "green colour", "listen list", 0, "")
  65.         VoiceCmd.AddCommand(My_menu, 1, "blue", "blue colour", "listen list", 0, "")
  66.         VoiceCmd.AddCommand(My_menu, 1, "open", "Open Database", "listen list", 0, "")
  67.         VoiceCmd.AddCommand(My_menu, 1, "save", "Save Database", "listen list", 0, "")
  68.         VoiceCmd.AddCommand(My_menu, 1, "exit", "Exit App", "listen list", 0, "")
  69.         VoiceCmd.AddCommand(My_menu, 1, "stop listening", "Stop Listen", "listen list", 0, "")
  70.         ' Activate the List of commands
  71.         VoiceCmd.Activate(My_menu)
  72.         Cmd_Start.Text = "Stop Listening"
  73.         Lst_Commands.Items.Clear()
  74.         'load the commands from the menu in to the list
  75.         TCount = VoiceCmd.get_CountCommands(My_menu)
  76.         For Loop_1 = 1 To TCount
  77.             VoiceCmd.GetCommand(My_menu, Loop_1, Command_Renamed, Description, Category, Flags, Action)
  78.             Lst_Commands.Items.Add(Command_Renamed)
  79.         Next Loop_1
  80.     End Sub
  81.  
  82.     Private Sub Frm_Voice_Command_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
  83.         ' Remove the commands from the menu
  84.         TCount = VoiceCmd.get_CountCommands(My_menu)
  85.         For Loop_1 = TCount To 1 Step -1
  86.             VoiceCmd.Remove(My_menu, Loop_1)
  87.         Next Loop_1
  88.         ' release the usage of the command menu.
  89.         VoiceCmd.ReleaseMenu(My_menu)
  90.         'UPGRADE_NOTE: Enabled was upgraded to CtlEnabled. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
  91.         VoiceCmd.CtlEnabled = 0
  92.     End Sub
  93.  
  94.     Private Sub Timer1_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer1.Tick
  95.         ' After a perion of silence reset the last word heard
  96.         Detect.Text = "<Nothing>"
  97.     End Sub
  98.  
  99.     Private Sub VoiceCmd_CommandOther(ByVal eventSender As System.Object, ByVal eventArgs As AxHSRLib._VcommandEvents_CommandOtherEvent) Handles VoiceCmd.CommandOther
  100.         'If commands other than those listed in our menu are heard Display them
  101.         Timer1.Enabled = False
  102.         Detect.Text = eventArgs.Command
  103.         Timer1.Enabled = True
  104.         Timer1.Interval = 2000
  105.     End Sub
  106.  
  107.     Private Sub Voicecmd_CommandRecognize(ByVal eventSender As System.Object, ByVal eventArgs As AxHSRLib._VcommandEvents_CommandRecognizeEvent) Handles Voicecmd.CommandRecognize
  108.         ' One of our listed commands has been spoken
  109.         Timer1.Enabled = False
  110.         ' Display it.
  111.         Detect.Text = eventArgs.Command
  112.         ' Look for it in a list and execute the relavant commands
  113.         Select Case UCase(eventArgs.Command)
  114.             Case "OPEN"
  115.                 Cmd_Open_Click(Cmd_Open, New System.EventArgs())
  116.             Case "SAVE"
  117.                 Cmd_Save_Click(Cmd_Save, New System.EventArgs())
  118.             Case "EXIT"
  119.                 Cmd_Exit_Click(Cmd_Exit, New System.EventArgs())
  120.             Case "STOP LISTENING"
  121.                 Cmd_Start_Click(Cmd_Start, New System.EventArgs())
  122.             Case "RED"
  123.                 Lst_Commands.BackColor = System.Drawing.ColorTranslator.FromOle(&H101FF)
  124.             Case "GREEN"
  125.                 Lst_Commands.BackColor = System.Drawing.ColorTranslator.FromOle(&H1FF01)
  126.             Case "BLUE"
  127.                 Lst_Commands.BackColor = System.Drawing.ColorTranslator.FromOle(&HFF0101)
  128.             Case "WHITE"
  129.                 Lst_Commands.BackColor = System.Drawing.ColorTranslator.FromOle(&HFFFFFF)
  130.         End Select
  131.         ' if we not exiting then reset the timer.
  132.         If Not (UCase(eventArgs.Command) = "EXIT") Then
  133.             Timer1.Enabled = True
  134.             Timer1.Interval = 2000
  135.         End If
  136.     End Sub
  137.  
  138.     Private Sub VoiceCmd_VUMeter(ByVal eventSender As System.Object, ByVal eventArgs As AxHSRLib._VcommandEvents_VUMeterEvent) Handles VoiceCmd.VUMeter
  139.         ' This Procedure is called +- every 8 seconds.
  140.         ' set the level of out vu meter..
  141.         If VU_Meter.Maximum < eventArgs.Level Then VU_Meter.Maximum = eventArgs.Level
  142.         VU_Meter.Value = eventArgs.Level
  143.     End Sub
  144. End Class
I have voice regnocnition SDK, Windows vista premium

I have also tried to run as admin but it still don't work.

How do I fix this?
Dec 28 '07 #1
2 3359
Dököll
2,364 Recognized Expert Top Contributor
HRESULT: 0x80030005 (STG_E_ACCESSDE NIED.

I have voice regnocnition SDK, Windows vista premium

I have also tried to run as admin but it still don't work.

How do I fix this?
Hello, patr0805!

It sounds like it is restricting you as not having access. Can you give us a little background on what you are trying to achieve?

Nice bit of code, by the way, not sure how to work it, but you may find ideas here, perhaps the code is not doing what you need.

Please do stay tuned even if you hadn't heard from me, someone should see your post..

In a bit
Dec 28 '07 #2
patr0805
43 New Member
I am trying to make the application react on voice commands
Dec 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
3160
by: Matt | last post by:
Any progammers looking for a killer app to develop? How about a voice enabled forum? One of the most powerful, exciting, and engrossing experiences on the Internet is the Forum. The first great Internet forums were the Usenet newsgroups. Usenet is still a powerful force, but many different types of forums are also very popular (such as message boards like Vbulliten and XMBforum). I love forums. Love em love em love em. My web site...
0
1433
by: Bootstrap Bill | last post by:
Does anyone know if there is a Microsoft .net library for working with voice modems? Also, do standard voice modems support speach recognition? I want to write a menu system for voice modems that is also speach enabled if possible.
0
1518
by: Xarky | last post by:
Hi, I am writing an application making use of MSAgent and a dll for voice recognition. The dll & MSAgent are provided in the following links http://www.c-sharpcorner.com//Code/2004/May/SpeechRecognition.asp http://www.microsoft.com/MSAGENT/default.asp My problem is that my MSAgent character is speaking, and the text being speaken is acting as an input for the grammar of the voice recognition event.
3
6755
by: BobAchgill | last post by:
I would like to add both voice to my program to read aloud to the user And, I would like to add Speech recognition to my same program so he can speak text into my program. As a VB.Net developer, what is the best choice for adding these functions into my code?
1
2452
by: Junior | last post by:
Hi guys. I want to incorporate voice recognition in a new .NET application I'm developing. I would like to recognize among a group of 30-40 words. But I would also like to avoid using 3dr party libraries... There is this nice solution, this time for the cf, that fits exactly what I'm looking for, but the source code is not available (http://www.brains-n-brawn.com/default.aspx?vDir=noreco). Does any of you guys have a hint, specially...
2
2094
by: Peted | last post by:
Hello, i wanted to experiment with voice recognition and c# express edition 2005 Can someone direc me to good intro on the subject and just abreif spiel on how i should get started, ie any good components i could use etce essentialy i want the PC to recognise some specific words (ie up,
1
5147
by: Slickuser | last post by:
I am running Windows XP Pro SP 2, have Office 2003, installed SDK 5.1, Visual Studio 2005. I tested out the voice the recognition code from this link but seem it can't recognize System.Speech. I try to search for (Add Reference) both in .NET & COM (found none.) Is there any else I need to add to make this work. Thanks http://blogs.msdn.com/robertbrown/archive/2005/06/14/428967.aspx
0
1108
by: RobertJohn | last post by:
Hi all Not exactly an Access question, but perhaps someone can help. Does MS Office Professional come with voice recognition built in as part of the package, or do I still need something like Dragon Naturally Speaking? Thanks in advance Robert
1
1471
by: gracepaul | last post by:
hi all. how can i do voice recognition through vb.net coding thanks grace
0
8603
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8797
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6459
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4323
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2237
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.