In windows
import winsound duration = 1000
Where the frequency is the frequency in Hz and the duration in milliseconds.
On Linux (and Mac)
import os duration = 1
To use this example, you must install sox .
On Debian / Ubuntu / LinuxMint, you need to run in your terminal:
sudo apt install sox
Here is the macports way to do it ... run this your terminal:
sudo port install sox
Speech on Mac
And something is really cool, if you use a Mac in a terminal, you can probably do the same on Windows, but I only know for mac only, it will tell you that it is done:
import os os.system('say "your program has finished"')
It's about Linux
import os os.system('spd-say "your program has finished"')
You need to install the speech-dispatcher package on Ubuntu (or the corresponding package on other distributions):
sudo apt install speech-dispatcher
Ryan Saxe May 15 '13 at 19:23 2013-05-15 19:23
source share