Click here to Skip to main content
15,916,835 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
The subject states it all. I want to make a New C# application when a new Message comes in , it should play a sound to show a new Message has arrived. Any ideas?

What I have tried:

i have tried to use the Soundplayer Class in C# doesnt Work as i expected.
Posted
Updated 8-Oct-17 4:43am
Comments
Mehdi Gholam 8-Oct-17 7:20am    
New message from where?
Member 12735615 8-Oct-17 8:27am    
it is a UDP chat application opened in 2 windows, So if one sends a message from PC 1 it displays a popup notification on the second PC.
Mehdi Gholam 8-Oct-17 9:26am    
If you don't have the source code or access to the application's api then no.

VB
My.Computer.Audio.Play("C:\audio\sound.wav")


or

VB
My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Beep)
 
Share this answer
 
textBox1.Text = openFileDialog1.FileName;
SoundPlayer player = new SoundPlayer();
player.SoundLocation = openFileDialog1.FileName;
player.Play();
}


System.Media.SystemSounds.Asterisk.Play();

Try anyone of these.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900