473,396 Members | 1,799 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,396 software developers and data experts.

voice based commands for media player

Hi,
I am student of BS IT and now making a voice based software for blind people so that they may use the system by giving voice commands to read/write files, emails and also listen songs through my software.

But I am currently stuck in my one activity that is to make media player controls as voice controls.

User say pause and media player would perform action on this command "pause" and similar for stop and play.

I used following code and add windows media player as its reference

Expand|Select|Wrap|Line Numbers
  1. Imports System.Speech.Recognition
  2.  
  3. Public Class Form2
  4.  
  5.     Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6. AxWindowsMediaPlayer1.URL = "songs playlist"       
  7.  Dim engine As New Speech.Recognition.SpeechRecognitionEngine
  8.  
  9.         Dim dictionGrammar As New Speech.Recognition.DictationGrammar
  10.  
  11.         Dim recognitionResult As Speech.Recognition.RecognitionResult
  12.  
  13.         Dim timeSpan As New TimeSpan(0, 0, 15)
  14.  
  15.         engine.SetInputToDefaultAudioDevice()
  16.  
  17.         engine.LoadGrammar(dictionGrammar)
  18.  
  19.         recognitionResult = engine.Recognize(timeSpan)
  20.  
  21.         For Each word As RecognizedWordUnit In recognitionResult.Words
  22.  
  23.  
  24.  
  25.             MessageBox.Show(word.Text)
  26.             If word.Text = "play" Then
  27.                 AxWindowsMediaPlayer1.Ctlcontrols.play()
  28.             ElseIf word.Text = "pause" Then
  29.                 'Process.Start("pause")
  30.                 AxWindowsMediaPlayer1.Ctlcontrols.pause()
  31.             ElseIf word.Text = "stop" Then
  32.                 ' Process.Start("stop")
  33.                 AxWindowsMediaPlayer1.Ctlcontrols.stop()
  34.                         End If
  35.         Next
  36.  
  37.     End Sub
  38. End Class
Please help me in my task
Dec 2 '14 #1
0 1126

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

Similar topics

1
by: Anise | last post by:
I have a question concerning embedding a windows media player into a web application in .net.. I download Windows Media Player 10 and its SDK On the .ascx page I placed a windows media player...
1
by: Stephen Adam | last post by:
Hi there, Have spent a while trying to find out how to connect to Windows Media Player through COM. Unfortunately there doesnt seem to be much stuff about it on the web. What I need to do is...
6
by: Mustafa Rabie | last post by:
Hi All, I have a customer, who wants me to add online radio to his web site. 1) How can i add the media player object to the site 2) How can i dynamically change the url when i user clicks on a...
1
by: Shane | last post by:
I'm trying to access the media player (V10) mediacollection object from my ..NET web service to return a list of media files. For some reason when i call getByAttribute("MediaType", "Audio") ...
4
by: hzgt9b | last post by:
Using VS 2003, VB.NET and/or ASP.NET 2.0, BACKGROUND I have a window forms based application that contains a TreeView control and a WebBroswer (AxSHDocVw.AxWebBrowser) control. The TreeView is...
19
by: Tony | last post by:
I'm working on project that plays movies using Windows Media Player and I'm controlling everything with JavaScript. Per the client I only need to support IE 6 or greater which happens to make...
2
riptide2049
by: riptide2049 | last post by:
I really have a problem here. I have a code that is suppost to take the href of a link from the right class;value of a link maked toreturn false. the value is a Media file the file is sent to...
2
by: Ronald S. Cook | last post by:
I want to create an ASP.NET website wherein an embedded Windows Media Player is displayed throughought the web session and new media files are played depending on what the user clicks elsewhere. ...
5
by: Fred Chateau | last post by:
I am currently using an Object element of type "application/x-mplayer2" to create a media player in ASP.NET 3.5, and was wondering if there is a better way to instantiate WMP in a browser. I'm...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.