1

Right now I am using the command:

system("say Hello World!")

to have the system say "Hello World!".

How do I decrease the volume?

GregyPooh
  • 71
  • 6
  • 1
    it's not a python question. Check `say` manual. – Jean-François Fabre Mar 22 '17 at 20:53
  • These questions may help you: [Adjust OSX System Audio Volume in Python](http://stackoverflow.com/questions/2565204/adjust-osx-system-audio-volume-in-python) and [How to programmatically set volume in Windows, Mac and Ubuntu?](http://stackoverflow.com/questions/1920749/how-to-programmatically-set-volume-in-windows-mac-and-ubuntu) – ovs Mar 22 '17 at 21:00

1 Answers1

2

You can use the osascript utility to set the system volume before invoking say:

system("osascript -e 'set Volume 1'")
system("say Hello World!")
Emil Laine
  • 41,598
  • 9
  • 101
  • 157
  • 1
    Indeed, this will do as asked and set the systems volume (and thus also lowering the volume of the systems voice). Fun note: you could also go to `System Preferences > Accessibility > select Voice on the left side > System Voice menu > select Customize > select Whisper > press OK` now your Mac will download this voice and you could do `system("say -v Whisper Hello World!"`) – Montmons Mar 22 '17 at 21:03
  • I just came here to say I followed the advice to enable the "whisper" voice and it's incredibly creepy. I'm still keeping it, but man is it creepy. – oreoshake Nov 03 '18 at 00:45