Noob Posted January 7, 2007 Posted January 7, 2007 AutoIt sound functions can help when we need to play mp3 and wav files, but how can I go about playing Windows sounds like Question, Exclamation, OK, and Asterisk?
Zedna Posted January 7, 2007 Posted January 7, 2007 It's stored in registry: $wav = RegRead("HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\SystemStart\.Current","") ;~ $wav = C:\WINDOWS\media\notify.wav ;~ MsgBox(0,'',$wav) SoundPlay($wav,1) SystemStart, SystemAsterisk, SystemExclamation, SystemQuestion, ... Resources UDF ResourcesEx UDF AutoIt Forum Search
Noob Posted January 7, 2007 Author Posted January 7, 2007 (edited) Zedna, thanks much! I'm glad it is possible. But for some reason when I run the above script I hear no sound. But I do hear the sound when I just do the following:SoundPlay("C:\WINDOWS\media\notify.wav",1) Edited January 7, 2007 by Noob
BALA Posted January 7, 2007 Posted January 7, 2007 Your computer may have it's sound files in a different place. [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Noob Posted January 7, 2007 Author Posted January 7, 2007 (edited) Your computer may have it's sound files in a different place.Thanks, BALA. I'm looking for a solution that would work on any pc. The script by Zedna gave me hope it would be possible, but for some reason it's not working yet. Edited January 7, 2007 by Noob
Zedna Posted January 7, 2007 Posted January 7, 2007 Zedna, thanks much! I'm glad it is possible. But for some reason when I run the above script I hear no sound. But I do hear the sound when I just do the following: SoundPlay("C:\WINDOWS\media\notify.wav",1) Just uncoment line with MsgBox() and check if that file exists. Also run RegEdit and look at HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\ Note: I tested this on WIN98, so maybe on WINXP it may be somewhere else. Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted January 7, 2007 Posted January 7, 2007 (edited) I found HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\ by searching in registry for "notify.wav". So try the same. Edited January 7, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted January 7, 2007 Posted January 7, 2007 Thanks, BALA. I'm looking for a solution that would work on any pc. The script by Zedna gave me hope it would be possible, but for some reason it's not working yet.My method will not work if user have non default Windows Scheme:HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\ Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted January 7, 2007 Posted January 7, 2007 (edited) Finally I found true solution!Use API MessageBeep() with DllCall() See here for details.EDIT: DllCall ("user32.dll", "int", "MessageBeep", "int", 0x00000040) Edited January 7, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Noob Posted January 7, 2007 Author Posted January 7, 2007 (edited) Thanks. The location on my machine is the same:HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\(and this pc uses the default sound scheme).I suspect a problem may be that the value for $wav your scrips it getting is %SystemRoot%\media\Windows XP Notify.wav and the following will not play: SoundPlay("%SystemRoot%\media\Windows XP Notify.wav",1)oÝ÷ Ù»¶¬v¬jëh×6SoundPlay("C:\WINDOWS\media\Windows XP Notify.wav",1)So my noob-type question is how I can modify your script to I guess substitute the %SystemRoot% part with @WindowsDir?EDIT: I'm going to look at the other solution you just posted. Thanks! Edited January 7, 2007 by Noob
Noob Posted January 7, 2007 Author Posted January 7, 2007 (edited) Zedna, it works!!! Thank you very much!!! Edited January 7, 2007 by Noob
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now