Playsound error in MQL4

 
Playsound in MT4
MQL4 has a bad error: Playsound does not work inside of loops.
..
Playsound ("catsway");   // works well
for (i=0; i...; i++)
{
 if (i==...)  // about once per hour
 {
  Playsound (dog.wav")  // never works
 }

Who can help me with an idea or better a  workaround. Please send me an message, 
Thanks in advance
Ralph
 

No "bad error." Looping is irrevalent. The latest Playsound stops the previous one.

Likely, you started dog, returned, and got an immediate tick stopping dog and starting cat. In EAs, a sleep after dog fixes.

Or you run your code on multiple charts and are always starting cat, etc. In EAs, a mutex surrounding the play and sleep fixes.
          Prevent EA from opening trades at the same time across two or more pairs? (Steve) - MQL4 programming forum 2016.06.21

 
rarigerm:
Playsound in MT4
MQL4 has a bad error: Playsound does not work inside of loops.
..
Playsound ("catsway");   // works well
for (i=0; i...; i++)
{
 if (i==...)  // about once per hour
 {
  Playsound (dog.wav")  // never works
 }

Who can help me with an idea or better a  workaround. Please send me an message, 
Thanks in advance
Ralph

You are a bad error, typos and inaccurate = Playsound (dog.wav") ???

 
William Roeder:

No "bad error." Looping is irrevalent. The latest Playsound stops the previous one.

Likely, you started dog, returned, and got an immediate tick stopping dog and starting cat. In EAs, a sleep after dog fixes.

Or you run your code on multiple charts and are always starting cat, etc. In EAs, a mutex surrounding the play and sleep fixes.
          Prevent EA from opening trades at the same time across two or more pairs? (Steve) - MQL4 programming forum 2016.06.21

Dear William,
the code is only to expain my problem. Playsound is a very small part of a indicator for the stock market which runs 24 hrs. It occurs 1 or 2 times a day. There is no EA. And it is only one chart.
Can I "reset Playsound " in any way? What shall I do?
Thanks for help in advance.
Ralph
Reason: