Jump to content

Cant hear Beep!!!


 Share

Recommended Posts

Have you read the help file?   ;)

Beep ( [ Frequency [, Duration ]] )

...The frequency of the beep in hertz. Can be anywhere from 37 through 32,767 (0x25 through 0x7FFF). Default is 500 Hz....

[EDIT]

Cant hear anything!!!

Read also this to understand why. Edited by taietel
Link to comment
Share on other sites

Check the speakers volume - turn it louder. The example from the help file works for me! [beep(500, 1000)]

[EDIT] On Windows 7 Beep does not make sound on a motherboard speaker, but on a sound card.

Edited by taietel
Link to comment
Share on other sites

try this script out!

the reason the pitch slider does not go past 18000 Hz is because that is the very limit of human hearing. or very close to it. i can hear up to 18000 but i have to blast my speakers.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <String.au3>

$SlidePitchRadioMin = 6001
$SlidePitchRadioMax = 12000


$Form1_1 = GUICreate("Sound Generator", 926, 275, -1, -1)
$MenuItem1 = GUICtrlCreateMenu("&File")
$MenuItem3 = GUICtrlCreateMenuItem("Exit", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("Help")
$MenuItem4 = GUICtrlCreateMenuItem("About", $MenuItem2)
$Button1 = GUICtrlCreateButton("Generate", 144, 8, 648, 65, $WS_GROUP)
$Slider1 = GUICtrlCreateSlider(0, 144, 924, 37)
GUICtrlSetLimit(-1, $SlidePitchRadioMax, $SlidePitchRadioMin)
GUICtrlSetData($Slider1, 9000.5)
$Slider2 = GUICtrlCreateSlider(0, 208, 924, 45)
GUICtrlSetLimit(-1, 4000, 0)
GUICtrlSetData($Slider2, 500)
$Label1 = GUICtrlCreateLabel("Pitch", 0, 125, 924, 17, BitOR($SS_CENTER,$SS_SUNKEN))
GUICtrlSetBkColor(-1, 0x99B4D1)
$Label2 = GUICtrlCreateLabel("Duration  0-4 seconds", 0, 184, 924, 17, BitOR($SS_CENTER,$SS_SUNKEN))
GUICtrlSetBkColor(-1, 0x3399FF)
$Radio1 = GUICtrlCreateRadio("Low pitch", 344, 96, 65, 25)
$Radio2 = GUICtrlCreateRadio("Medium Pitch", 416, 96, 81, 25)
GUICtrlSetState($Radio2, $GUI_CHECKED)
$Radio3 = GUICtrlCreateRadio("High Pitch", 504, 96, 65, 25)
$Label3 = GUICtrlCreateLabel(GUICtrlRead($Slider1) & " Hz", 16, 48, 76, 17, BitOR($SS_CENTER,$SS_SUNKEN))
$Label4 = GUICtrlCreateLabel("0.500 Sec", 16, 96, 76, 17, BitOR($SS_CENTER,$SS_SUNKEN))
$Frequency = GUICtrlCreateLabel("Frequency", 16, 24, 70, 17, $SS_CENTER)
$Seconds = GUICtrlCreateLabel("Seconds", 16, 72, 78, 17, $SS_CENTER)
GUISetState(@SW_SHOW)


HotKeySet("{END}","abort")


While 1
    $Msg = GUIGetMsg()
    Select

        Case $Msg = $Slider1
            GUICtrlSetData($Label3,GUICtrlRead($Slider1) & " Hz")

        Case $Msg = $Slider2
                $READ = GUICtrlRead($Slider2)
            If $READ = 0 Then
                GUICtrlSetData($Label4,"0.000 Sec")

            ElseIf $READ < 10 Then
                GUICtrlSetData($Label4,"0.00" & GUICtrlRead($Slider2) & " Sec")

            ElseIf $READ < 100 Then
                GUICtrlSetData($Label4,"0.0" & GUICtrlRead($Slider2) & " Sec")

            ElseIf $READ < 1000 Then
                GUICtrlSetData($Label4,"0." & GUICtrlRead($Slider2) & " Sec")

            Else
                $READ = String(GUICtrlRead($Slider2))
                $READ1 =  _StringInsert($READ, ".", -3)
                GUICtrlSetData($Label4,$READ1 & " Sec")


            EndIf


        Case $Msg = $GUI_EVENT_CLOSE
            Exit

        Case $Msg = $MenuItem3
            Exit


        Case $Msg = $MenuItem4
            MsgBox(32,"About Sound Generator","Version 1.00" & @crlf & "Made By: Scriptomator")


        Case $Msg = $Button1
            Beep(GUICtrlRead($Slider1),GUICtrlRead($Slider2))


        Case $Msg = $Radio1
            $SlidePitchRadioMin = 1
            $SlidePitchRadioMax = 6000
            GUICtrlSetLimit($Slider1, $SlidePitchRadioMax, $SlidePitchRadioMin)
            GUICtrlSetData($Slider1, 3000.5)
            GUICtrlSetData($Label3,GUICtrlRead($Slider1) & " Hz")

        Case $Msg = $Radio2
            $SlidePitchRadioMin = 6001
            $SlidePitchRadioMax = 12000
            GUICtrlSetLimit($Slider1, $SlidePitchRadioMax, $SlidePitchRadioMin)
            GUICtrlSetData($Slider1, 9000.5)
            GUICtrlSetData($Label3,GUICtrlRead($Slider1) & " Hz")

        Case $Msg = $Radio3
            $SlidePitchRadioMin = 12001
            $SlidePitchRadioMax = 18000
            GUICtrlSetLimit($Slider1, $SlidePitchRadioMax, $SlidePitchRadioMin)
            GUICtrlSetData($Slider1, 15000.5)
            GUICtrlSetData($Label3,GUICtrlRead($Slider1) & " Hz")




    EndSelect
WEnd

Func abort()
exit
EndFunc
Edited by scriptomator
Link to comment
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
 Share

  • Recently Browsing   0 members

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