Announcement

Collapse
No announcement yet.

Alert.playSound()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Alert.playSound()

    Quick question about the Alert.playSound() function.

    I'm trying something that sometimes plays a very short sound multiple times in a row in the main() function before returning. Sometimes I hear the multiple sounds and other times it just plays the sound once.

    Is the Alert.playSound() function synchronous or asynchronous? If the latter, is there a way to force it to be synchronous?

    Thanks!
    Standing on the shoulders of giants.

  • #2
    Hi Guy,

    Chris Kryza put together a dll, then he accesses it via the dsPlayWAV() function which is part of one of his libraries. Other than something like this, you are limited in the efs environment. Hopefully, Chris's function will work for you.

    Comment


    • #3
      Hi Steve - thanks for the reply.

      I tried his function a few days ago and couldn't get it to work but I'll take another shot at it this weekend.

      I saw in another thread that DionLoy said (or suggested) that the playSound function spawned another thread which would indicate to me that the main() function could continue processing while the sound was playing and it wouldn't stop eSignal.

      I was trying to figure out why this functionality of mine sometimes works and sometimes doesn't. Basically I've got something like:

      for i = 1 to x
      playSound

      and x could be anything from 1 to 10 - sometimes I hear the 10 sounds 1 after another and sometimes not...
      Standing on the shoulders of giants.

      Comment


      • #4
        Pause

        I think u need to pause between calls, if Esignal playsound is like all the other playsound's, you need to give the cptr time to play ur sound, and process other events, before you call it again.

        It's probably easier to record multiple copies of your sound and call them directly, eg:

        mySound1.wav 2 kb (tick)
        mySound2.wav 4 kb (tick tick)
        mySound3.wav 6 kb (tick tick tick)

        playmySound(nSound)

        switch nSound{
        ....

        You can probably create the sounds in DOS, you just need to append the sound to itself.

        Comment


        • #5
          Good idea kztd - I might just try that.

          Apologies to Steve - still haven't had a chance to look at Chris' wave playing funciton again but I think it's going to have this same asynchronous problem.
          Standing on the shoulders of giants.

          Comment

          Working...
          X