How to play sound from resource file?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to play particular sound when user presses a button.
I found PlaySound function in the Platform SDK, it works fine, but it can
only play external wav file. I'd like to load my sound file into app
resources and play it from there, similar to how I process image files.
Any ideas?

Thank you.
 
Hi,

I dont know of nothing in the framework for playing sounds, I use PlaySuond
from the Win32 API , I believe you will have to P/Invoke this. You could
create a file in memory , but not sure if it will work.

Now I did remember that I hear about a managed DirectX implementation, there
you should find something to play sounds , it would be wise to take a look
into this.


cheers,
 
Back
Top