Can't get the PlaySound function right

 

Hi, i made an expert, and i desired to play a sound every time the expert buy.
So, i added this line, but it does't work:

PlaySound("buy_alert");

Note that i hear a sound if i place it inside of the OnDeinit function.
But i don"t hear any sound when i place it inside the function that create a buy order. Here is the function:

void PlaceBuyOrder(double lotSize, double takeProfit, double stopLoss, bool takeProfitAsDistance = true, bool stopLossAsDistance = true)
{
   if (Not(cumulateOrders))
   {
      if (PositionsTotal() != 0)
      {
         Print("There is already an open position. Cannot open another trade.");
         return;
      }
   }
   
    currentPositionType = "long";
    double price = SymbolInfoDouble(symbol, SYMBOL_ASK); // Get current ask price

    // Calculate the required stop loss and take profit levels
    double slPrice = stopLoss;
    double tpPrice = takeProfit;
    
    if (stopLossAsDistance)
    {
      slPrice = price - stopLoss;
    }
    
    if (takeProfitAsDistance)
    {
      tpPrice = price + takeProfit;
    }

    // Prepare trade request
    MqlTradeRequest request = {TRADE_ACTION_DEAL};
    request.action = TRADE_ACTION_DEAL; // Trading action
    request.symbol = symbol; // Trading symbol
    request.volume = lotSize; // Volume of the trade
    request.type = ORDER_TYPE_BUY; // Order type
    request.price = price; // Price of the order
    request.sl = slPrice; // Stop Loss
    request.tp = tpPrice; // Take Profit
    request.deviation = 3; // Deviation
    request.type_filling = ORDER_FILLING_FOK; // Order filling type
    request.magic = MagicNumber;

    // Send the trade request
    MqlTradeResult result = {0};
    if(OrderSend(request, result))
    {
        PlaySound("buy_alert"); // ITS HERE, BUT IT DOES'T PLAY ANY SOUND
        Print("Buy order placed successfully at ", price);
        Print("Stop Loss: ", slPrice, " | Take Profit: ", tpPrice);
    }
    else
    {
        Print("Error placing buy order: ", GetLastError());
    }
}
 

that's silly to expect a text "buy_alert" to play a sound

The software won't understand what "buy_alert" is. The software understands by default the system sounds such as "alert.wav"

PlaySound("alert.wav");

You have to add sounds to the MQL5\Files folder if you want to use your own sounds, and then you must load them as a resource.