How to play a sound from a service in Windows 7

rh37hd

Member
Joined
Apr 15, 2011
Messages
6
Programming Experience
Beginner
Hello,

I created and installed a service. Everything is working properly except playing sounds. How can I play a wav (or any sound file if it's easier) in a vb.net service? I heard it might have something to do with running in a different session than the user that is logged in? How can I get around this? It works fine on XP.

Thanks!
 
To play a sound in a VB.NET service, you can use the `System.Media.SoundPlayer` class to play a WAV file. However, as you mentioned, running in a different session than the user that is logged in can cause issues with playing sounds.
 
To play a sound in a VB.NET service, you can use the `System.Media.SoundPlayer` class to play a WAV file. However, as you mentioned, running in a different session than the user that is logged in can cause issues with playing sounds.

Hopefully, 11.5 years later, this will work for them. ;)
 
Back
Top