PlaySound not working

 

When I try to play sound using code it doesn't work.

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   if(!PlaySound("alert"))
      Print("Failed to play sound");
  }
//+------------------------------------------------------------------+

But when I set price and time alerts on the charts, the sound works well. What could be the problem?

 
Murray Mbugua: What could be the problem?

You have no “alert” file in the Sounds folder. Perhaps you should try “Alert.wav”

 
William Roeder:

You have no “alert” file in the Sounds folder. Perhaps you should try “Alert.wav”

it is still not working. and its not only the "Alert.wav" file. none of them work.

It used to work before then it just stopped for some reason.

Let me try to uninstall and reinstall the terminal to see if there will be any difference.

 
Murray Mbugua: none of them work. Let me try to uninstall and reinstall the terminal to see if there will be any difference.

Try going to the sounds folder and click on one. If it doesn't play, your speakers are muted.

 
void OnStart()
  {
   if(!PlaySound("alert"))
      Print("Failed to play sound");
  }

Does it print?

 
Keith Watford:

Does it print?

Yes it was printing. But I have just fixed it using a simple reinstallation. thanks.

Reason: