Can't get same sound to play over itself in ios

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I have a "happy baby" app that allows the child to keep pressing the same sound over and over to produce overlapping clapping or cows or whatever. This works fine on Android, but when I try it with ios the sound always just restarts instead of playing over itself. If I click on two different sounds they overlap just fine, it's just when trying to play the same sound over itself that I have problems. I'm not seeing any setting for the ios object that would affect this - multi-samples is enabled, and I've tried "play sounds over frames". Any suggestions? I could dig into the ios generated code, but prefer not...

  • The only solution I can come up with is the hacky one of duplicating the sound files with 2 different names, and making events to play whichever version is not yet playing (toggle bewtween them..) so the device things they are totally separate sounds (because they are ;) )

    cheers,
    Mike

  • I was able to work around it by modifying the "play" method in the CSoundPlayer.m source file (Classes/Application/CSoundPlayer.m), where it checks for the same sound playing and stops it. I modified the first for() loop in the routine to do this instead:

    // hAPPy baby mod: ignore if sound is already playing on half the channels
    cc = 0;
    for (n = 0; n < NCHANNELS; n++)
    {
    if (channels[n] == sound)
    {
    cc++;
    if (cc > (NCHANNELS/2))
    {
    return;
    }
    }
    }

    I noticed that if I removed the check entirely that I could get it to somehow fill up all 32 sound channels and prevent other sounds from playing, so I set a limit of half the channels for one sound.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!