User Tag List

Results 1 to 9 of 9

Thread: Play sample from expression

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module
    AkaiR's Avatar
    Join Date
    Jul 2011
    Location
    Sweden
    Posts
    36
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question Play sample from expression

    Hello everybody!

    I've searched and searched and searched but I can't find a solution to my problem. There's alot of threads about this but no solution, it seems...

    I'm trying to get my app to play samples from an expression because I have several different samples I want to play randomly ex: "sample"+str$(random(10))+".wav"

    It just doesn't work, doesn't matter if I have added it to binary data or not, if I write the whole path that it was stored on my computer (as someone said you should) or if I just write "sample0.wav".

    BUT if I choose to play it directly (not from expression) it works perfectly, which leads me to believe that that play from expression simply doesn't work on android. Is that the case?

  2. #2
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    181
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    If you're OK with the files being embedded directly into the EXE/don't need them to play externally, you can do random sounds using loops:



    This just runs a fast loop (once) with a random number in the name, and each loop plays a different sound

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module
    AkaiR's Avatar
    Join Date
    Jul 2011
    Location
    Sweden
    Posts
    36
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the answer, nice way of playing random files using fast loops! But this is still what I want to avoid. I would like to have 1 line of code instead of 10. It's not that I mind if the sounds are embedded or not, I just don't want to add a line of code for each sound - that's why I wanna know if it works with "play from expression" on android or not.

  4. #4
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    tk22's Avatar
    Join Date
    Dec 2014
    Posts
    54
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marbenx View Post
    If you're OK with the files being embedded directly into the EXE/don't need them to play externally, you can do random sounds using loops:



    This just runs a fast loop (once) with a random number in the name, and each loop plays a different sound
    Thank you! @marbenx ! Is "44100" the default frequency?

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module
    AkaiR's Avatar
    Join Date
    Jul 2011
    Location
    Sweden
    Posts
    36
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Anybody knows if this is possible or not?
    Otherwise I'll go with @marbenx fine fastloop solution :P

  6. #6
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,174
    Mentioned
    166 Post(s)
    Tagged
    3 Thread(s)
    For this you need an extension which allow you to play sounds from assets, let me see if i post something for sale
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  7. #7
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    181
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tk22 View Post
    Thank you! @marbenx ! Is "44100" the default frequency?
    that's the frequency of the particular sound files I was using in the game, if you open up a sound file in any sound editor it should tell you the frequency (or even fusion if you output the info to the debugger). the +RRandom(-800,800) is just to give a tiny bit of randomness to the sound each time it plays so even if it plays the exact same sound twice in a row it should be a little different

  8. #8
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    tk22's Avatar
    Join Date
    Dec 2014
    Posts
    54
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marbenx View Post
    that's the frequency of the particular sound files I was using in the game, if you open up a sound file in any sound editor it should tell you the frequency (or even fusion if you output the info to the debugger). the +RRandom(-800,800) is just to give a tiny bit of randomness to the sound each time it plays so even if it plays the exact same sound twice in a row it should be a little different
    Thank you for the detailed explanation now I get how it works!

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module
    AkaiR's Avatar
    Join Date
    Jul 2011
    Location
    Sweden
    Posts
    36
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fernando View Post
    For this you need an extension which allow you to play sounds from assets, let me see if i post something for sale
    Yes, I would be happy if you know something that will work!

Similar Threads

  1. Replies: 2
    Last Post: 27th June 2018, 06:56 AM
  2. Play sample from binary using expression
    By leightonw87 in forum Fusion 2.5
    Replies: 4
    Last Post: 25th September 2016, 05:50 PM
  3. The difference between play sample and play sample 1 time?
    By mobichan in forum iOS Export Module 2.5
    Replies: 0
    Last Post: 17th August 2016, 05:30 PM
  4. play sample when another sample has finished?
    By edward in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th October 2006, 03:55 PM
  5. Order of "play sample" and "set sample volume".
    By Nifflas in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 26th September 2006, 08:07 AM

Posting Permissions

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