How do I toggle sound in cocoon JS?

0 favourites
From the Asset Store
Best soundtracks for any game. High quality and engaging assets.
  • Using toggle silent is not working for cocoon js

    Any solution?

    Tested on Intel XDK and it's also not working

    Seems the toggle sound function is not working on Android

    Other way to toggle sound?

  • Sound responds differently depending on whether the sound is in the sound folder or the music folder. And iPhone handles music and sound files a little differently so, sometimes other options will work better like "mute" or "stop" but even that will depend on what folder the music or sound file is. I strongly suggest you read the audio section of the manual again at this point so it's fresh in your mind as you approach problem solving. In my experience you need to test on a variety of Android phones and you can expect some differences in how the sound responds depending on the OS version and the bowser (if it's a mobile web game). I cant speak for XDK but, Whether I use the audio object for mobile web or cocoonJS, I expect varied results with Android. I can almost always get the desired result for most devices. And of coarse, the newer the device, the less issues. Generally, I make sure everything works iPhone first and then approach the Android issues.

    Read the manual.

    Evaluate the if the correct use of sound and music folders being used.

    Explore different options in audio object for stopping sounds or music.

  • I have tested the apk on many devices and all are same, the toggle music function is not working at all.

    Still dont know what's wrong

    I think i will use different method

  • Tried global variable toggle method and it's still not working

    Also tried to put the music to sound, also not working

    Don't know what's wrong

  • shameless bump, i am seriously in despair

  • Have you tried using "mute" or "stop" in the audio object?

  • Have you tried using "mute" or "stop" in the audio object?

    Tried that way and still not working

    Tried both Cocoon js and iXDK too, still not responding

    The sprite to toggle on and off music does nothing, tested on chrome browser and it works really well

    I wonder if anyone has got some problem and the solution?

    Can somebody also posted tutorial to toggle music manually? I tried this one

    *cant post url* veryvariable-toggle-between-two-states

    And it seems not working with music/sound

  • Shameless bump again

    I'm in super despair now

  • Shameless bump again!

  • Bump, haven't find solution yet

  • You can try changing the master volume or by tag. Instead of using dB I use this formula to put a volume from 0 to 100

    33*log10(X/100)[/code:18tsmep8] for X from 0 to 100, or [code:18tsmep8]33*log10(X)[/code:18tsmep8] for X from 0 to 1.
    For toggle try this:
    [img="http://dl.dropboxusercontent.com/u/139926126/Forums/scirra/toggleSound.PNG"]
  • You can try changing the master volume or by tag. Instead of using dB I use this formula to put a volume from 0 to 100

    33*log10(X/100)[/code:32qwok2k] for X from 0 to 100, or [code:32qwok2k]33*log10(X)[/code:32qwok2k] for X from 0 to 1.
    For toggle try this:
    [img="http://dl.dropboxusercontent.com/u/139926126/Forums/scirra/toggleSound.PNG"]
    

    Thanks!

    Gonna try it soon!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ijoin

    I handle the sound toggling with a global variable "Sound". If Sound=1 all sounds will be played.

    Live-HTML Demo: http://envato.wdbase.de/wp-content/demo/candyland/

    This is the code behind handling the toggle function/animation.

    [attachment=1:2zm8u2gi]toggle_sound.png[/attachment:2zm8u2gi]

    And this is the sound function handling the playing of the sound if it's enabled.

    [attachment=0:2zm8u2gi]toggle_sound_2.png[/attachment:2zm8u2gi]

    This is a very simple function, but it works perfect on all platforms i've tried so far.

  • ijoin

    I handle the sound toggling with a global variable "Sound". If Sound=1 all sounds will be played.

    Live-HTML Demo: http://envato.wdbase.de/wp-content/demo/candyland/

    This is the code behind handling the toggle function/animation.

    [attachment=1:1pjma5si]toggle_sound.png[/attachment:1pjma5si]

    And this is the sound function handling the playing of the sound if it's enabled.

    [attachment=0:1pjma5si]toggle_sound_2.png[/attachment:1pjma5si]

    This is a very simple function, but it works perfect on all platforms i've tried so far.

    Thanks AndreasR

    Glad, Construct 2 community has someone helpful like you <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Btw, tried your candygame, got any tutorial to make select character and the doodle system?

    Thanks again!

  • ijoin I'm glad to help you out

    No it's no tutorial planned, but i also will offer this game at codecanyon for about 10-13$. Game is on upload and if you are interessted feel free to buy it. It includes the complete C2 project and all Graphics (free license for privat and commerical) and I give full support to my basements and you are allowed to publish and modify it on any platform you wish

    It should be online in a few days, just PM me if you want know more about and i can provide you the link

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)