Responding to audio cues

I’d like for a short audio file to play (e.g. sound of a bongo) and then the player touches the picture corresponding to the sound (pic of bongo).  

Correct response then adds a sound to the chain: auto-play bongo + one more sound (e.g. sound of a maraca).  Player touches pic of bongo then pic of maraca.  

Correct response: now add a third sound to the chain (bongo+maraca+sound of tabla) - player touches pics of bongo, maraca then tabla.  (incidentally, each touch of the pic makes the appropriate sound as well just to reinforce the experience of learning the instrument’s sound).    Continue until player hits the wrong instrument.  

I have already created the visual scene of the instruments.  I have loaded the audio files.  And the pictures “trigger” (via eventListeners) the appropriate audio files.  So far so good.

Now, how do I get the order of events to happen as described above where a sound auto-plays to start off the experience.  Correct answer then auto-plays last sound + one.  Correct sound auto-plays last 2 sounds + one, etc.

I’m just not sure what sample code to look at for this next level of responding to an “auto” played audio event

Many many thanks for your help!  It’s been a real blast learning how to do this.

Sorry, I should have mentioned that this is what I have so far to auto play the sound and “respond” to the sound:

local soundTable = {

soundBongo = audio.loadSound( “audio/bongo.aac” ),

soundMaraca = audio.loadSound( “audio/maraca.aac” ),

soundTabla = audio.loadSound( “audio/tabla.aac” )

}

local function playsoundBongo (event)

audio.play(soundTable[“soundBongo”]);

end

picBongo:addEventListener(“tap”, soundBongo)

local playsoundBongo = audio.play( soundTable[“soundBongo”] )

Where I’m stuck is that I’m not really responding to the auto-played bongo so much as just playing the bongo after I hear it.  I’d like my playing of the bongo to be a correct response which then plays bongo + new random sound from soundTable.

I’ve looked at the { onComplete= }  callback but I’m not sure how to use it in this case or if this is even the right thing to use.

Sorry, I should have mentioned that this is what I have so far to auto play the sound and “respond” to the sound:

local soundTable = {

soundBongo = audio.loadSound( “audio/bongo.aac” ),

soundMaraca = audio.loadSound( “audio/maraca.aac” ),

soundTabla = audio.loadSound( “audio/tabla.aac” )

}

local function playsoundBongo (event)

audio.play(soundTable[“soundBongo”]);

end

picBongo:addEventListener(“tap”, soundBongo)

local playsoundBongo = audio.play( soundTable[“soundBongo”] )

Where I’m stuck is that I’m not really responding to the auto-played bongo so much as just playing the bongo after I hear it.  I’d like my playing of the bongo to be a correct response which then plays bongo + new random sound from soundTable.

I’ve looked at the { onComplete= }  callback but I’m not sure how to use it in this case or if this is even the right thing to use.