Jump to content

Beep() is not working.


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

PoojaKrishna,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!"

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!"

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

"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.

Link to comment
Share on other sites

  • 7 years later...
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

Link to comment
Share on other sites

  • Moderators

WiValdiBB,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...