Making a sound

Posted by Gasman on Fri 20 Feb 2004 02:33 AM — 12 posts, 38,839 views.

#0
hey i was wondering if there was a way to make a "ding" sound on my computer when on my screen it says "Better hurry, you're almost out of time for your quest!". is it possible to make mushclint trigger my speakers to make a sound, if it is possible how do i do it? thanx
Australia Forum Administrator #1
Yes, make a trigger and click on Sound -> Browse for the sound you want it to play. There will be a ding.wav in the Windows folder somewhere.
Greece #2
Hm, since we're on the subject, would it be possible for MUSHClient to use the SAPI engine to speak? Come to think of it, I should make a plugin that enables MUSHClient to talk, that'd be cool... I'll have to think about it, but i'm sure it's doable...
Australia Forum Administrator #3
I think I've been asked that before. I don't know how to do it, if someone has an example that would help.
USA #4
Yes, it is possible. You use VBScript, I know I have an example around here somewhere... Ill find it...
USA #5
Alright....
http://mushclient.com/forum/bbshowpost.php?bbsubject_id=1227
Is a working model, they use Office whatever, but MSAgent will work just as well.

http://mushclient.com/forum/bbshowpost.php?bbsubject_id=735
is also an example.

Although Im not sure if the latter works completely.

As for making it talk without an agent, Im sure its possible, youd just have to load up the SAPI engine in an external program and have MC send things to it.
(Basically youd make an agent without an avatar)
Greece #6
Ok, here's the code:


Dim vceObject

Sub OnPluginInstall()
    Set vceObject = CreateObject ("Sapi.SpVoice")
    vceObject.Rate = 2 '1 is normal, more is faster :p
    vceObject.Speak "Initialized engine.", 1
End Sub

Sub OnPluginClose()
    Set vceObject = Nothing
End Sub

Sub sbSpeak(strText)
    vceObject.Speak strText, 1
End Sub


You can download SAPI SDK 5 from Microsoft and see everything, you can change voices and such...
Australia Forum Administrator #7
So it's done, is that it? I don't need to do anything? Well done. :)
Greece #8
Yeah, easy, isn't it? :P It's also quite useful if you want to be informed on events if you're on another window, although it'll probably choke on the medieval names and internet slang...
USA #9
It chokes on real words too. Although, you can specify some changes, if theres common words it misinterperates.

Although, Im not sure how it do it with raw SAPI
Greece #10
That's done from the speech control panel item, there's a word button somewhere or something :p
USA #11
yeah, you can do it via the SAPI control panel (Ctrl Panel > Speech > SAPI then click on pronounciation), which I suppose if youre using for just your personal use, it works, but Im pretty sure you can also do it at runtime too...

Eh, I guess at runtime you can just use regexps to change the words into their phonetic spellings and then pass that to SAPI.