Hi, I’m a beginner, I recently did an application with an image that plays a sound when touched in the emulator udk everything is perfect, but in my mobile, touching the image does not play any sound, I could provide help?
THANKS
Hi, I’m a beginner, I recently did an application with an image that plays a sound when touched in the emulator udk everything is perfect, but in my mobile, touching the image does not play any sound, I could provide help?
THANKS
You’re going to need to provide additional information for anyone to be able to help.
But the first thing I would ask is what device is it not playing on and what type of file is it? Not all audio files play on all devices. MP3 files will play on iOS and Android devices (but may be subject to licensing costs). WAV files will play on iOS and Android devices. Other file formats may only play on one platform.
thanks
the sound is not working, if you install the apk and open, but by touching the image, no sound (mp3) does not play, try it on a device with android 2.3.6 and a jelly bean.
– code here
display.setStatusBar( display.HiddenStatusBar )
local dispObj_1 = display.newImageRect( “fondo.jpg”, 480, 320 )
dispObj_1.x = 240
dispObj_1.y = 160
local gallo = display.newImageRect( “gallo.png”, 95, 82 )
gallo.x = 253
gallo.y = 238
function sonidogallo()
media.playEventSound(“gallo.mp3”)
end
gallo:addEventListener(“touch”,sonidogallo)
Well, looking at the sample code, it says you need to do a newEventSound first.
“For Android devices, the sound should be preloaded with the media.newEventSound() API.”
Like this:
local soundID = media.newEventSound( "beep.caf" ) local playBeep = function() media.playEventSound( soundID ) end
You’re going to need to provide additional information for anyone to be able to help.
But the first thing I would ask is what device is it not playing on and what type of file is it? Not all audio files play on all devices. MP3 files will play on iOS and Android devices (but may be subject to licensing costs). WAV files will play on iOS and Android devices. Other file formats may only play on one platform.
thanks
the sound is not working, if you install the apk and open, but by touching the image, no sound (mp3) does not play, try it on a device with android 2.3.6 and a jelly bean.
– code here
display.setStatusBar( display.HiddenStatusBar )
local dispObj_1 = display.newImageRect( “fondo.jpg”, 480, 320 )
dispObj_1.x = 240
dispObj_1.y = 160
local gallo = display.newImageRect( “gallo.png”, 95, 82 )
gallo.x = 253
gallo.y = 238
function sonidogallo()
media.playEventSound(“gallo.mp3”)
end
gallo:addEventListener(“touch”,sonidogallo)
Well, looking at the sample code, it says you need to do a newEventSound first.
“For Android devices, the sound should be preloaded with the media.newEventSound() API.”
Like this:
local soundID = media.newEventSound( "beep.caf" ) local playBeep = function() media.playEventSound( soundID ) end