I am currently using the code below to play *.wav files that are external to the program in a directory. I have been reading up on Embedding the file into the program so it's not placed outside in a seperate directory. Getting the file Embedded wasn't a problem but getting a refrence to it and getting it to play is another story.
This is my code for external *.wav files that works.
Is there an easier way to play the Embedded *.wav file ? I'm trying to get away without having a directory full of supporting files. Most of the stuff I have found on the Internet talks about creating a Class for it and then refrencing the class to play the *.wav file. Yet again it's a bit over my head on how to create a Class other than Project/Add Class -where to go from there...Code:Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long + Windows Form Designer Generated Code Dim SelectedFile As String = "C:\cow.wav" PlaySound(SelectedFile, 0, 0)




Reply With Quote