User Tag List

Results 1 to 8 of 8

Thread: How does one properly use Preload Sample?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF 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)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    926
    Mentioned
    15 Post(s)
    Tagged
    1 Thread(s)

    How does one properly use Preload Sample?

    I wasn't able to find any documentation on this so I'll ask here.

    I've got a hundred samples or so with evaluated path names and it would be nice to just play them from memory instead of accessing the hard drive every time they're needed. The problem is I have no idea of knowing what I have is working properly or not. There isn't much debugging tools for checking preloaded audio. Does this .mfa look right?



    Line 1 and 2 preloads samples by paths evaluated on runtime.
    Line 3 plays sample by file evaluating a new path the same way as before.

    Of course it is also possible Preload Sample is for something entirely different than I assume it is and I am completely mistaken.

    Bonus question: If not using Preload Sample, does Fusion still keep previously played audio files with evaluated path names in memory for "next time"?

  2. #2
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,187
    Mentioned
    141 Post(s)
    Tagged
    2 Thread(s)
    >> There isn't much debugging tools for checking preloaded audio.

    You can compare the memory used by your application with and without these samples.

    This MFA will load all the entiere sample files to memory. When you play them they are played from memory.

    If you do not use Preload Sample File, the samples you play from disk will be always played from disk, they won't be put into some cache, and when they are played only the current part of the file that is being played is loaded into memory (it's similar to the "Play from disk" option in the sound properties).

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF 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)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    926
    Mentioned
    15 Post(s)
    Tagged
    1 Thread(s)
    Thanks for fast reply!

    That's a good point and the app does indeed increase in memory size after preloading the audio files. But what I meant was, how to test if the audio file played afterwards was truly the one from memory or if it still being accessed from disk.

    I did my own little test just now by manually removing the audio folder after my app had preloaded the samples within but now the app does not play the audio at all. Does the files still have to be existing even after loaded into memory or am I doing something else wrong here?

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator
    SirEatAlot's Avatar
    Join Date
    Oct 2010
    Location
    Stockholm, Sweden
    Posts
    363
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    that's the way I do it as well, seems to work well but then it worked well even before preloading, so I agree it can be hard to tell if there's any difference in terms of performance

  5. #5
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,187
    Mentioned
    141 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by chrilley View Post
    I did my own little test just now by manually removing the audio folder after my app had preloaded the samples within but now the app does not play the audio at all. Does the files still have to be existing even after loaded into memory or am I doing something else wrong here?
    Oops, bug... some code was copied to a wrong location and Preload Sample didn't work correctly anymore... sorry! This will be fixed in the next update. EDIT: if you need it urgently I can send you a fix.

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    677
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    How is preloading manually different to leaving the Preload setting as it is in the data elements section? I'm not actually sure when samples that are preloaded by default are actually loaded as I've sometimes experienced pauses from playing some sounds for the first time regardless of this setting.

  7. #7
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,187
    Mentioned
    141 Post(s)
    Tagged
    2 Thread(s)
    The Preload option is for built-in sounds. When this option is selected (default), the entire sound data is loaded to memory when the frame starts. The other option is "Play from disk": if this option is selected, Fusion doesn't load the entire sound data, it loads the sound data progressively from disk when the sound is played.

    The Preload Sample File action is only for external files. It basically loads the sound file and adds it to the list of built-in sounds for the current frame.

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF 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)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    926
    Mentioned
    15 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Yves View Post
    Oops, bug... some code was copied to a wrong location and Preload Sample didn't work correctly anymore... sorry! This will be fixed in the next update. EDIT: if you need it urgently I can send you a fix.
    No worries! There is no hurry and the issue is not blocking any development nor is it urgent so I can just grab the full update when it's ready. But I am glad to hear it was just a matter of a quick-fix and that the preload-system is really as simple to use as I had hoped.

    Thank you for looking into it - As usual I am looking forward to next build!

Similar Threads

  1. Preload All Frames in Application?
    By FinalSpecimen in forum Fusion 2.5
    Replies: 9
    Last Post: 21st March 2019, 04:44 PM
  2. Stop Any Sample Playing - does not work properly?
    By mobo in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 20th May 2012, 03:19 AM
  3. Get Main Volume to interact properly with sample
    By mrmdesign in forum SWF/Flash Export Module Version 2.0
    Replies: 0
    Last Post: 18th July 2011, 12:20 PM
  4. Can a quicktime movie preload?
    By 1234cb in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 10th July 2011, 09:54 PM

Posting Permissions

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