Can U Play Random Sounds ?

VoiceExpressVoiceExpress Member, PRO Posts: 102
Can you set it so when someone Pushes a button(Icon) it plays random sounds, So not just one sound,

so if you ask it a question it might say yes or no.....WHO KNOWS WAHT IT MIGHT SAY ?

ANY HELP PLEASE

THANKS

Comments

  • shaihaludshaihalud Member Posts: 34
    on touch change attribute self.(sound) to random(x,y)

    rule
    if self.(sound) is #
    play sound

    but does the iphone really need another "press button to hear annoying sound" app?

    http://crapps.wordpress.com/2010/02/06/17-sound-grenade-app-free-itunes-store/
  • BeyondtheTechBeyondtheTech Member Posts: 809
    Haven't tried but you might be able to get away with Play Sound "soundfx" .. self.Sound .. ".ogg". That would be better than a bunch of Rules for each sound.
  • SlowboySlowboy Member, PRO Posts: 329
    Yo, Beyond - are you saying that there's a way to change a sound based on a variable, like last week someone enligthened us (well, me, anyway) on how to do away with 'replace image' and concatenate an attribute into the actor's image setting. Is this possible with sounds too? If so, that would help me a lot.
    Sorry to butt in VE, but FTR I would've said what shaihalud said, although I am very intrigued with BTT's answer.
  • VoiceExpressVoiceExpress Member, PRO Posts: 102
    Thanks Guys, And dont worry "shaihalud" this is not for a annoying sound, Making something special LOL, Cheers
  • BeyondtheTechBeyondtheTech Member Posts: 809
    @Slowboy: That's exactly what I'm trying to say. Unfortunately, I'm away from a Mac for the next 8+ hours, so I have no way to test. However, in theory, it should work, just like the Change Image Action.
  • rebumprebump Member Posts: 1,058
    @BTT: These 8+ hours away are SOOO annoying! ;-)
  • SlowboySlowboy Member, PRO Posts: 329
    Heh, I'd completely forgotten about this, but now that I'm having a look, I can't see it.
    I was imagining that my rule would be like, if whatever equals whatever....
    Change Attribute self.sound to 'hacked together filename using'..'and such'.ogg
    But, alas, there is no self.sound attribute available - the only thing in any way relating to audio is the volume setting in the devices bit. So, looks like this won't work Tech :l
    Also, if you were thinking it would be possible in the Play Sound action, that is only a single drop down list - there's no way to fudge an expression in there, only select a sound from the drop down.
    Never mind, we can't have everything.....yet!
    Cheers ;]
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    just came across this because i needed to do it

    fairly straight forward
    ''
    just make an attribute (i used integer) called "playsound"

    make your button have a rule that when it is pressed it used changes attribute "playsound" to: (random1,5)
    You can select this by pushing the little "e" and filling in the min and max of how many sounds you have.

    Next have a set of rules for each sound that look like:
    when attribute "play sound" = 1 play "whatever.ogg"
    when attribute "play sound" = 2 play "that.ogg"
    when attribute "play sound" = 3 play "this.ogg"
    when attribute "play sound" = 4 play "etc.ogg"
    etc, etc

    The same can be used to spawn random actors
  • MoneyMaker100MoneyMaker100 Member Posts: 13
    Great fixed my problem thanks zep and stanimation
  • stanimationstanimation Member Posts: 406
    create a rule
    change the pull down to Attribute
    select the :play sound" attribute you created
    select a number 1-4
    add plat sound attribute under behaviors
    select your sound from your library
  • MoneyMaker100MoneyMaker100 Member Posts: 13
    Thanks again stanimation I have one other question my button now plays random sounds however for some reason one of the random sounds plays a silent sound... I have checked my ogg and they all work and I have checked my rules they are also correct!

    My change attribute is set to (random 1,8) and my rules also go 1-8.

    Is there a way to see a log or something else to find out whats happening with my phantom silent sound!

    Im assuming its something simple. Thanks in advance
Sign In or Register to comment.