Jump to content
PoojaKrishna

Beep() is not working.

Recommended Posts

PoojaKrishna

Hi friends,

Beep() fuction is not working with my vista. It was working correctly but not now.

Beep(500,1000)

I'm using AutoIt 3.2.10.0 and the device manger of my system shows the beep device status as "This device is working properly".

Please help.

Pooja.

Share this post


Link to post
Share on other sites
Melba23

PoojaKrishna,

Beep works fine on my Vista (HP x32 SP2). Must be your machine, sorry

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
PoojaKrishna

PoojaKrishna,

Beep works fine on my Vista (HP x32 SP2). Must be your machine, sorry

M23

Thanks for testing Melba. It may be some internal problem of my system. The code is working with my XP system. I tested in two Vista systems and was not working.

Share this post


Link to post
Share on other sites
trancexx

Is this working:

DllCall("kernel32.dll", "int", "Beep", "dword", 500, "dword", 1000)

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
PoojaKrishna

Is this working:

DllCall("kernel32.dll", "int", "Beep", "dword", 500, "dword", 1000)
Not working.

Share this post


Link to post
Share on other sites
Drakthor

Not working.

Try:

Beep(5000,2000)

If that works then your machine cannot sound that frequency.

Edited by thejay2012

Share this post


Link to post
Share on other sites
BrettF

Well depending on your computer's age, you might actually have to enable it. Check out your sound card mixer. I know mine has an option for PC Beep.

Cheers,

Brett

Share this post


Link to post
Share on other sites
PoojaKrishna

Well depending on your computer's age, you might actually have to enable it. Check out your sound card mixer. I know mine has an option for PC Beep.

Cheers,

Brett

Thanks for your suggestions.

My system does not have the beep option in sound mixer. The beep fuction in VB6 produces sound in my system.

I replaced beep fuction in my AutoIt code with soundplay().

SoundPlay (@ScriptDir&"\Ding.wav,1)

The Ding.wav is attached.

I hope it will help somebody having the same problem.

Ding.wav

Pooja.

Share this post


Link to post
Share on other sites
GEOSoft

Thanks for your suggestions.

My system does not have the beep option in sound mixer. The beep fuction in VB6 produces sound in my system.

I replaced beep fuction in my AutoIt code with soundplay().

SoundPlay (@ScriptDir&"\Ding.wav,1)

The Ding.wav is attached.

I hope it will help somebody having the same problem.

Ding.wav

Pooja.

Better yet.

Opt("ExpandEnvStrings", 1)
$sSnd = RegRead("HKCU\AppEvents\Schemes\Apps\.Default\.Default\.Current", "")
SoundPlay($sSnd)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
PoojaKrishna

Better yet.

Opt("ExpandEnvStrings", 1)
$sSnd = RegRead("HKCU\AppEvents\Schemes\Apps\.Default\.Default\.Current", "")
SoundPlay($sSnd)
George,

Thanks for the code. The code is working with wait parameter.

Opt("ExpandEnvStrings", 1)
$sSnd = RegRead("HKCU\AppEvents\Schemes\Apps\.Default\.Default\.Current", "")
SoundPlay($sSnd,1)

Pooja

Share this post


Link to post
Share on other sites
GEOSoft

George,

Thanks for the code. The code is working with wait parameter.

Opt("ExpandEnvStrings", 1)
$sSnd = RegRead("HKCU\AppEvents\Schemes\Apps\.Default\.Default\.Current", "")
SoundPlay($sSnd,1)

Pooja

Thanks for catching that. It's better to use the default sound than it is to add a file (which exists on all Windows systems) to @ScriptDir

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
trancexx

Not working.

That code was there for you to debug it. You should have done something like this to see what's happening:

$aCall = DllCall("kernel32.dll", "int", "Beepu", "dword", 500, "dword", 1000)
$iError = @error

If $iError Then
    ConsoleWrite("!DllCall error! @error = " & $iError & @CRLF)
Else
    If $aCall[0] Then
        ConsoleWrite("No error. Function returned " & $aCall[0] & @CRLF)
    Else
        ConsoleWrite("!No error calling the function, but function returned 0. It means function failed." & @CRLF)
    EndIf
EndIf

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
PoojaKrishna

That code was there for you to debug it. You should have done something like this to see what's happening:

$aCall = DllCall("kernel32.dll", "int", "Beepu", "dword", 500, "dword", 1000)
$iError = @error

If $iError Then
    ConsoleWrite("!DllCall error! @error = " & $iError & @CRLF)
Else
    If $aCall[0] Then
        ConsoleWrite("No error. Function returned " & $aCall[0] & @CRLF)
    Else
        ConsoleWrite("!No error calling the function, but function returned 0. It means function failed." & @CRLF)
    EndIf
EndIf
Thanks for the modified code with debug.

Executed it with a small edit "Beepu"->"Beep". It returns "No error. Function returned 1". But no beep was heard.

$aCall = DllCall("kernel32.dll", "int", "Beep", "dword", 500, "dword", 1000)
$iError = @error

If $iError Then
    ConsoleWrite("!DllCall error! @error = " & $iError & @CRLF)
Else
    If $aCall[0] Then
        ConsoleWrite("No error. Function returned " & $aCall[0] & @CRLF)
    Else
        ConsoleWrite("!No error calling the function, but function returned 0. It means function failed." & @CRLF)
    EndIf
EndIf

Share this post


Link to post
Share on other sites
trancexx

Thanks for the modified code with debug.

Executed it with a small edit "Beepu"->"Beep". It returns "No error. Function returned 1". But no beep was heard.

$aCall = DllCall("kernel32.dll", "int", "Beep", "dword", 500, "dword", 1000)
$iError = @error

If $iError Then
    ConsoleWrite("!DllCall error! @error = " & $iError & @CRLF)
Else
    If $aCall[0] Then
        ConsoleWrite("No error. Function returned " & $aCall[0] & @CRLF)
    Else
        ConsoleWrite("!No error calling the function, but function returned 0. It means function failed." & @CRLF)
    EndIf
EndIf
"Beepu" was to put you to the working speed.

You should really check your buzzer. Take a screwdriver and go (brake something).

But before that run this:

RunWait(@ComSpec & " /c " & 'net start Beep', "", @SW_HIDE)
Beep(500, 1000)

edit:

Don't forget #RequireAdmin since you are on Vista

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
PoojaKrishna

"Beepu" was to put you to the working speed.

You should really check your buzzer. Take a screwdriver and go (brake something).

But before that run this:

RunWait(@ComSpec & " /c " & 'net start Beep', "", @SW_HIDE)
Beep(500, 1000)

edit:

Don't forget #RequireAdmin since you are on Vista

Thanks again for the new code, but no beep.

Yes, something is wrong with buzzer. I repalced beep() with soundplay() in my code.

  • Like 1

Share this post


Link to post
Share on other sites
WiValdiBB
On 25.06.2009 at 11:05 AM, PoojaKrishna said:

 

Thanks again for the new code, but no beep.

Yes, something is wrong with buzzer. I repalced beep() with soundplay() in my code.

The same problem, Win 7 32 bits, no beep, PC plays all sounds correctly, interesting what and why

Share this post


Link to post
Share on other sites
Melba23

WiValdiBB,

Probably the same reason as 8 years ago - your PC speaker is either not working or not fitted.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
WiValdiBB
51 minutes ago, Melba23 said:

Probably the same reason as 8 years ago - your PC speaker is either not working or not fitted

Lenovo Y 550, it's laptop, with XP was fine, just installed Win 7 no beep, even , no SoundPlay for now, all sounds other sounds (system sounds, mp3 musics, movies etc ) are playing perfectly
I'm investigating now , reverse to http://www.digitalcitizen.life/how-disable-system-beep-windows-7?page=1

Thx M23 anyway

Edited by WiValdiBB

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×