User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22

Thread: Need tips for using sounds

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    DiegoArthur's Avatar
    Join Date
    Oct 2014
    Location
    Alegrete
    Posts
    15
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Need tips for using sounds

    Hello all.

    I am developing a shmup which is using a lot of sound effects. Those effects are affecting the performance, dropping the FPS from 60 to ~30. When I remove all the sounds, FPS is locked on 60.

    I need some tips on playing sounds on Android, as I need many sound effects playing at the same time.

    Thanks!

  2. #2
    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)
    Bree's Avatar
    Join Date
    May 2014
    Posts
    317
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    What type of files are you playing? Are they oggs or wavs? Sometimes using wavs for small sound effects work better because it's harder for Android to play compressed files.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    DiegoArthur's Avatar
    Join Date
    Oct 2014
    Location
    Alegrete
    Posts
    15
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bree View Post
    What type of files are you playing? Are they oggs or wavs? Sometimes using wavs for small sound effects work better because it's harder for Android to play compressed files.
    Hello. I am using wav files ranging from 4 to 80 kb.

  4. #4
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,565
    Mentioned
    258 Post(s)
    Tagged
    4 Thread(s)
    Do you have any small mfa that can reproduce this lost of FPS fro me to check?

    when sounds are preloaded they are play in a separated thread as the play from disk sounds
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    DiegoArthur's Avatar
    Join Date
    Oct 2014
    Location
    Alegrete
    Posts
    15
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fernando View Post
    Do you have any small mfa that can reproduce this lost of FPS fro me to check?

    when sounds are preloaded they are play in a separated thread as the play from disk sounds
    Here: https://1drv.ms/u/s!AouRlI4fmN-D0S-s...ZwE57?e=Mo19nQ

    I created a small .mfa that plays some of the sounds I am using in a sort of random way, trying to simulate shooting and hitting enemies and walls.

  6. #6
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,565
    Mentioned
    258 Post(s)
    Tagged
    4 Thread(s)
    thanks for the example

    I see you have a mix of two worlds, create objects, and play sounds, two of the most expensive actions that require memory and involve the garbage collector so you will have different results.

    in middle device you may have from 30-57 and in nougat you may have from 53 - 58, and you may see these values depends on how the memory is used and collide when playing sounds or creation.

    may I suggest to create the object before and test, so you can see how it will impact, also notice that if you change the bullet images (just like a 3x3 pixels square) the min in the same device will be higher, so that the sound affect.


    I will see if I can get more speed or try to handle soundpool in a faster way, without affecting the runtime.
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    DiegoArthur's Avatar
    Join Date
    Oct 2014
    Location
    Alegrete
    Posts
    15
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hello. I am still struggling with sound playback lag on Android.

    I did some stress tests and the runtime runs at 60 FPS creating 1 active per frame (sums to about 800 simultaneous actives on the same level). The moment I activate sounds the framerate falls to 30~50, even when no actives are being created.

    On my stress test, samples are selected and played every other frame. Samples are 2-80kb .wav files. In my understanding, that should not be a problem, considering games tend to have multiple samples being called at the same time.

    So I would like to know some things:
    1. Should I use other file format?
    2. I used the "preload" option, does that mean samples are cached into ram and read from there?
    3. I was planing on avoid calling samples every time, but instead pausing them at the end and roll them back to be played again. It did not work properly. Should I pursue this idea?
    4. What is the best code practice for sample playback?


    Thanks.

  8. #8
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,565
    Mentioned
    258 Post(s)
    Tagged
    4 Thread(s)
    Thanks to @Dobermann we tested latest beta seems that the lags generated from sounds are almost gone.

    we notice that some devices take more time (even if are msecs) than other, so when getting the audiofocus, this is generating a delay in sounds, audiofocus should not affect anymore in regular game unless a call is received, alarm or other notification that may affect a playing sounds.
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    DiegoArthur's Avatar
    Join Date
    Oct 2014
    Location
    Alegrete
    Posts
    15
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    That is some great news! When is the beta going to be accessible?

    Thanks for the reply, Fernando.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    SoftWarewolf's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    939
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    There was a major sound issue in the last beta i tried, sound at max volume with no way to mute or reduce it, volume not following the media volume anymore.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. [Bug] "Resume all sounds" plays previously loaded sounds in an uncontrollable state.
    By raxabit in forum Universal Windows Platform Module 2.5
    Replies: 1
    Last Post: 31st January 2019, 05:57 AM
  2. Varying sample sounds, frequency sounds weird
    By Lukiester in forum Fusion 2.5
    Replies: 1
    Last Post: 10th May 2018, 12:52 PM
  3. New sounds keeps cutting off old sounds
    By YeOldeLuke in forum Fusion 2.5
    Replies: 1
    Last Post: 1st February 2018, 08:20 AM
  4. Tips for sounds in android development
    By Fernando in forum Android Export Module 2.5
    Replies: 12
    Last Post: 28th April 2016, 05:30 PM
  5. Sounds sounds sound
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 20th November 2007, 07:26 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
  •