Jump to content

Write BEEP to MP3?


Recommended Posts

I was wondering if there was some way to capure the output of the BEEP function and write it to an audio file, much like can be done with TTS?

Or if there is a way to create an audio stream and write a beep at the desired frequency to a file?

The reason I ask is because I want to create a series of audio files that have different frequencies in each(left and right audio channel) above the hearing range to create an effect of wakefulness.

And I want to test multipule frequency combinations.

But on topic, is what I am trying to do possible in autoit? (I'm sure it is, I just have no idea where I would begin)

Thanks!

PS: I can edit the frequencies into their respective channels with audio software, I just need to make the audio files for each frequency.

Edited by nullschrittx
Link to comment
Share on other sites

; this can be read from a file
Global $beep_A[10][2] = [[37, 100],[50, 100],[70, 100],[90, 100],[110, 100],[130, 100],[150, 100],[180, 100],[210, 100],[100, 2000]]
For $i = 0 To UBound($beep_A) - 1
Beep($beep_A[$i][0], $beep_A[$i][1])
Next

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

; this can be read from a file
Global $beep_A[10][2] = [[37, 100],[50, 100],[70, 100],[90, 100],[110, 100],[130, 100],[150, 100],[180, 100],[210, 100],[100, 2000]]
For $i = 0 To UBound($beep_A) - 1
Beep($beep_A[$i][0], $beep_A[$i][1])
Next

While I appreciate your contribution it appears you did not understand my inquiry.

I need to create an actual audio file, a real audio file, that I can open in a audio editing application. Each file being a "beep" at a specified frequency.

Basically rather than hearing the beep, I want to write the output to an audio file.

Link to comment
Share on other sites

The best AutoIt can do in the music department is probably BASS:

I'm taking a look into it, perhaps this library can provide me with a way to directly output two different frequency beeps to the left and right audio channel.

Although there seems to be a lot to look through.

If if helps explain what I am trying to do, the basis of the idea is binueral beats. A different frequency to the left and right ear,only I wish to consistantly swap frequencies to keep the brain stimulated, to promote wakefulness.

Link to comment
Share on other sites

I don't think the beep goes through the sound card, thus you cannot capture it. You could try generating your own tone using a program like Audacity (freeware).

That is unfortunate, as it will be a pain in the ass, although I suppose once I figure out how I could just automate it using autoit, while it's not optimal, it will work.

Link to comment
Share on other sites

According to this MSDN article, the Beep function doesn't work on Vista or WinXP x64, but does on Windows 7. On Windows 7 it now sends the tone through the soundcard although there's an annoying click at the end of the sound.

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

You might try this thread and see if it works, I've never used it myself, but the BASS UDF is a really nice set of audio utilities.

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

Maybe this will give you some hints about creating sound data in code: http://www.autoit.de/index.php?page=Thread&postID=219995

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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