Jump to content

Pausing/Resuming audio channels individually


Recommended Posts

Hi I'm new here but I have a few audio requirements I need help with implementing:

  1. Individual audio channels I can pause/unpause or mute/unmute separately. 
  2. Means to pause/unpause all channels at once.

Use example:

I have enemies that play a footstep loop as they move. If they stop to attack, the footstep loop needs to stop and the attack sound needs to play. Enemies are currently on individual timers(enemy A will move 5 seconds then attack, move 5 seconds then attack, etc)

If that enemy is killed, that enemy's current sound should be stopped and replaced with the death sound. 

I want the game to have a pause feature. That needs to affect all sounds in play from enemy SFX, player SFX and the BGM. 

Links to samples, code snippets are all greatly appreciated. 

I'm using Phaser 2.6.2 and Web Audio. 

Kind regards. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...