Jump to content
akira2891

How to do frequency and sound program

Recommended Posts

akira2891

Hi, i have s silly problem with mouses in a house and i heard that ultrasound frequency: 15 - 33 kHz konst and sound 90 - 100 dB anoying them.

How can i make this program ?

 

#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 440, 219, 688, 348)
$Slider1 = GUICtrlCreateSlider(8, 40, 422, 45, $TBS_NOTICKS)
GUICtrlSetLimit(-1, 200, 0)
GUICtrlCreateLabel("Frequency kHz ( 0-200 kHz )", 16, 16, 140, 17)
GUICtrlCreateLabel("Sound in dB ( 0-200 dB )", 18, 93, 120, 17)
$Slider2 = GUICtrlCreateSlider(8, 116, 422, 45, $TBS_NOTICKS)
GUICtrlSetLimit(-1, 200, 0)
$startBtn = GUICtrlCreateButton("Start", 16, 176, 75, 25)
$stopBtn = GUICtrlCreateButton("Stop", 104, 176, 75, 25)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites
TheDcoder

What is your question? :P


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
akira2891

How to make this frequency in kHz + - with slider and dB + - with slider too ? So when i press start to my speakers start to produce that frequency and when i moving slider frequency or sound goes up or down.

Share this post


Link to post
Share on other sites
akira2891

Im planning to make program + buy speaker and connect to pc speakers untill i dont caught a little beast

Share this post


Link to post
Share on other sites
kcvinu

I think you can make it very easy with 555 timer ic and a few extra components. It will work with 9v pp3 Battery. You don't need to depend your computer for this task. After all, selecting a good speaker is the key in this project. 

Edited by kcvinu

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites
iamtheky

I would walk around the pawn shop with a tuner and find two old-ass pieces of electronics that sweep those frequencies with their degraded coils.  Throw them in a fireproof box in the attic and cycle power to them periodically?


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
akira2891

I know there is a devices for that but thats not fun, tu give money for something u can make if its possible :D

Share this post


Link to post
Share on other sites
iamtheky
while 1

beep(random(0x25 , 0x7FFF , 1) , random(5000, 10000 , 1))

wend

 

beeps between 15-32.7 kHz, lasting between 5 and 10 seconds, for eternity.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
JohnOne

I tried those silly devices once, they don't work, and if they did they'd drive the mouse away rather than help you catch it.

Good old mouse trap is what you meed, BANG! off with it's little rodent head.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
UEZ
  • Like 1

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
iamtheky

also, to add to mine.  Once you drop below about 150hz on my laptop the speaker will squeal and the tone will wobble.   There will no doubt be a combination of "degraded speaker + overdriving" that will let you get away with a single input rather than having to sweep the frequencies yourself, mine doesnt catch the whole range (tops out around 25 kHz) but it is multi tonal and annoying as balls. 

It also helps to teach others 'frequency'

beep(1, 1000) = 2 tones squealed

beep(2, 1000) = 4 tones squealed

beep(7, 1000) = 14 tones and you start hearing the wobble as it begins to sound like alternating tones instead of a stop/start

beep(12 , 1000) = 24 tones is roughly the point where i lose distinct tones

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
pcjunki

or buy some glue traps

sorry it's friday

Share this post


Link to post
Share on other sites
iamtheky

my laptop speaker will hit the 32.7 k Hz max, the tone emitted when sending the ultra low tones is capping at 25.   Apparently every configuration will fail with slight differences when being overdriven, but i just started watching an educational video on the subject, hopefully i learn something.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
BrewManNH

How do you know your speaker can output 32.7Khz? What are you using to measure the output of it?

 


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
akira2891

or buy some glue traps

sorry it's friday

Hehe, i tried with glue, i was have glue on paper on whole house in every corner and i see mouse get arround it. 3 weeks and he didnt catch, i even try with many foods and no success.

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

×