473,414 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Voice recognition

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.Initialized = 1. It says access denied exception from HRESULT: 0x80030005 (STG_E_ACCESSDENIED.
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 3337
Dököll
2,364 Expert 2GB
HRESULT: 0x80030005 (STG_E_ACCESSDENIED.

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
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
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...
0
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...
0
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...
3
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...
1
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...
2
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...
1
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...
0
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...
1
by: gracepaul | last post by:
hi all. how can i do voice recognition through vb.net coding thanks grace
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.