Sign in to follow this  
Followers 0

How can I play Windows sounds (OK, Asterisk, Question, etc)

11 posts in this topic

#1 ·  Posted

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Noob

Share this post


Link to post
Share on other sites

#4 ·  Posted

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Noob

Share this post


Link to post
Share on other sites

#6 ·  Posted

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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I found HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\ by searching in registry for "notify.wav".

So try the same.

Edited by Zedna

Share this post


Link to post
Share on other sites

#8 ·  Posted

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\

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Finally I found true solution!

Use API MessageBeep() with DllCall() See here for details.

EDIT:

DllCall ("user32.dll", "int", "MessageBeep", "int", 0x00000040)
Edited by Zedna

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by Noob

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Zedna, it works!!!

:):P:):D:D

Thank you very much!!!

Edited by Noob

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
Sign in to follow this  
Followers 0