Tips for sounds in android development

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • =====================================================================


    TIPS FOR SOUND


    =====================================================================


    When making games in android


    1.- avoid to play sound at start of frame (this will give time to fully load sounds, if you are using preload)

    2.- organize your sounds in channels, a better and clean way to use sounds.

    3.- define in your sounds which one can be play from disk, once play, several plays?, actually welcome sounds are high candidate to be "play from disk"

    4.- try not to use name with space or special chars, (even if fusion translate the name for sounds and use them accordingly) is better to have name with non special chars or space.

    5.- keep sound with low bitrate, please dont ask the devices to play a bitrate of 256 or above, this is no Opera is a game and mostly device will not be capable to do it, and you will get the risk to drop some sound during play.

    6.- be sure that your sounds does not have any DRM or watermark in it.

    7.- You can go down to some pretty low bit rates (under 80kbps) and maintain acceptable quality for mono music and speech.

    8.- test your games before post, trying to put your hand as many device you can, each manufacturer have made changes in the way they play sounds, sounds was a weak point since android start.

    9.- remember if is a graphic 50% is runtime and 50% is OS (available memory, size limits, etc.) but for sounds 10% is runtime, 90% is OS (decoder, DRM, player, almost everything is done by OS, etc.).


    You won’t be able to use DRM protected media on your Android device.

    This weekend i had the opportunity to work in a strange error since a game runs without crash in samsung or other brads but not in nexus family, where it did crash all the time.


    so after checking the log the following error is detected:


    01-25 10:33:06.798: E/FwdLockEngine(193): FwdLockEngine::onInitialize -- FwdLockGlue_InitializeKeyEncryption failed:errno = 11

    Any reference to FwdLockEngine with errno=11, which is: try again, this show that the drm system try but does not find a way to unlock the sound.


    so this will make the application to hang or simply does not sound.


    =====================================================================

    How can i know that i am not using DRM sounds in my development?


    =====================================================================


    Before adding sounds to your project check for protected mode. to do so


    1.- in Windows, open the folder where the sounds are.

    Please login to see this attachment.


    2.- select details view, and check if the column protected is used, if not follow the following step.
    Please login to see this attachment.

    3.- move your cursor above the columns header, right click, and check if protected is available in teh list, if not, press more, search and select.


    Please login to see this attachment.


    4.- once this column is on you may see the corresponding values to any sound you will use in your project, be sure it says "No", "Yes" will make the sound crash in nexus family.
    but there is another value that is Empty string, this value must be tested to avoid any crash or a partially protected file.


    Please login to see this attachment.

    =====================================================================

    What to do if a sound is in this situation?


    =====================================================================


    1.- if a sound you need is in this situation your best help is to export it again without any traces of DRM, to do so you may use "Audacity".

    when exporting delete any information in the watermark.

    2.- If you bought the sounds from others or third paties, you may need to ask them how to provide you with sounds without any DRM to avoid conflict in your game.

    Regards,


    Fernando Vivolo

    ... new things are coming ...

  • Thanks for the tips.

    I think one I'd add (as a general game tip, but especially true for mobile devices) is that you should always default to mono sounds. Then, for each sound, think if you can really justify the "cost" of stereo for that particular sound.

    You should really think about the environment in which it'll be played. I remember studying multimedia in a lab where the (tower) PCs had a built in soundcard at the front with two tiny speakers six CM apart on them. To quote my lecturer, "Unless you have an exceptional facility for detecting stereo width in your left knee, you should be using mono!" The same is equally true of phones. Even though a large modern smartphone will use clever phasing tricks to make its "stereo space" sound bigger than the couple of inches it really is, as Fernando says, it's still not like being in an opera. ;)

    It's not appropriate in all games of course; in horror games where you will be encouraging players to be playing in the dark, with some headphones on (even if it's on a phone/tablet) stereo will probably be worth the cost of it.

    For a Flappy Bird clone though? Mono every time.

    I produce electronic music and used to DJ a lot. One thing a lot of non-musicians will probably be surprised to hear is that a lot of things actually sound better in mono. I think there's probably an innate sense in most people (particularly the 30-somethings who can recall stereo sound in games being a new and exciting thing) that Stereo must be superior. It's a common technique in many genres of music to "narrow" the stereo field of particular sounds, particularly basses and drums, or even convert them completely to mono. It's slowly going out of fashion and becoming stereo (as very clever room dynamics processing becomes more affordable), but the majority of nightclubs you'll have been to will have had mono speaker systems and until now, I bet you never noticed! :)

    What does this mean in games? In anything retro styled or 2D, SFX like a "jump", or "coin get" should almost always be mono: Think about it, the player picked up a coin in on place, not two! Unless you want to give a real sense of space and draw attention to the 'echo' of the sound off the block to the left of the coin, stereo on something like this will add nothing.

  • I am having an issue on a specific Samsung Device ( Galaxy Alpha ).

    Issue is some audio like 'general button clicks' and 'general bullet impacts' ( and some other ) wont consistently play, and usually dont play at all.

    I solved the Button Click Audio issue by setting the 'Clicking Sample' to 'play from disk' ant it works perefctly as far as i have tested!
    Doing the same for the Bullet Inpact Audio however, causes massive sowdown ( although the audio does play ).
    All Samples are way below the 'bitrat' mark.

    I dont have the latest Android Beta, but will get help from someone and see if that changes anything.

    I heard something about a 'Force play from dsk' property, but i also heard this was not needed to fix issues like this ( and thus not trying this out yet ).
    Should i rather make a new thread about this?

    How can i change username and display name?
    Please login to see this link.

  • it seems there is a problem with audacity : all the export ogg file have an empty string for protected. So, in some device, the application freeze. So, if someone have a trick to have a off file with a "No" in protected, it will be good ;)

    [SIGPIC][/SIGPIC]Please login to see this link.

  • I'm running into issues with lag when playing sounds. I've followed all these steps, but nothing seems to help. I am using .ogg files (22050hz, 40kbps, mono) all of which are 12kb or less, no special characters, they all play on specific channels, and I've tried Preload, Load on Call, and Play from Disk and the game still lags when playing these files. If I disable the events which play sounds (all sounds are played via Fast loops), the game does not lag.

    Help!

    Edit: Play from Disk gives me the best framerate, but still lags. It's much more noticeable otherwise. Also, I'm using an Asus Zenfone 2.

    Please login to see this link.
    Please login to see this link.

  • Looks like there are some errors in my log having to do with audio. Here's the log with just Warns and Errors:

    Here's the whole log:

    Please login to see this link.
    Please login to see this link.

  • Tried it, the game still lags upon playing a sound. Here's my log again:

    The sound files I used for this test were: OGG, 48000Hz, 48kbps, mono

    Please login to see this link.
    Please login to see this link.

  • mm the problem seems from the audio library not the runtime as you may see it take ages to resolve sounds, is this a CyanogenMod 12.1?

    first take time checking if the audio have any restricted content via DRM

    these errors are very common and mentioned in the net but related to the non proprietary rom.

    Regards,


    Fernando Vivolo

    ... new things are coming ...

  • Ah! Yes that must be it, I'm running CM13 on this device. I just tested on a Samsung phone with no custom ROM installed and the sounds play fine.

    Is there any way around this on our end, or is it out of our hands? Otherwise I suppose I can put a note about possible issues with custom ROMs in the game's description.

    Please login to see this link.
    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!