I haven’t programmed sounds yet but just at a glance it looks like you should be using soundID to play, not the filename. As in
media.playSound(soundID)
Incidentally, mp3 is not a great format to use for short sounds. Mp3 is great for long sound files (like music) because of it’s great compression, but for short sounds (like most sound effects) the compression is too much overhead and you’re better off using something like .caf
-- Add sound here
local soundID = media.newEventSound( "Pressed.caf" ) -- your sound file here
-- Listen to an event
local function gobuttonpressed(event)
if not (event.phase == "ended") then return end
media.playSound("Pressed.caf") -- here your sound file
gobutton:addEventListener("touch", gobuttonpressed)
Hope that helps
[import]uid: 11559 topic_id: 5263 reply_id: 17975[/import]