Under linux, but I also believe under other operating systems this works.
Instead of a generic sound, this functon use any mp3, also very short, of any kind
function playMp3(sFullPath) ' sFullPath = path-name-extension
dim oPlayer1 as object, sUrlSound as string, oSounMgr as object
sUrlSound = ConvertToUrl(sFullPath)
If not fileexists(sUrlSound) Then
msgbox sUrlSound & " does not exist",16
else
If GetGuiType() = 1 Then
oSounMgr = CreateUnoService("com.sun.star.media.Manager_DirectX")
Else
oSounMgr = CreateUnoService("com.sun.star.comp.media.Manager_GStreamer")
End If
If IsNull(oSounMgr) Then
msgbox "Sound Mgr not set",16
else
oPlayer1 = oSounMgr.createPlayer(sUrlSound)
oPlayer1.setMediaTime(0.0): oPlayer1.setVolumeDB(-10)
oPlayer1.setPlayBackLoop( 0 ): oPlayer1.start(0)
while oPlayer1.isplaying()
doevents
wend
oPlayer1 = nothing: oSounMgr = nothing:
End If
End If
End function