PlaySound not playing sound.

 
//+------------------------------------------------------------------+
//|                                                  Trade_Alert.mq5 |
//|                                  Copyright 2024, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
/*
enum choice
  {
   thisOne,
   orThisOne,
   ornoThisOne
  };*/

input int             tickCount = 10; //Check every number of ticks
sinput string group1 = "Message Box";
input string increaseTradeCount = "a New Trade has been Opened."; //when less trades since prev Count
input string decreaseTradeCount = "a Trade has been Closed."; //when more trades open prev Count
string incCntComment = increaseTradeCount;
string decCntComment = decreaseTradeCount;
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   static int prevCount;
   static uint prevTickCount;
   int newCount = PositionsTotal();
   uint newtickCount = GetTickCount();
   if(newCount<1 || newtickCount<prevTickCount+10)
      return;
   if(newCount>=1 && prevCount==newCount)
      return;
   if(newCount>prevCount)
      myAlert();
   else
      myAlert(true);
   prevCount=newCount;
   prevTickCount=newtickCount;
   return;
  }
//+------------------------------------------------------------------+
bool myAlert(bool closed = false)
  {
   if(closed)
     {
      string sound = "news.wav";
      PlaySound(sound);
//      Alert(decCntComment);
     }
   else
      Alert(incCntComment);
   return false;
  }
//+------------------------------------------------------------------+

The sound is not playing when closed is true. But Alert does if i remove my //.

I have a portable mt5 terminal. all sounds work on the terminal otherwise.

I have checked the resouces page in help documents. nothing jumps out at me.

 
Michael Charles Schefe:

The sound is not playing when closed is true. But Alert does if i remove my //.

I have a portable mt5 terminal. all sounds work on the terminal otherwise.

I have checked the resouces page in help documents. nothing jumps out at me.

check you have put the sound file in the Sounds folder

 
string sound = "news.wav" ;

is available on both machines?

 
Paul Anscombe #:

check you have put the sound file in the Sounds folder

yes it is there. and i have heard news.wav when news occurs in calendar.

Gerard William G J B M Dinh Sy #:

is available on both machines?

explain "both machines".

 
Michael Charles Schefe # :
explain "both machines".

The sound file is present in the same directories on both machines? The one that works and the one that doesn't?