954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help With Playing an Unknown Selected Audio File

Here is a snippet of the code that I have thus far (Which I wish worked):

Dim PlayedSound as string

If ComboBox1.SelectedItem = "Sound 1" Then
PlayedSound = "Sound1"
My.Computer.Audio.Play(My.Resources.(PlayedSound, AudioPlayMode.Background)


So basically the combobox1 item which is selected is sent to a string and is then supposed to be played from my resources. The .wav file which is in my resources is named "Sound1" however I have no idea how to reference it. Any ideas?

Thanks! :)

westknight3
Newbie Poster
1 post since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

If ComboBox1.SelectedItem = "Sound 1" Then
you need to set Playsound="ur audio file name not Sound1"

Pgmer
Master Poster
714 posts since Apr 2008
Reputation Points: 54
Solved Threads: 121
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: