Type Function Library media.* Return value Userdata Revision 2017.3060 Keywords media, event sound, sound, audio See also media.playEventSound()
Loads the event sound (1-3 seconds) from a sound file and returns an event sound ID that can be passed to media.playEventSound().
media.newEventSound( filename [, baseDir] )
String. Short description goes here.
Constant. If specified, this argument is the directory where the sound file is located. If missing, the default is system.ResourceDirectory
. Other options include:
system.DocumentsDirectory
system.ApplicationSupportDirectory
system.TemporaryDirectory
system.CachesDirectory
local soundID = media.newEventSound( "beep.mp3" ) local playBeep = function() media.playEventSound( soundID ) end timer.performWithDelay( 1000, playBeep, 0 )