PlaySound dont play my sound

 

I was new here and would say hello with a question about a problem i have with PlaySound

First ..  Hello MQL community  ..(^_^)*

Ok now the problem.

I've developed a EA to give me specific sound at specific price.

I want diffrent sounds to do this. .. So i can hear the way the course go and i must not always look at monitor ;)

I use the OnTick() to catch the price for my alarm system.

The line for heighter as price is ..

PlaySound(TerminalInfoString(TERMINAL_PATH)+"\Sounds\ok.wav");

and for lower price ..

PlaySound(TerminalInfoString(TERMINAL_PATH)+"\Sounds\stops.wav");


Now ... MT5 dont play the specific sound.

MT5 play a sound .. but i dont know wich sound file they play .. its the same sound for both PlaySound's

I've checked ok.wav and stops.wav with winamp .. tey are diffrent as i hear from EA.

I've cheded also the path to the file .. all is ok with this.


Where is the problem ?  O_o


THX for help

        MajorDad

 
The reason is path that you specified.
Function is looking for and playing sound file that is placed inside folder "Sounds" (or its subfolder) of client terminal. So you shouldn't specify full path to file, only relative path from folder "Sounds".
 

Hello alexvd

Thank you .. i changed now the playsound line to :

PlaySound("stops.wav");

PlaySound("ok.wav");


All work fine now ;)