How can I programmatically enable and disable sounds for alerts

 

I know that alert sounds can be manually enabled and disabled through Tools>Options>Events in mt5. 

I am trying to figure out how I can play alert sounds only when specific conditions have been met. In all other cases alarm sounds should be off.

 
Jackery:

I know that alert sounds can be manually enabled and disabled through Tools>Options>Events in mt5. 

I am trying to figure out how I can play alert sounds only when specific conditions have been met. In all other cases alarm sounds should be off.

  1. Turn off sound events in MT5 Options.
  2. Write an indicator that will play sound alerts only when your specific conditions are met.
 
Marcin Madrzak #:
  1. Turn off sound events in MT5 Options.
  2. Write an indicator that will play sound alerts only when your specific conditions are met.

I am actually working on an EA in MQL5. I just tried calling

PlaySound("decay.wav");

but it doesn't work.

 
Jackery #:
PlaySound("decay.wav");

I changed the .wav fileame and its working now.