The command beep
generates a machine-specific warning sound (on the Mac a dull and unimpressive thud). But is there any other mechanism which can be used in a macro to generate different alarm sounds, such as sound(pitch,length)
?
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
Thank you. It may come to that, and I have found a convenient site for creating a short sine-wave signal: [Custom Sine Tones | Audio Test File Generator].
However, since it involves using an external file, not integral to the database, I am a little doubtful of its utility.