Consecutive PlaySound()

thread: Consecutive PlaySound()

  1. #1
    Junior Member calda's Avatar
    21

    Consecutive PlaySound()

    I want to play 2 sounds consecutively

    I attempted:
    If...
    PlaySound(Sound1); PlaySound(Sound2);,

    but just Sound2 was played.

    Then I attempted:
    PlaySound(Sound1); Sleep(1000);PlaySound(Sound2);,
    and nothing changed.

    Help!

  2. #2
    Junior Member alitaoxrgog's Avatar
    26
    I wish to play two sounds consecutively I tried: If... PlaySound(Sound1); PlaySound(Sound2);, but only Sound2 has been performed. I then tried: PlaySound(Sound1); Sleep(1000);PlaySound(Sound2);, and nothing changed. Help!
    firstly, keep in mind that nothing else is occurring whilst it's in sleep mode, no processing at all of the EA

    secondly, if you analyzed it in the egy tester afterward Sleep command is ignored from the tester.

    Thirdly, you can just join the sound files together instead, otherwise as the other poster said you need to sleep long enough for the first sound to playwith.

  3. #3
    Junior Member calda's Avatar
    21
    @rayzeel This does work, however, the time is integer (seconds)... and even 1 second gap between sounds feels like eternity.

    @
    remember nothing else is occurring whilst it is in sleeping mode, no processing at all the EA
    It is just an indior. Sleep() for indior could be great.

    you could just join the audio files together instead, otherwise as the other poster stated you need to sleep long enough to the first audio to play
    It is not convenient, because those audio files seem like euro”,ozzie or breakout, pinbar. Firstly intonation of all e.g. ozzie breakout collectively does not seem good. I would need audio files.

  4. #4
    oxr?a2000oxray
    Guest
    @rayzeel This will work, however the time is integer (seconds)... as well as 1 second gap between sounds feels like eternity. @ quote It is simply an indior. Sleep() for indior could be great. quote It isn't convenient, because those audio files seem like euro”,ozzie or breakout, pinbar. Firstly intonation of all e.g. ozzie breakout together doesn't seem great. Secondly I would need files.
    ARTjoMS-
    Why not record your own sound file. Place long as pause/delay between each as you require.

  5. #5
    Junior Member calda's Avatar
    21
    @Why not list your audio file. Place so long as pause/delay betwen each as you need.
    Man...
    1) The software I am using for thos .wav documents is very straightforward and does not let me change gap between words. It is basically just textsound.

    2) I don't possess a micraphone, but even if I had 1) My voice would not sound that good 2) Not sure if I could get .wav documents and what will the quality be.

  6. #6
    Hey art.... Stringing playsound()s together can be a real pain.... If the alerts are only occasional and the wav files are short it marginally easier....

    Have you ever attempted coder gurus speak dll....

    What appliions are you using in text to speak.... Sometimes just putting spaces between words after words will place in gaps....

    If you use sleep(), you must by trial and error find the proper delay worth.... A few examples of approaches I use below....

    Coderguru's dll is undoubtedly the best method I have found.... H

    //-----
    Inserted Code //PlaySound(pair#91;m93;-RRB-; Sleep(2000); PlaySound(period #91;0#93;-RRB-; Sleep(500); PlaySound(dir#91;1#93;-RRB-; alerted#91;m#93;#91;l#93;#91;0#93; # 1; //gSpeak(New tf#91;l#93; min it symlists#91;m#93; Buy); Caution #91;m#93;#91;l#93;#91;0#93; # 1; //PlaySound(pair#91;m#93;-RRB-;PlaySound(time#91;l#93;-RRB-;PlaySound(dir#91;0#93;-RRB-; Caution #91;m#93;#91;l#93;#91;0#93; # 1; //Alert(New,tf#91;l#93;,, symlist#91;m#93;, Buy); Caution #91;m#93;#91;l#93;#91;0#93; # 1; // gSpeak(New tf#91;l#93; min it symlists#91;m#93; Buy); Caution #91;m#93;#91;l#93;#91;0#93; # 1; //gSpeak(New tf#91;l#93; min it symlists#91;m#93; Buy); //gSpeak(New tf#91;l#93; min it symlists#91;m#93; Economy );

  7. #7
    Junior Member edulcor's Avatar
    24
    Because all was done at the same time. You have to wait but utilize the TimeCurrent().

    Inserted Code int seconds_gap = 2; static datetime temptime; static int secondsound; if(...) PlaySound(1); secondsound = 1; temptime = TimeCurrent() seconds_gap; if(TimeCurrent()gt;=temptime secondsound==1) PlaySound(2); secondsound=0;
    This ought to work. Ive made it that one for a single guy. You have to just contemplate how long is sound one. This is of course solution for indiors because Sleep() function works only in expert advisors (there's a note in documentation).

  •