Author Topic: text to speech server addon...  (Read 934 times)

SO, i have a terrible idea.
someone should make a text to speech addon for blockland.
why ? you see, i don't know.
but anyways
it should come with three voices.
-MICROSOFT SAM (MAI ROFL COPTR GOES)
-arbiter (-insert arbiter line from arby and cheif-)
-random female voice (if we don't have a female voice we will get social justiced on TUMBLR !)
AND IF THEY PRE ORDER NOW THEY GET
-astronaut (john madden)

NOW GET ME DAT stuff



That add-on has issues with stuff, especially that it constantly uses your clipboard to copy the text, I remember Zapk released his "everything" zip folder and it has a text to speech in it without you using a 3rd party program, but it does use a website, so if the website is broken, you can be screwed.

Here's a non-3rd party add-on: https://www.dropbox.com/s/uc2tm9h6kaf8rj7/Client_TextToSpeech.zip?dl=0
I made a little edit so it doesn't cloud up your folder with "Hi", "hI", "HI", "hi", etc

Your only options for tts in blockland is connecting to something external, either a web service or a locally running program. Both of which are easy to set up, but they both have their downsides: web services won't work if the web service is inaccessible (down, or you have no internet connection) and external programs require an extra step to set up each time

Both the above links do one of the two
« Last Edit: November 17, 2015, 03:08:47 PM by Headcrab Zombie »

Your only options for tts in blockland is connecting to something external

Not entirely true...
You can get sound files for all the phonemes, use a phoneme dictionary like this one
http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/, then its just a matter of looking up a word someone says in the dictionary and playing the sounds one after another.

Oh look. Random code. Wonder what it does...
Code: [Select]
exec("./timing.cs");
$Phonemes = "AA AE AH AO AW AY B CH D DH EH ER EY F G HH IH IY JH K L M N NG OW OY P R S SH T TH UH UW V W Y Z ZH";

for(%i=0;%i<getWordCount($Phonemes);%i++)
{
%a = getWord($Phonemes,%i);
eval("datablock AudioProfile(Phon_"@ %a @") { filename = \"Add-ons/Server_ChatSpeech/Phonemes/Phon_"@ %a @".wav\"; description = AudioClosest3d; preload = false; }; ");
}

%pfile = new FileObject();
%pfile.openForRead("Add-ons/Server_ChatSpeech/cmudict.txt");
while(!%pfile.isEOF())
{
%a = %pfile.readline();
$SpeechDict[firstword(%a)] = getwords(%a,2);
}
%pfile.close();

package ChatSpeech
{
function serverCmdmessageSent(%client, %text)
{
parent::serverCmdmessageSent(%client, %text);
echo(%text);
chatSpeech(stripChars(%text,"!@#$%^&*()_+=-,.?"));
}
};

function chatSpeech(%text,%tpos,%wpos)
{
//echo(%text,%tpos,%wpos);
if(%tpos$="")
{
%tpos=0;
%wpos=0;
}

if(%tpos<getWordCount(%text))
{
%a = $SpeechDict[getWord(%text,%tpos)];
if(%a!$="" && %wpos<getWordCount(%a))
{
%b = getsubstr(getWord(%a,%wpos),0,2);
for(%i=0;%i<clientGroup.getcount();%i++){eval("clientgroup.getobject("@%i@").play2d(Phon_" @ %b@");");}
$ChatSpeech = schedule($Speech[%b],0,chatSpeech,%text,%tpos,%wpos++);
}
else
$ChatSpeech = schedule(100,0,chatSpeech,%text,%tpos++,0);
}
}

activatePackage(chatSpeech);