Stop audio when another starts / launch audio just once

Good morning, I want to stop a sound when another starts playing .

if (event.object1.myName == "obst3") then audio.play(colsound)

I want this one to stop if the following one starts .

if (event.object1.myName == "t") then audio.play(explosion) 

Also, I need to know how to launch the sound just once ( when my objects collide with a wall, a sound pop out I need this one to be heard just once even if the player touches again the wall.

Thank you for everything,

Sincerely,

Saad Chemlal

Hi @saadchemlal,

These two issues will become clearer when you read these guides:

Audio guide (especially understanding audio channels):

https://docs.coronalabs.com/guide/media/audioSystem/index.html

Physics collisions guide (especially in understanding collision “phases”):

https://docs.coronalabs.com/guide/physics/collisionDetection/index.html

Hope this helps,

Brent

Thank you for your answer, I will check out your links 

Hi @saadchemlal,

These two issues will become clearer when you read these guides:

Audio guide (especially understanding audio channels):

https://docs.coronalabs.com/guide/media/audioSystem/index.html

Physics collisions guide (especially in understanding collision “phases”):

https://docs.coronalabs.com/guide/physics/collisionDetection/index.html

Hope this helps,

Brent

Thank you for your answer, I will check out your links