Jump to content

Play music and sound in the same time using audio tag


hilty
 Share

Recommended Posts

It depends on the browser / OS. For lots of them you are restricted to 1 channel of active audio and that is it. Some browsers will allow you to run a couple of audio tags at once, sometimes even more, but you should really try and limit this as it can drink mobile CPU as if it was water. Your time is probably better spent using some kind of progressive enhancement method - i.e. focus on great sounds for Web Audio browsers (which covers virtually all iOS devices + Chrome on Android, so a huge number), and then just provide a decent single channel fall back for legacy devices.

Link to comment
Share on other sites

Dear hilty

 

see at:

https://github.com/cykod/Quintus/blob/master/lib/quintus_audio.js

 

It is source code of the Quintus engine by Pascal Rettig.

Pascal is author of book: Professional HTML5 Mobile Game Development.

The Chapter 25 on this book covers your toppic.

 

Regards

Tomas

 

Thanks Thomas,
 
I will take a look on it. :)
 
One question: In this book, Pascal shows how he built this logic?
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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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