mIRC Homepage
Posted By: yamaz Mirc & Vocal Synthesis - 27/06/06 09:12 PM
Is there a way to make Mirc interact with windows built-in vocal synthesis (eg. Microsoft Sam or whatever else is installed)?

I don't mean to do it in the usual way (with the agent) but like this:

I send to "nick" a special CTCP (e.g. /ctcp nick SPEECH hey, how you doin?).

nick's Microsoft Sam (or whatever else installed in nick's PC) says "hey, how you doin?".

How can I get this stuff work? Thanks a lot
Posted By: Kurdish_Assass1n Re: Mirc & Vocal Synthesis - 27/06/06 09:24 PM
well, to make you happy, I'm pretty sure you can do it, I just don't know how to, if noone replies to your thread soon, I'll look into it.
Posted By: Kurdish_Assass1n Re: Mirc & Vocal Synthesis - 28/06/06 03:25 PM
wow, I guess noone replied to this thread, I tried to look for it, but, couldn't find anything on it. sorry, maybe someone will still reply to this thread :P
Posted By: yamaz Re: Mirc & Vocal Synthesis - 28/06/06 06:16 PM
Thanks smile

Come on guys... any idea? smile
Posted By: yamaz Re: Mirc & Vocal Synthesis - 30/06/06 03:27 PM
up
Posted By: yamaz Re: Mirc & Vocal Synthesis - 01/07/06 06:06 PM
up frown
Posted By: landonsandor Re: Mirc & Vocal Synthesis - 01/07/06 10:19 PM
There's no need to bump threads (ESPECIALLY this soon). If somebody has any hint, tips, suggestions or ideas, they'd offer them to you laugh
Posted By: yamaz Re: Mirc & Vocal Synthesis - 07/07/06 08:43 AM
Quote:
There's no need to bump threads (ESPECIALLY this soon). If somebody has any hint, tips, suggestions or ideas, they'd offer them to you laugh


