Making a soundboard....some odd ogg issues

SparkyidrSparkyidr Member Posts: 2,033
edited November -1 in Working with GS (Mac)
hey
Those of you that have made soundboard type apps in GS.

I'm having a bit of an issue.
I assign a .ogg to a button, and it plays all fine..
but....
When I kind of hammer the button, or just even press it a lot in pretty quick succession, the playback sounds a bit odd, sort of like it's playing the sample more than once before it runs to the end (like a little roll before it plays the full sample)

if that makes sense

Anyone else had the same issue? and if so how (if at all) did you work around it? It's kind of anoying.

it's almost as if it's receiving more than a single touch...when you slow down your presses and be more deliberate about it, it sounds fine.

this is on the phone by the way...it seems fine in the gs preview.

Comments

  • CoIinCoIin Member Posts: 197
    Can you rig up an electrical shock, so that if someone does that it will zap them?

    Failing that, have you got the sound set to Run to completion?
  • SparkyidrSparkyidr Member Posts: 2,033
    hah.. that would be fun..

    yeah, already got run to completion on.
    I'm thinking it might have more to do with the sounds i am playing rather than anything...think the bass frequencies might be causing the clicks as the sound takes over on the release tail to play again... hmmmmmmm (They are bassy sounds)
  • rebumprebump Member Posts: 1,058
    When the icon button for a sound is pressed, set an actor level attribute (name it "AlreadyPlaying" or something) to "true". You will then also add to the button a check to see that "AlreadyPlaying" is "false" before trying to play it again. Then add a timer, the length of time the sound sample plays plus a little bit for wiggle room, that then resets "AlreadyPlaying" back to "false" enabling the button to be activated again after the sound has played. You may need to fiddle with the timer value a tad since a sound that is say 5.2 seconds long may actually take a little shorter/longer to play based on any "fire up" time by the sound sub-engine as well as any transformations placed upon the sound.

    If you want to only allow one sound at a time to play, make "AlreadyPlaying" a single game level (not actor level) attribute and have all the icon buttons reference it.
  • scorelessmusicscorelessmusic Member Posts: 565
    Welcome to the world of 'sound engines' :)

    To get pristine playback of sounds, there are quite a number of considerations. We had to build our own sound engine for CHORDiCA just to eliminate all 'clicking' sounds due to various playback scenarios. There are still some music instrument apps that are sloppy about such things in the app store.

    The best bet is to let the sound file run to completion before interrupting it again.

    Somewhat related to this topic is the process of creating seamless audio loops without clicks and pops. Just do some searching on the net to see advice on that. Here's one:

    http://forum.audacityteam.org/viewtopic.php?f=13&t=2820
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    One important thing on a soundboard is to have a hidden actor load all your sounds at no volume that way you don't get that lag the first time each one is played.
Sign In or Register to comment.