New games every week!
JSE - Say
19th September 2021  
I added the ability for Text-To-Speech into the JSE engine yesterday.

-=-=-

Javascript has a Speech API, so I figured I might as well give it a go.
It "kinda" works...

This stuff has been in Shoebox and Browsercade, unused, for AGES.. But with the exact same issue, which is that on iOS you can't programatically trigger the speech.
That is, you can't go "Say this!!" and have it just say it.
Instead, you can only "Say this!!" when there's a touch based event happening.

If, say, you made a gamepad based shoot-em-up, then had a powerup and coded it to Say "Double Shot", then it'd work on pretty much everything.. .. Except on iOS Safari, because of these silly rules.
On iOS Safari, it'll sit there with "Double Shot" in the buffer, until you tap the screen.
But I've done what I can, and it seems silly to ignore this functionality just for one particular system.

// Talky Tester // by Jayenkai // Created 2021/9/18 Graphics 1024,768,1 Repeat CLS;ResetDraw();SetFontSize 16 mh=MouseHit() c=VoiceCount() If c==-1 Print "Speech currently unavailable" Print "Try clicking the screen" Endif If c>-1 For n=0 to c nm$=VoiceName$(n) y=(n+1)*22 If MouseIn(512,y,1024,20,1)>0 then SetCol 40,80,120:Rect 512,y,1024,20,1:SetCol 255,255,255 Text 512,y,"["+n+"] - "+nm$,1 If MouseIn(512,y,1024,20,1)>0 and mh>0 Say "Hello! My name is "+nm$+", and I am a computer voice. Question?",n Endif Next Endif Flip Forever


For now it only handles English. I'm currently trying to figure out the best way to do none-english. It's kinda hard to "Say" and "Print" the same thing, due to the oldskool fonts being in crazy incompatible Upper-ASCII layouts.
Hmmm..
I'm working on it, though...

Views 39, Upvotes 0
Daily Blog , Jse
New games every week!
Site credits : PHP script, Blog posts, Games, Music, Pixelart, Poems and More : Jayenkai
(c) Jayenkai 2017 and onwards, site design Rychan. RSS feed
Blog - JSE - Say - AGameAWeek