-
May 11th, 2005, 04:59 AM
#1
How to play sounds?
I want to play some windows standard sound as an error alarm.
How do it using C#?
Thanks.
-
May 11th, 2005, 05:20 AM
#2
Re: How to play sounds?
Hm, I don't think there is a way built in .NET, but, for example
Code:
[DllImport("winmm.dll")]
public static extern long PlaySound(string lpszName, long hModule, long dwFlags);
can be used. You can do likewise for Beep in the SDK, if all you want is a ... beep.
Also, in .NET 2.0 you have Console.Beep() with one overload.
And then there is ofcourse Windows Media Player to use :-)
HTH!
-
May 11th, 2005, 05:56 AM
#3
Re: How to play sounds?
It is really strange.
I hoped to find something as System. … .PlaySound…
but not
System.Diagnostics.Process.Start("ding.wav");
-
May 11th, 2005, 07:28 AM
#4
Re: How to play sounds?
do a little bit search in this forum, you will find answers
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|