Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:36 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Speech in MMBasic for Windows

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 06:23pm 18 Jul 2022
Copy link to clipboard 
Print this post

I haven't implemented SAM in MMB4W as you can use the OS for Text2Speech. Here is how:

q$=chr$(34)
a$="powershell -command "+q$+"Add-type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak"
t$="Hello world"
s$="('"+t$+"');"+q$
system a$+s$
do
loop


Lines 2 and 3 are one line with a space between them.
Tested on W11. Make sure you have TTS enabled through system settings (choose the voice you like). Any questions use google.
Edited 2022-07-19 04:32 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 08:55am 19 Jul 2022
Copy link to clipboard 
Print this post

Hi Peter,

For what it's worth (possibly very little) even thought this solution provides ostensibly better results I would have done otherwise and implemented PLAY TTS as close to the CMM2 as possible.

Why ?

Given the other "superior" BASICs (and other development environments) available on Windows it is my opinion that if MMB4W has any purpose* beyond keeping you entertained for the first few months of this year then it is as a simulator of the CMM2 which means trying to simulate the function of the CMM2 as best as possible. In this particular case I know that Lance was trying to run a CMM2 game written by @TimD for the MMBasic Programming Challenge and I suspect using the SYSTEM method would produce significantly different (though possibly better) results.

* Excluding being used as the eccentric front-end for a geothermal heating system.

Just my 2p, it is after all your wheelhouse and I have my own windmills to tilt at,

Tom
Edited 2022-07-19 19:00 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 09:21am 19 Jul 2022
Copy link to clipboard 
Print this post

sub playtts(t$)
static q$=chr$(34)
static a$="powershell -command "+q$+"Add-type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('"
static s$="');"+q$
system a$+t$+s$
end sub
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 09:29am 19 Jul 2022
Copy link to clipboard 
Print this post

  matherp said   ...


Hi Peter,

My grandmother thanks you for the egg sucking lesson , but my point was that it is a less useful simulation if you have to change the code.

Also the "built-in" Windows TTS is much more capable than that of the CMM2 so the workaround isn't an accurate simulation.

That aside, that is pretty cool; it never occurred to me that you could do that sort of sh*t ... but then I never was a Windows (or for that matter Linux) aficionado.

Best wishes,

Tom
Edited 2022-07-19 19:30 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 11:25am 19 Jul 2022
Copy link to clipboard 
Print this post

Thank you Tom and Peter. Yes, I am using MMBasic for Windows as a CMM2 simulator, and yes, I'm trying to run @TomD's FactorFracture.bas with its Text To Speech, and, yes, when I've worked through the challenge '22 programs, I'll get back to Paul_L's geothermal controller.

FWIW, we both think this version with a mashup of MMBasic for Windows and PicoMite is much closer to a solution than what we've tried before, in part because it enables the biggest screen possible to suit Paul's eyesight.

And yes, it's eccentric. The whole thing, working now for many years but without feedback as to exact temperatures and timings, was designed and built by Paul. It's quite the apparatus without any microcontroller at all. He wants to provide intelligence and real-time monitoring, and that's where MMBasic comes in.

(By the way, Peter's TTS code worked perfectly and I've moved on to what may be another issue with how perfectly mMMBasic for Windows simulates the CMM2.)
Edited 2022-07-20 01:17 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 949
Posted: 06:30am 20 Jul 2022
Copy link to clipboard 
Print this post

You can download a Windows executable SAM here:
S.A.M.

Does this perhaps help? The TTS in the Picomite is based on this code...

Frank
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 07:55am 20 Jul 2022
Copy link to clipboard 
Print this post

  Frank N. Furter said  You can download a Windows executable SAM here:
S.A.M.

Does this perhaps help?

Thanks for the link Frank ... doesn't really help, except possibly as to what I will use if I ever get around to adding sound to MMB4L.

I guess this was really a conversation about what MMB4W is ... it is of course what Peter decides it is since he is the only one contributing to it (likewise me c.f. MMB4L).

  Frank N. Furter said  The TTS in the Picomite is based on this code...


According to it's source code the PicoMite does not have PLAY TTS; I suspect you mean the CMM2.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 07:58am 20 Jul 2022
Copy link to clipboard 
Print this post

Speaking of MMB4L, you can easily get TTS by installing 'espeak' and then in MMBasic it is just:

SYSTEM "espeak 'Hello World'"


... but if I ever add PLAY TTS it will have the option to use the same "8-bit" speech engine as the CMM2.

Best wishes,

Tom
Edited 2022-07-20 18:00 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025