Jump to content

How to do frequency and sound program


Recommended Posts

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

 

Link to comment
Share on other sites

  • Developers

Are you sure you even have a speaker that will do 33kHz at 90-100dB or were you planning to use your PC speaker for that?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

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)

 

Link to comment
Share on other sites

  • Developers

.. or just simply buy one in a store you can put in a power socket, but guess there is less fun in that?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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?

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

Link to comment
Share on other sites

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.

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

  • Developers

Most amplifiers and speakers will drop off around the 20kHz as the human hearing doesnt process it anymore, hence my comments.

jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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.

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

Link to comment
Share on other sites

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

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