Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Making PC's Speak with SAPI.SpVoice

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,63061
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Making PC's Speak with SAPI.SpVoice
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Making PC's Speak with SAPI.SpVoice - 8/2/2008 5:38:43 PM   
  X BiLe


Posts: 9
Score: 0
Joined: 6/18/2008
Status: offline
Not a useful script, but a little fun never the less. 

this is a few examples of usage for the SAPI.SpVoice Object (microsoft sam)

How to Make Your PC talk. (Talk Box Basic)


      

Now the question is further posed on how to actually get someone elses pc to talk using remote access.

this challenge can easily be tackled assuming you have C$ access (C Share)

Please also note that this is not the only way to do this like all things in computers, please remember that in all scripts you do


      

like all objects to be created in VBS there are more than just the 3 properties i actually use here.

SAPI.SpVoice Properties:

'.Pause = pause speaking
'.resume = resume after pause
'.Rate = speed at which voice speaks
'.Voice = you can use set and a voice value to change the voice (if multiple exist on machine)
'.Volume = volume of voice (not system volume, just voice)
'.WaitUntilDone = wait until done - dont know how else to say that ;)


how to set the 3 useful voice Properties


      

Please notice that the '.getvoices.item(0)' has refrenced item 0, the getvoices is in an array (if multiple are present)

to retrive the names of the values you could do a simple call like:


      
i dont know, its just one of those toy codes any ways

< Message edited by X BiLe -- 8/2/2008 5:46:02 PM >
 
 
Revisions: 2 | Post #: 1
 
 RE: Making PC's Speak with SAPI.SpVoice - 8/8/2008 1:32:01 AM   
  AMBience

 

Posts: 5
Score: 0
Joined: 7/24/2008
Status: offline
This is very cool!

I've made a few TTS scripts myself (to make sound FX not speech), but I only have SAM and he's a bit limited. 

However, you can actually change the pitch of SAM as well as rate.  This is so hidden and undocumented and also very odd. There's no DOM like commands for pitch, instead you add it into the text he speaks using XML(?).   (Could somebody explain why this is so?)

MyVoice.Speak "<pitch middle='25'>" &  "Hello" ,1 

Pitch has a range of -25 to 25

Have fun!

(in reply to X BiLe)
 
 
Post #: 2
 
 RE: Making PC's Speak with SAPI.SpVoice - 10/17/2008 1:55:40 PM   
  cheater2478

 

Posts: 10
Score: 0
Joined: 10/17/2008
From: WPB , FL
Status: offline
I love this script. Funny reactions from many people. Especially while in school. I tinkered with it and accidentally created a virus. Lol, I ended up making multiple viruses, but erased all evidence of existence....I hope.


(in reply to X BiLe)
 
 
Post #: 3
 
 RE: Making PC's Speak with SAPI.SpVoice - 10/18/2008 1:38:26 AM   
  blksith0


Posts: 38
Score: 0
Joined: 10/17/2008
Status: offline
So if you want to do it to someone elses computer, all you have to do is have their IP and just type it on the script?

(in reply to cheater2478)
 
 
Post #: 4
 
 RE: Making PC's Speak with SAPI.SpVoice - 10/18/2008 3:12:39 AM   
  cheater2478

 

Posts: 10
Score: 0
Joined: 10/17/2008
From: WPB , FL
Status: offline
yea, but its hard to find someones ip out. I think.

(in reply to blksith0)
 
 
Post #: 5
 
 RE: Making PC's Speak with SAPI.SpVoice - 10/18/2008 3:32:07 AM   
  blksith0


Posts: 38
Score: 0
Joined: 10/17/2008
Status: offline
So would this be right? Like is that where Im supposed to put the persons IP?

'************************
'* X BiLe
'* Remote Voice Send
'* Solo VBS
'************************

'get ip
IP = InputBox("111.11.11.111:", "Remote Voice Send By X BiLe", "")
If IP = "" Then WScript.quit: Else

'get MSG
MSG = InputBox("HELLO!:", "Remote Voice Send By X BiLe", "")
If MSG = "" Then WScript.quit: Else

'vbs command to send
A = "on error resume next" & VBCRLF & _
"    CreateObject(""SAPI.SpVoice"").speak " & """" & MSG & """" & VBCRLF & _
"    CreateObject(""Scripting.FileSystemObject"").DeleteFile (""C:\Voice1.vbs"")"

' Create the vbs on remote C$
CreateObject("Scripting.FileSystemObject").OpenTextFile("\\" & ip & "\C$\Voice1.vbs",2,True).Write A

' Run the VBS through Wscript on remote machine via WMI Object Win32_Process
B = GetObject("winmgmts:\\" & IP & "\root\cimv2:Win32_Process").Create("C:\windows\system32\wscript.exe ""C:\Voice1.vbs""", null, null, intProcessID)

And it will say hello on their computer right? Will a window come up or something, or will it just be like out of nowhere?

(in reply to cheater2478)
 
 
Post #: 6
 
 RE: Making PC's Speak with SAPI.SpVoice - 10/18/2008 4:30:02 AM   
  cheater2478

 

Posts: 10
Score: 0
Joined: 10/17/2008
From: WPB , FL
Status: offline
no, now it shows that, change it back to the original, run it, enter the ip, press enter, enter the message, press enter, and ur done!

(in reply to blksith0)
 
 
Post #: 7
 
 RE: Making PC's Speak with SAPI.SpVoice - 10/19/2008 7:40:21 AM   
  blksith0


Posts: 38
Score: 0
Joined: 10/17/2008
Status: offline
And will the noise just happen or will a window of the microsoft sam thing pop-up? Does it work from an XP to a vista?

I tried it and I got this Error



< Message edited by blksith0 -- 10/19/2008 10:06:13 AM >

(in reply to cheater2478)
 
 
Revisions: 1 | Post #: 8
 
 RE: Making PC's Speak with SAPI.SpVoice - 10/19/2008 10:47:01 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Taking a look at the code you posted above, so I may be wrong on which line 21 is in your code, but:

CreateObject("Scripting.FileSystemObject").OpenTextFile("\\" & ip & "\C$\Voice1.vbs",2,True).Write A

This appears to be the issue, the script is not seeing the patch here. Do a wscript.echo "\\" & ip & "\C$\"

And make sure the path is correct.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to blksith0)
 
 
Post #: 9
 
 RE: Making PC's Speak with SAPI.SpVoice - 10/20/2008 10:51:10 AM   
  blksith0


Posts: 38
Score: 0
Joined: 10/17/2008
Status: offline
Uh.. where do I put that? On line 21?

(in reply to mbouchard)
 
 
Post #: 10
 
 RE: Making PC's Speak with SAPI.SpVoice - 11/3/2008 1:01:19 AM   
  blksith0


Posts: 38
Score: 0
Joined: 10/17/2008
Status: offline
halp me. 

(in reply to blksith0)
 
 
Post #: 11
 
 RE: Making PC's Speak with SAPI.SpVoice - 11/20/2008 1:52:25 AM   
  pcgeek86

 

Posts: 6
Score: 0
Joined: 11/17/2008
Status: offline
How about some Powershell love? :)

[Reflection.Assembly]::LoadWithPartialName("System.Speech")
$voice = New-Object System.Speech.Synthesis.SpeechSynthesizer
$voice.Speak("Hello world")

Trevor Sullivan
Systems Engineer

(in reply to blksith0)
 
 
Post #: 12
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Making PC's Speak with SAPI.SpVoice Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts