Make a noise in GAMS Topic is solved

questions about GAMS' tools
Post Reply
moosavi_69
User
User
Posts: 31
Joined: 6 years ago

Make a noise in GAMS

Post by moosavi_69 »

Hello,

Is there any way to make a noise in GAMS at the end of a code (solving an MIP model)? I do not want to check the GAMS environment back and forth to see whether the solving process has been completed.

Best, Amir
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Make a noise in GAMS

Post by bussieck »

Never heard a request like this before... GAMS does not make noises but you can execute any program with execute. Here is a way to play a wav file (on Windows):

Code: Select all

...
solve mymodel us lp min z;
execute 'powershell -c (New-Object Media.SoundPlayer "C:\Windows\Media\notify.wav").PlaySync();'
-Michael
mkbonde
User
User
Posts: 8
Joined: 4 years ago

Re: Make a noise in GAMS

Post by mkbonde »

You could also use the embedded code feature to run a python snippet - there are a bunch of text to speech libraries out there.

Code: Select all

$onEmbeddedCode Python:
    import pyttsx3
    engine = pyttsx3.init()
    engine.say("I will speak this text")
    engine.runAndWait()
$offEmbeddedCode
Post Reply