akira2891

How to do frequency and sound program

41 posts in this topic

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



What is your question? :P


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

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

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

Share this post


Link to post
Share on other sites

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

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

#6 ·  Posted (edited)

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

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

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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?


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

Share this post


Link to post
Share on other sites

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

#14 ·  Posted (edited)

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

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

jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

or buy some glue traps

sorry it's friday

Share this post


Link to post
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.


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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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