System.Console.BeepBeep(frequency, duration)

Keyboard macros or custom scripts

System.Console.BeepBeep(frequency, duration)

Postby abmuzzy » Mon Mar 04, 2019 6:42 pm

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
OpenOffice 2.4 on Ubuntu 16.04
abmuzzy
 
Posts: 4
Joined: Mon Mar 04, 2019 6:28 pm

Re: System.Console.BeepBeep(frequency, duration)

Postby JeJe » Mon Mar 04, 2019 7:13 pm

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
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1564
Joined: Wed Mar 09, 2016 2:40 pm

Re: System.Console.BeepBeep(frequency, duration)

Postby abmuzzy » Mon Mar 04, 2019 7:23 pm

Just tried.

Code: Select all   Expand viewCollapse view
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
abmuzzy
 
Posts: 4
Joined: Mon Mar 04, 2019 6:28 pm

Re: System.Console.BeepBeep(frequency, duration)

Postby abmuzzy » Mon Mar 04, 2019 7:25 pm

kernel32
Error Not declared
OpenOffice 2.4 on Ubuntu 16.04
abmuzzy
 
Posts: 4
Joined: Mon Mar 04, 2019 6:28 pm

Re: System.Console.BeepBeep(frequency, duration)

Postby abmuzzy » Tue Mar 05, 2019 6:53 am

'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.
OpenOffice 2.4 on Ubuntu 16.04
abmuzzy
 
Posts: 4
Joined: Mon Mar 04, 2019 6:28 pm


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 2 guests