I'm using the following code to play an mp3 file.
This works great but requires an absolute path to the file which is undesirable.
I tried changing the 2nd line to
but this gives a "Cannot implicitly convert type 'byte[]' to 'string'" error and adding .tostring() does not make things any better.
How can I get it to play a mp3 in the resource file ?
C#:
WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer();
wplayer.URL = "c:\\sample.mp3";
wplayer.controls.play();
This works great but requires an absolute path to the file which is undesirable.
I tried changing the 2nd line to
C#:
wplayer.URL = Properties.Resources.sample
How can I get it to play a mp3 in the resource file ?