Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Breaking out of a Shell
#1
I'm trying to use a stripped-down version of the shell Text To Speech sub that was posted some time ago...

Sub speak (message As String)
    Shell _Hide "Powershell -Command " + Chr$(34) + "Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('" + message + "');" + Chr$(34)
End Sub

... and it works very well.
But I want to use it to speak the instructions for a game, which has several short paragraphs, and I want the user to be able to halt the speech after
any paragraph and return to the game. I've tried using a few variants of _Keyhit>0 and Inkey$<>"" but none seems to be recognized while the speech is in progress, presumably because I'm still in Shell. Any suggestions on how to do this (simply) would be appreciated. Huh
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


Messages In This Thread
Breaking out of a Shell - by PhilOfPerth - 07-01-2025, 11:30 PM
RE: Breaking out of a Shell - by SMcNeill - 07-02-2025, 12:31 AM
RE: Breaking out of a Shell - by PhilOfPerth - 07-02-2025, 02:59 AM
RE: Breaking out of a Shell - by NakedApe - 07-02-2025, 01:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  code locks up when SHELL paulel 4 261 02-15-2026, 08:04 PM
Last Post: madscijr
  Shell issues eoredson 7 1,319 05-10-2025, 02:59 AM
Last Post: eoredson
  Using shell to delete a file PhilOfPerth 7 1,512 04-25-2024, 05:04 AM
Last Post: PhilOfPerth
  Having trouble Windows command line SORT via SHELL GTC 19 4,368 08-26-2023, 04:19 AM
Last Post: GTC
  SHELL creates unicode file, can't read correctly with LINE INPUT thesolarcode 3 1,220 05-06-2023, 09:41 PM
Last Post: thesolarcode

Forum Jump:


Users browsing this thread: 1 Guest(s)