Use Internal PC Speaker to play a basic tune???
#1
Posted 27 July 2011 - 09:46 AM
I want to play a basic tune using the Internal PC Motherboard Speaker, not via the soundcard etc.
I have played with the piano.au3 examples and they are great, but sound output is via the soundcard, is there anyway of using AutoIT to create a tune to play via the Internal speaker?
Beep is very basic, but I couldn't figure out how to alter frequency etc, and I don't want to go down the method of dynawrap because you have to register dlls. Just need something I can wrap into an exe file to play on any PC to run a few sounds via internal speaker.
Any help would be appreciated.
#2
Posted 27 July 2011 - 09:57 AM
from the helpfile:
Beep
--------------------------------------------------------------------------------
Plays back a beep to the user.
Beep ( [ Frequency [, Duration ]] )
Parameters:
Frequency [optional] The frequency of the beep in hertz. Can be anywhere from 37 through 32,767 (0x25 through 0x7FFF). Default is 500 Hz.
Duration [optional] The length of the beep in milliseconds. Default = 1000 ms.
#3
Posted 27 July 2011 - 10:03 AM
AutoIt Beep function just uses the WinAPI Beep function. Here is its documentation: http://msdn.microsoft.com/en-us/library/ms679277(v=vs.85).aspx , we can call this simple function directly like this:
The remarks section says the following:
One time I didn't have my soundcard drivers installed, and Windows 7 "fell back" on the internal speaker. So if you're just doing this for yourself, or when you're developing and don't yet have a permanent solution, simply disable your soundcard in device manager and everything Beep call should be using the internal speaker.A long time ago, all PC computers shared a common 8254 programable interval timer chip for the generation of primitive sounds. The Beep function was written specifically to emit a beep on that piece of hardware.
On these older systems, muting and volume controls have no effect on Beep; you would still hear the tone. To silence the tone, you used the following commands:
net stop beep
sc config beep start= disabled
Since then, sound cards have become standard equipment on almost all PC computers. As sound cards became more common, manufacturers began to remove the old timer chip from computers. The chips were also excluded from the design of server computers. The result is that Beep did not work on all computers without the chip. This was okay because most developers had moved on to calling the MessageBeep function that uses whatever is the default sound device instead of the 8254 chip.
Eventually because of the lack of hardware to communicate with, support for Beep was dropped in Windows Vista and Windows XP 64-Bit Edition.
In Windows 7, Beep was rewritten to pass the beep to the default sound device for the session. This is normally the sound card, except when run under Terminal Services, in which case the beep is rendered on the client.
Edit: The MessageBeep function says the same as what I said above: "[Plays] A simple beep. If the sound card is not available, the sound is generated using the speaker."
Edited by Manadar, 27 July 2011 - 10:05 AM.
#4
Posted 27 July 2011 - 10:17 AM
But I need to run a script on logoff, which uses the internal onboard speaker to beep a tune on logoff to grab there attention.
Hope that makes sense, so yes the script will need to run from within windows 7 but use the onboard internal speaker.
But from what you said above, windows 7 is a big no no with Beep :-(
Thanks for your help so far...
Edited by sharpharp, 27 July 2011 - 10:19 AM.
#5
Posted 27 July 2011 - 01:21 PM
$destination = "..\GUI\mslogo.jpg" SplashImageOn("Splash Screen", $destination,250,50) Sleep(3000) SplashOff(
#6
Posted 27 July 2011 - 03:08 PM
#7
Posted 27 July 2011 - 06:34 PM
If I were you I would try searching for beep pc speaker. I bet 2 out of first 4 results will give you what you want.
eMyvnE
#8
Posted 27 July 2011 - 06:51 PM
Each time played does likely takes 3 months off the life of your hard drive though
Pardon my worthless/unusable post, but reading this thread made me think of the "novelty" programs that were floating around 20 years ago that "played music" in just this manner.
#9
Posted 29 July 2011 - 11:22 AM
You can send low-level commands to the servo motor of your hard drive, commanding it to move forward, then back. By putting it in a loop and inserting timers to vary the frequency and duration, you can play (buzzing) "songs" directly from your hard drive with no speaker at all!
Each time played does likely takes 3 months off the life of your hard drive though
Pardon my worthless/unusable post, but reading this thread made me think of the "novelty" programs that were floating around 20 years ago that "played music" in just this manner.
Thanks for all your replies, and i'll searched the examples scripts on this forum and yes they do work, BUT ONLY in older Windows XP machines. Now that the majority of the kit I use is based on Windows 7, the scripts do not work because Windows 7 was written to bypass the Internal Speaker...
Is there a different programming way to access the Internal Speaker (but still under Windows 7)????
Can't understand why MS would disable the speaker from within Windows...
#10
Posted 29 July 2011 - 02:08 PM
Once again, use the "search".
...or wait until someone does that for you. Yeah, wait.
eMyvnE
#11
Posted 29 July 2011 - 02:26 PM
It's irrelevant what you can or can't understand. In fact, considering you failed to follow very simple instructions that would lead you to the solution it's expected that you can't understand.
Once again, use the "search".
...or wait until someone does that for you. Yeah, wait.
Were you just born stupid, or did AutoIT turn you this way trannyexx?
I have searched and if you can listen for a minute rather than being such a bolshy idiot, you will see I tried the solutions and YES they work in XP but not windows 7. So there is no solution from any of the replies (other than the hard drive clicker) which I don't want to wreck my HDs with.
So next time you post a reply, say something constructive other than "Use Search" to up your post count....
Edited by sharpharp, 29 July 2011 - 02:27 PM.
#12
Posted 29 July 2011 - 03:40 PM
Oh.. huh, look - there's another solution I see in this thread.. squint if you need to.
Full-Screen Crash Recovery | Performance Counters in Windows - Measure CPU,Disk,Network etc Performance | Process, Thread, & DLL Functions UDFs | Windows Desktop Dimmer Shade | CrossHairs (FullScreen) | _EnumChildWindows (controls etc) | Rubber-Band Boxes using GUI's (_GUIBox) | File + Process Imports/Exports Information | _DLLStructDisplay (Debug!) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters
Wrappers/Modifications of others' contributions:
_DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity)
UDF's added support/programming to:
_ExplorerWinGetSelectedItems | MIDI UDF (original code: eynstyne)
(All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
#13
Posted 29 July 2011 - 04:13 PM
Wow, you really need handholding sharp. trancexx gave you what you needed.
Oh.. huh, look - there's another solution I see in this thread.. squint if you need to.
And what was that? -a link to using Search which i have already tried and tested and said only works under XP? Are you his buddy or something? Cos the pair of you come across just as dumb and dumber...
Edited by sharpharp, 29 July 2011 - 04:13 PM.
#14
Posted 29 July 2011 - 04:34 PM
#15
Posted 29 July 2011 - 06:11 PM
Charmed, I'm sure.Were you just born stupid, or did AutoIT turn you this way trannyexx?
I have searched and if you can listen for a minute rather than being such a bolshy idiot, you will see I tried the solutions and YES they work in XP but not windows 7. So there is no solution from any of the replies (other than the hard drive clicker) which I don't want to wreck my HDs with.
So next time you post a reply, say something constructive other than "Use Search" to up your post count....
eMyvnE
#16
Posted 29 July 2011 - 06:18 PM
You better tone down a notch because its not funny.And what was that? -a link to using Search which i have already tried and tested and said only works under XP? Are you his buddy or something? Cos the pair of you come across just as dumb and dumber...
Thread and topic closed and lets leave it that way.
Jos
Visit the SciTE4AutoIt3 Download page for the latest versions Forum Rules
Live for the present,
Dream of the future,
Learn from the past.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




This topic is locked
