speaker on the PC switched on

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
keyeyey1
Posts: 23
Joined: 29 Oct 2023, 17:37

speaker on the PC switched on

Post by keyeyey1 » 23 May 2024, 02:18

I have a script that reads a text. Unfortunately I have a problem: If the speaker on the PC is switched off, it doesn't work. Can anyone give me a hint ?

Code: Select all

@echo off
  rem Umlaute erlauben
chcp 65001>nul
  rem pfad für das Hilfsscript
set "sayJS=%temp%\say.js"
set "Speed=-1"
set "Volume=80" 
echo s=new ActiveXObject('SAPI.SpVoice');s.Rate=%Speed%;s.Volume=100;a='';for (i=0;i^<WScript.Arguments.length;i++){a+=WScript.Arguments(i)+' '};s.Speak(a,0)>"%sayJS%"
set talk=cscript //nologo "%sayJS%"


%talk% Hello
reddyshyam
Posts: 55
Joined: 24 Jul 2023, 04:34

Re: speaker on the PC switched on

Post by reddyshyam » 23 May 2024, 02:25

Hi,

Please check if its muted then turn it on.

Code: Select all

			isMute := SoundGetMute()		
			
			if isMute {
				SoundSetMute false
			}
On second look, that doesnot even look like AHK script but bat. Why are you asking here?
gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: speaker on the PC switched on

Post by gregster » 23 May 2024, 02:29

@keyeyey1, you are aware that this is not an AHK script?
I mean, there are similar ways to use the SAPI voice per AHK but what do you expect from a "switched off" speaker? To magically switch on?
Edit: Or did you mean it's muted like reddyshyam assumed above?
User avatar
boiler
Posts: 17399
Joined: 21 Dec 2014, 02:44

Re: speaker on the PC switched on

Post by boiler » 23 May 2024, 07:30

Somewhat related, I have yet to find a way to get my scripts to run when my computer is switched off. ;)
Post Reply

Return to “Ask for Help (v2)”