After 5 days... up frown
Posted By: yamaz Re: Mirc & Vocal Synthesis - 15/10/06 10:29 AM
any help? come on I seen it done in javascript!
Posted By: deegee Re: Mirc & Vocal Synthesis - 15/10/06 01:32 PM
Here's my attempt at it, there's no setting of any options, but speech works (if it's installed of course)
Code:
ctcp *:speech:*:{
  echo -atic ctcp $+([,$nick SPEECH]:) $2-
  sapi.talk $regsubex($nick,/[^\w]/g,) says: $iif($2,$2-,nothing)
}
alias sapi.talk {
  var %s = Spk. $+ $ticks,%a = $iif($1,$1-,I've got nothing to say!)
  .comopen %s SAPI.SpVoice
  if !$comerr { .comclose %s $com(%s,Speak,3,bstr,%a) }
}
Posted By: Kurdish_Assass1n Re: Mirc & Vocal Synthesis - 15/10/06 01:49 PM
lol, nice work deegee, I just tested it, and, it worked perfect, laugh, nice going.
Posted By: yamaz Re: Mirc & Vocal Synthesis - 13/12/06 12:35 AM
Yeah thanks a lot! It's perfect smile Way to go man, way to go!
Posted By: yamaz Re: Mirc & Vocal Synthesis - 13/12/06 12:54 PM
There's only one problem: while a sentence is played, mirc is totally locked. You can't even type a char. Is there a way to avoid that?

In the meantime I edited the deegee script and added some options (like On o Off and stuff like that):

alias spon { /set %speech 1 | echo -a Speech is now ON }
alias spoff { /set %speech 0 | echo -a Speech is now OFF }
alias sp { .ctcp $active SPEECH $1- | echo -ati $me $+ : «7 $1- » | sapi.talk $iif($1,$1-,nothing) }
alias sps { .ctcp $active SPEECH $1- | echo -ati $me $+ : «7 $1- » }

ctcp *:speech:*:{
if %speech == 1 {
if # { echo # $timestamp $nick $+ 7@ $+ # $+ : «7 $2- » | .halt }
else { echo -ati $nick $+ : «7 $2- »
sapi.talk $regsubex($nick,/[^\w]/g,) : $iif($2,$2-,nothing)
.halt }
}
else echo -ati $nick $+ : «14 $2- » (/spon to activate Speech) | .halt
}

alias sapi.talk {
var %s = Spk. $+ $ticks,%a = $iif($1,$1-,nothing to say!)
.comopen %s SAPI.SpVoice
if !$comerr { .comclose %s $com(%s,Speak,3,bstr,%a) }
}

/spon to activate this shit, /spoff to set it off
With /sp you hear the voice reading the sentence you send, with /sps you hear nothing

P.S.
with high quality voices like AT&T or Loquendo this stuff is GREAT smile
Posted By: bwr30060 Re: Mirc & Vocal Synthesis - 14/12/06 03:45 AM
Yeah, you need to multithread applications to stop that from happening. I can't work on this right now, or during the day tomorrow, but if you can wait until over the weekend, I can write you a DLL that uses Microsoft Speech and would be multithreaded to avoid that problem. Let me know. smile

Also, let me know what other functions you want in the dll like "on" and "off" features and I'll see what I can do.
Posted By: yamaz Re: Mirc & Vocal Synthesis - 14/12/06 03:30 PM
Originally Posted By: bwr30060
Yeah, you need to multithread applications to stop that from happening. I can't work on this right now, or during the day tomorrow, but if you can wait until over the weekend, I can write you a DLL that uses Microsoft Speech and would be multithreaded to avoid that problem. Let me know. smile

Also, let me know what other functions you want in the dll like "on" and "off" features and I'll see what I can do.


It would be useful to choose if a sentence sent while another one is still playing can interrupt the first one or goes on queue. I hope it's clear, english is not my mother language smile
Posted By: bwr30060 Re: Mirc & Vocal Synthesis - 14/12/06 11:50 PM
I understand what you're saying. I'll have to think about how to do this. I got the basic part of the DLL done, but it's crashing mIRC even though it's threaded. I can't figure out why it's doing that yet. I'm not sure how I'd make a queue system either, but I'll think about it.

I'm currently using the DLL to read everything ON TEXT, so the problem could be that it's just too much text for the DLL to handle. If you wanted mIRC to say everything, you could just use the built in speech agent. Maybe this DLL will still work if I only use it in scripts that trigger on specific words. It depends on how you want to use this.
Posted By: sparta Re: Mirc & Vocal Synthesis - 15/12/06 12:04 AM
I liked this thing, but any way to speed up the text spoken a bit? smile "make it sound less robotic" smile playing around a bit with it, but cant figure out how to speed it up smile
Posted By: bwr30060 Re: Mirc & Vocal Synthesis - 15/12/06 12:54 AM
Yeah, you can change the speed. I'll have to add a new subroutine to the DLL to do that, but it shouldn't be hard. I don't think you can change the speed of the voice while it is talking, but you can change it and the change will take effect the next time it speaks. I'm looking at these new boards and wondering if there's a way to attach a file to the post, but I don't see it. I host a website on this computer, mostly for online avatars and sharing files like this, so I can just put a link to the two files you'll need once I add that other part.
I've been running this DLL some more and it hasn't crashed on me again. Maybe I'll post again with a link to it and the instructions on how to use it and anyone who wants to can get it and "beta test" it for me. smile
Posted By: bwr30060 Re: Mirc & Vocal Synthesis - 15/12/06 02:00 AM
I seem to be having problems using the DLL on the laptop. I wrote and published the DLL on this computer and I guess it automatically registered it with COM when it built. I used regasm, but /comopen still won't work on the laptop. Maybe it's because I haven't installed that specific version of the speech agent on the laptop. That seems like it shouldn't matter though, because I'm not even trying to use the speech agent DLL at that point, just trying to /comopen my own DLL. I'll look into it some more. I'd like to be able to write an installer package that you can run that would register the DLL on your computer, but I don't know if it can be done and how. Maybe tomorrow evening or this weekend, I'll install the speech software and try again to register the DLL.

If anyone wants to give this a try, you can get my DLL at My Microsoft Speech Agent DLL
You may also want the other DLL that goes with it, the Microsoft DLL for the Speech Agent. I don't know if that will even work. You might have to register both DLLs, or you may be better off installing the Microsoft SAPI seperately. If you want to get the Speech Agent DLL from me, you can get that here

I guess I should show you an example of how to use it. You'll get the idea from this small section.
Code:
on *:text:*:*:{
  if ($com(speech)) { noop $com(speech,speak,3,bstr,$1-)) }
}

On the START event, you'll need "comopen speech speech.speech". I haven't tested the section about changing the speed, but here's an example alias that should work.
Code:
alias changespeed {
noop $com(speech,speed,3,bstr,$2))
}


