Jump to content

Audio(how to combine audio)


mazoku
 Share

Recommended Posts

You can just play multiple sounds together by calling each of their play methods, though sequencing or timing could become tricky. As for audio software, there's a lot out there - I guess Audacity would be a good one if you need something free and mature, though if you're not familiar with audio editing software it may be tricky to get started.

Link to comment
Share on other sites

Oh right, you don't have to use an audio sprite like in this example which I assume is what you're referring to. You can just do this:

function preload() {    game.load.audio('sound1', 'assets/audio/sound1.mp3');    game.load.audio('sound2', 'assets/audio/sound2.mp3');}function create() {    var sound1 = game.add.audio('sound1');    var sound2 = game.add.audio('sound2');    // play the first sound    sound1.play();    game.time.events.add(2000, function() {        // play the second sound after 2 seconds        sound2.play();    }, this);}

Edit: Made a bit of a boo boo - forgot to add the audio! Fixed above.

Edited by lewster32
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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