This post describes how to add a speech to PC games like EPL , football etc . The tools we are using here are Visual Studio 2005 . The libraries we using here are Microsoft speech library .
First you need to import the Microsoft speech library to your project . We provide a video for you that can help you in coding . We also provide the source code as we are explaining in the video . this is very simple . Try it and please put your valuable comments . the video is uploaded here .
The source code is below
--------------------------------------------------------------------------------------------------------------
Imports SpeechLib
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' My.Computer.Audio.Play(CurDir() & "\8point1.wav", AudioPlayMode.Background)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim spch As String
spch = TextBox1.Text
Dim spk As New SpeechLib.SpVoice
spk.Speak(spch)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
My.Computer.Audio.Stop()
End Sub
End Class
----------------------------------------------------------------------------------------------------
Here in the source code we first import the speech library .
The we create a string spch in which to this string we are accepting the value from the text box .
then we create a object of the Speech library as spk
using the in build speak function we can do this speech .
Thank you .
Welcome to Foot zone . This website is a dictionary which contains every thing about football . we gives your the lastest updates about the matches all around the world , Especially English Premier League . We also helps the football game programmers in developing a PC football Game in Visual Basic . We also helps how to make football videos and give notes on how to upload on Youtube . We give you tips for developing Flash Games also .
No comments:
Post a Comment