User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: SamplePosition in Android Export failing to trigger events

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AND's Avatar
    Join Date
    Nov 2013
    Location
    Greece
    Posts
    275
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    SamplePosition in Android Export failing to trigger events

    I need to trigger events from sample positions in a music file so that they are in exact time with the music. I've used SamplePosition successfully when exporting to iOS, Windows, Mac & UWP, but when I export to Android nothing happens. The events don't appear on the screen.

    I've tried with .ogg, .mp3 & .wav which all work on the other platforms, but none of them work with Android, so I've assumed it is a bug with the Android exporter and reported it in the bug box.

    Do you think I'm using the SamplePosition command incorrectly? Should I be using channels for it to work with the Android exporter?

    I've made a sample .mfa. Please could you try out my example file and see if there's something I've done wrong. Does anyone know how to get this working?

    I've just got the SamplePosition command setting the counter in the example, and in my project it makes active objects appear. Everything works fine in preview, but not when exported to an Android device.

    SamplePosition("Sample") >= 1000
    : Set Counter to 1

    Sample Position Test.mfa

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    650
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I assume this doesn't mean that "Force 'Play from disk' for sounds larger than..." is broken and Play from disk is always forced in the Android runtime?

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AND's Avatar
    Join Date
    Nov 2013
    Location
    Greece
    Posts
    275
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Please could you explain Wodjanoi?

    Edit: It's ok, I found the Force 'Play from disk' setting. Thanks Wodjanoi

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AND's Avatar
    Join Date
    Nov 2013
    Location
    Greece
    Posts
    275
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I just googled Force 'Play from disk' and it came up with a thread from the Clickteam forum with a post by the Almightyzentaco!

    Found a way to get the release version of android exporter to play sounds! On the android settings in your app there is a little section that says Force play from disk on sounds larger than (in seconds)
    I set that to zero and it's playing all sounds without a hitch! The only issue you may run into is a bit of slowdown if you have lots of sounds playing back to back, like if you pick up a bunch of coins or something. You can just set the sound to 1 instead of zero and it will make sure it plays all the longer sounds, but give you some wiggle room on the short ones.
    I found the Force 'Play from disk' setting and it was on 5 by default. I experimented with the settings, changing it from 0 to 135 (the length of my audio), but it didn't solve the problem of SamplePosition failing to trigger events.

    I don't have any problem playing the music, but I can't get events triggered by SamplePosition when the project is exported to the Android device.

    In the note under the Force 'Play from disk' setting it says, "Note: only sound samples that are played from disk are seekable, seeking doesn't work for preloaded sounds" I set the audio sample to 'Play from Disc' in the Data Elements box, but the SamplePosition command still doesn't work on the Android device.

    Perhaps 'Play from Disk' seeking is broken on the Android Exporter. Thanks very much for pointing this out Wodjanoi!

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AND's Avatar
    Join Date
    Nov 2013
    Location
    Greece
    Posts
    275
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I'm going to try using the Video Android object instead.

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2016
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had the same problems when exporting to Android.

    It seems that SamplePosition doesn't work, I'm having some success using ChannelPosition instead which does register in Android... but when trying to use it to loop a sound it still introduces a gap once exported to Android.

  7. #7
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AND's Avatar
    Join Date
    Nov 2013
    Location
    Greece
    Posts
    275
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much migwah!!! I just had a reply from Fernando in the bugbox and he confirmed that the SamplePosition feature is not included in Android exporter, but you still have these features using channel which is faster approach for android devices.

    I'm so relieved - I thought I'd have to redo everything using the video object just for Android. I've just tested it using ChannelPosition and it works great!!

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2016
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great, glad it helped!
    I've been trying to use this technique to loop the sound once it's got to the end, to get my BG music to seamlessly loop but there's always a gap. Have you found this and any solutions?

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AND's Avatar
    Join Date
    Nov 2013
    Location
    Greece
    Posts
    275
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Hi migwah, I've got some looping background music on a menu screen, but I don't have a gap when it's exported to Android. If anything, I have a different problem where the music comes back in after the end of the loop a split second too early.

    My settings are: Play sample Background Music (uninterruptible) 0 times

    The audio sample is set to preload in the Data Elements box.

    I've haven't tried it using ChannelPosition. I'll do that now and see if it produces a gap.

  10. #10
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2016
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey again!
    So when you say "Play sample Background Music (uninterruptible) 0 times" you mean "Play and Loop Sample 0 times" right?

    How long is your background music?

    Because if I preload sounds then they loop perfectly with "Play and Loop Sample 0 times", but if it's a bigger sound then you can't Preload it, it has to be "Play from Disk" and when it's doing this there's a pause when it loops.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Triggering events on multiple instances
    By william_ in forum Fusion 2.5
    Replies: 6
    Last Post: 8th October 2016, 03:36 AM
  2. Negative Alterable Values not triggering events.
    By GamesterX23 in forum Fusion 2.5
    Replies: 0
    Last Post: 22nd March 2015, 04:44 PM
  3. Replies: 1
    Last Post: 7th November 2014, 07:16 AM
  4. Replies: 4
    Last Post: 1st July 2014, 07:27 PM
  5. Multiple events triggering from one button press
    By Smakian in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 20th September 2013, 09:58 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
  •