audio issue

Dear fellow app developers,
I put two audio files in one of my e-book pages. Could anyone tell me how to make “audio A” stop automatically without pressing “stop button” when I play “audio B”?
Thank you in advance.
Henry
local audioA = audio.loadStream(“12.mp3”)
function narratorA:touch(event)
audio.play(audioA)
end

function stop: touch(event)
audio.stop()
end

local audioB = audio.loadStream(“13.mp3”)
function narratorB:touch(event)
audio.play(audioB)
end

function stop: touch(event)
audio.stop()
end

narratorA:addEventListener (“touch”, narratorA)
narratorB:addEventListener (“touch”, narratorB)
stop: addEventListener (“touch”, stop)
backbutton:addEventListener (“touch”, stop)
[import]uid: 150748 topic_id: 28769 reply_id: 328769[/import]

Save (or explicitly request) the channel AudioA is playing on and call audio.stop(channel) on it when you start AudioB. Remember that audio.play() returns the channel that it starts playing on.
[import]uid: 7563 topic_id: 28769 reply_id: 115936[/import]

I am switching my audio channels by

 local listener = function()  
 audio.stop(audioA);  
 end  
audio.fade({ channel=1, time=500, volume=0 } )  
timer.performWithDelay(500,listener)  

between two different channels and it works perfect.

Edit: Added some more code :slight_smile:

Joakim [import]uid: 81188 topic_id: 28769 reply_id: 115930[/import]

A big Thank You to jkrassman and ewing.
I will try and then tell you guys the result.
:slight_smile:

Thank you.

Henry
[import]uid: 150748 topic_id: 28769 reply_id: 115980[/import]