How Do I Play a Sound When Object is Pressed (My Code is Failing)

Hey all,

I have been trying to have my app play a short mp3 file called bubbletap.mp3 whenever I press the balloon. Here is my code…can you help me?

local soundID = media.newEventSound( "bubbletap.mp3" )  
   
local playBeep = function()  
 media.playSound( "bubbletap.mp3" )  
end  
  
balloon:addEventListener("touch", playBeep )  

Is it a problem that the file is really short (It is less than 1 second)?

Thanks,
Matt [import]uid: 19514 topic_id: 5262 reply_id: 305262[/import]

   
local function playBeep(event)  
 if event.phase == "ended" then   
 media.playSound( "bubbletap.mp3" )  
 end  
end  
   
balloon:addEventListener("touch", playBeep )  
  

this showld work or your sound is too short so you cant even here it (less than a second is too short)

[import]uid: 11559 topic_id: 5262 reply_id: 19105[/import]