Is there any way to run
System.Console.BeepBeep(frequency, duration)
or any other function to produce frequency/length defined sound
while using OpenOffice scripting?
Not just beep
Not calling prestored wav file, but generating a sound of a certain frequency during a certain time?
ON LINUX?
UBUNTU?
On PC, Windows, MS Office, VBA
it will be as below
===================================================
'Dim freq As Integer = Integer.Parse(txtFrequency.Text)
'Dim duration As Integer = Integer.Parse(txtDuration.Text)
Dim freq As Integer
Dim duration As Integer
freq = 500
duration = 1000 'ms
System.Console.Beep(freq, duration)
================================
When I run it on LibreOffice Calc it runs upto the
System.Console.Beep(freq, duration)
and
returns
BASIC syntax error
where the culprit is "System"
===============================================================
So I am looking for a way to call System.Console.Beep(freq, duration) with Basic as Script
Or some other way of GENERATING a sound with certain length and certain frequency
ANy help will be appreciated
System.Console.BeepBeep(frequency, duration)
System.Console.BeepBeep(frequency, duration)
OpenOffice 2.4 on Ubuntu 16.04
Re: System.Console.BeepBeep(frequency, duration)
On windows its just the Beep function which you can declare at the top of a module. Don't know whether these work under Linux with WINE installed.
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: System.Console.BeepBeep(frequency, duration)
Just tried.
Code: Select all
REM ***** BASIC *****
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Sub Main
msgbox "hello"
End Sub
Function eps ()
Msgbox "Func"
end Function
Sub press
'Dim freq As Integer = Integer.Parse(txtFrequency.Text)
'Dim duration As Integer = Integer.Parse(txtDuration.Text)
'Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Dim freq As Integer
Dim duration As Integer
'freq = Integer.Parse(txtFrequency.Text)
'duration = Integer.Parse(txtDuration.Text)
freq = 500
duration = 10
'System.Console.Beep(freq, duration)
msgbox "hello"
Call eps
Call Beep(500,1000)
End Sub
OpenOffice 2.4 on Ubuntu 16.04
Re: System.Console.BeepBeep(frequency, duration)
kernel32
Error Not declared
Error Not declared
OpenOffice 2.4 on Ubuntu 16.04
Re: System.Console.BeepBeep(frequency, duration)
'I found some kind of a walkaround.
Sub Main
'man page Beep
'Shell("firefox",2)
'msgbox "hello"
Shell("beep -f 1000 -n -f 2000 -n -f 1500 ")
End Sub
'Thanks anyway.
Sub Main
'man page Beep
'Shell("firefox",2)
'msgbox "hello"
Shell("beep -f 1000 -n -f 2000 -n -f 1500 ")
End Sub
'Thanks anyway.
OpenOffice 2.4 on Ubuntu 16.04