User Tag List

Results 1 to 3 of 3

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

  1. #1
    Clicker Fusion 2.5iOS Export Module

    Join Date
    Jan 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    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...

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,167
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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

  3. #3
    Clicker Fusion 2.5iOS Export Module

    Join Date
    Jan 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

Similar Threads

  1. How do you play default ios sound, eg the notification sound.
    By assentec in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 14th July 2013, 06:33 AM
  2. ContentLoadException when trying to play a sound
    By K1kk0z90 in forum XNA Export Module Version 2.0
    Replies: 7
    Last Post: 27th October 2012, 05:02 AM
  3. play Sound Bug[BETA 26]
    By Nekorai in forum Android Export Module Version 2.0
    Replies: 3
    Last Post: 22nd April 2012, 08:48 PM
  4. How to play a sound once while over object
    By Selveria in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 8th May 2010, 06:49 PM
  5. Play sound IMMEDIATELY after other sound finishes
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 1st September 2007, 12:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •