logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Sound doesn’t loop properly

    Scheduled Pinned Locked Moved
    Fixed
    4
    8
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LupoL
      Lupo
      last edited by

      I have imported a loopable wav file and I start the sound and directly call it again and again once finished but when it finished the furst time there is a small lag (silence for a few miliseconds) and then it starts from the beginning. This is only at the first end. After the second end it timely starts again without lag.

      1 Reply Last reply Reply Quote 0
      • LupoL
        Lupo
        last edited by

        The same happens when connecting two play sound behaviours: the second should start immediately after the first has finished but there is always a lag before starting the second sound.

        Aidan_FireA 1 Reply Last reply Reply Quote 0
        • Aidan_FireA
          Aidan_Fire @Lupo
          last edited by Aidan_Fire

          @lupo What is the sound? Is it music? Even if it's not, you could try using the Play Music behaviour in the Scene tab which has a loop option. You're right though you'd think there wouldn't be a delay since you haven't put any delay between them.

          Another option would be to find out the exact length of your sound and use a Timer with that length as its delay to play the sound. This way would work with your other post about high pitch sounds if you can figure out the exact duration.

          LupoL 1 Reply Last reply Reply Quote 0
          • LupoL
            Lupo @Aidan_Fire
            last edited by

            @aidan-oxley Thanks for the hint. The sound is not music and a music is already playing. The sound is a car engine sound which increases the pitch if driving faster and lower if driving slower. So the idea with the timing needs to be calculated for all the possible steps which is very tedious.

            1 Reply Last reply Reply Quote 0
            • MurtazaM
              Murtaza Admin
              last edited by

              The problem is that by the time you trigger the behaviour again, there is a delay. Executing behaviours isn't instant. It takes a cpu cycle for it to trigger (or more depending on other behaivours) so this is what's causing the timing issue.

              I think @Hamed will need to add a loop function into the behaviour like we do with play music.

              LupoL 1 Reply Last reply Reply Quote 1
              • LupoL
                Lupo @Murtaza
                last edited by

                @murtaza But how do you explain that the delay always only happens after the first restart of the sound? Every subsequent restart is without any delay.

                MurtazaM 1 Reply Last reply Reply Quote 0
                • MurtazaM
                  Murtaza Admin @Lupo
                  last edited by

                  @Hamed Have you seen this before?

                  1 Reply Last reply Reply Quote 0
                  • HamedH
                    Hamed Admin
                    last edited by Hamed

                    It sounds like you need the sound to preload the sound effect. A work around could be to play the sound with 0 volume initially that way its loaded into memory, and you can try playing it again later.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post