Make a noise in GAMS Topic is solved

questions about GAMS' tools
Post Reply
moosavi_69
User
User
Posts: 21
Joined: 3 years ago

Make a noise in GAMS

Post by moosavi_69 » 1 month ago

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: 504
Joined: 4 years ago

Re: Make a noise in GAMS

Post by bussieck » 1 month ago

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: 6
Joined: 1 year ago

Re: Make a noise in GAMS

Post by mkbonde » 1 month ago

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