The values for speed are from -10 to 10.
Posted By: qwerty Re: Mirc & Vocal Synthesis - 15/12/06 02:34 AM
You don't need a dll for that, one just has to use $comcall instead of $com. All objects and methods are accessible via $comcall, including things like Rate (mentioned earlier under a different name).
Posted By: bwr30060 Re: Mirc & Vocal Synthesis - 15/12/06 02:46 AM
True, but in this case, we also need to multithred the process so that it does not freeze the computer. I could be wrong, but I don't think that there is any way to thread it using $comcall.
Posted By: qwerty Re: Mirc & Vocal Synthesis - 15/12/06 02:59 AM
Did you bother to look up $comcall in the help file?
Posted By: qwerty Re: Mirc & Vocal Synthesis - 15/12/06 03:01 AM
Don't do that again, ever.
Posted By: bwr30060 Re: Mirc & Vocal Synthesis - 15/12/06 03:03 AM
Ah. Sorry, I had forgotten about that. I'll have to look into that some more. I haven't been doing much mIRC scripting lately, so I don't even remember how I'd do that, as in what alias to call in this situation and what data to pass it.

Quote:
Don't do that again, ever.
Huh?
Posted By: qwerty Re: Mirc & Vocal Synthesis - 15/12/06 03:16 AM
That wasn't for you, it was about yamaz's thread-bumping (see "Re: yamaz" on the titlebar of my previous post).
Posted By: bwr30060 Re: Mirc & Vocal Synthesis - 15/12/06 03:27 AM
Ah ok. I was going to say, if I had to worry about not making stupid scripting mistakes, I'd be in serious trouble! grin

Code:
var %x = 1
while (%x > 1) {
echo -a oops!
inc %x
}

grin
Posted By: qwerty Re: Mirc & Vocal Synthesis - 15/12/06 04:09 AM
Better yet, /sapi.talk oops! whistle
Posted By: yamaz Re: Mirc & Vocal Synthesis - 15/12/06 11:52 AM
Originally Posted By: bwr30060
I'm currently using the DLL to read everything ON TEXT, so the problem could be that it's just too much text for the DLL to handle. If you wanted mIRC to say everything, you could just use the built in speech agent. Maybe this DLL will still work if I only use it in scripts that trigger on specific words. It depends on how you want to use this.


No no, mirc has not to say everything, but only what I send/receive through that "SPEECH" ctcp smile It's basically for fun smile

@sparta: to have a better voice you have to install some professional voices like AT&T Natural Voices or Loquendo
Posted By: bwr30060 Re: Mirc & Vocal Synthesis - 16/12/06 05:02 AM
Ah, then in that case, the DLL should probably work fine.
Posted By: yamaz Re: Mirc & Vocal Synthesis - 18/12/06 11:58 AM
I'll try the .dll. In the meantime I don't get how to use $comcall in this script we already have:

alias sapi.talk {
var %s = Spk. $+ $ticks,%a = $iif($1,$1-,Non ho niente da dì!)
.comopen %s SAPI.SpVoice
if !$comerr { .comclose %s $com(%s,Speak,3,bstr,%a) }
}

If i just change $com with $comcall i get the error "* Invalid parameters: $comcall (line 234, custom.ini)"
Posted By: yamaz Re: Mirc & Vocal Synthesis - 21/12/06 12:04 PM
Any help?
© mIRC Discussion Forums