Visual Basic Resource coding???

Mista Panda

Poster
Joined
Jun 28, 2009
Messages
244
ok i have an older forum but it never got answered completely so im going to give it another shot


i cant figure out my coding to have a .wav playing in the background

what i came up with was

AudioPlayMode.Background = (My.Resources.tool)

but AudioPlayMode has an error under it

and thats all the code that i have

please dont send me to the Microsoft site b/c there code isnt what im looking for
 
What version of visual basic are you using 6.0/.NET? And you just want a background audio file to play?
 
What version of visual basic are you using 6.0/.NET? And you just want a background audio file to play?

its visual basic 2008 express edition

and yea i just want it to play in the back ground while the project is running
 
This isn't working?

My.Computer.Audio.Play("C:\Waterfall.wav", AudioPlayMode.Background)
 
This isn't working?

My.Computer.Audio.Play("C:Waterfall.wav", AudioPlayMode.Background)

nope nothing plays, what i do remember form programing class is that you import your file to resources (which i did) and in there some were it says My.resources.

thats all i remeber
 
What error are you getting and are you "using" the right libraries?
 
What error are you getting and are you "using" the right libraries?

im not getting any error, like my project will run normal except no sound from My.Computer.Audio.Play("C:\Waterfall.wav", AudioPlayMode.Background)

and what do you mean libraries are you talking about .wav?
 
http://msdn.microsoft.com/en-us/library/3e54ke41.aspx

Check here.. this appears to be the example you're looking for...

also note: The My.Computer.Audio.Play method is available only for Windows Forms applications, so make sure you're using the correct project type

i am using Forms app

this is what i have

My.Computer.Audio.Play(My.Resources.tool, AudioPlayMode.Background)

but no sound still there isnt an error so...
 
Ok, just got a chance to try this out... When I run it I get this error.

"Sound API only supports PCM Wave files"

So get audiocatalyst or whatever to convert your file, then it should work.
 

Latest posts

Back
Top