How to play a sound file in VB (visual basic .net)
Вставка
- Опубліковано 6 лют 2025
- This video will show you how you can play or open an sound/music file on your form (background) in visula basic of visual studio.This video is applicable for visual basic 2010, visual studio 2012 , 2013, 2015. The codes are very simple and easy to use. But remember to convert your audio file to .wav (wave file). Because visual studio can not support other formats.
Subscribe: bit.ly/discoverpro
Thanks for watching. Hope this video was helpful, leave a like if it was. Please comment for problem solving.
Some other options include:
stackoverflow.com/questions/46134294/play-a-song-on-a-visual-basic-program
Thanks finally one video that show how to do this !!!! Thanks a lot
What is the software are use in this?
Can it work with notepa
Don't want to be mean but this is only usefull to get a bit how does programing works, cause if u pass that small app to other people use i'm 110% sure it won't work since the directory is set on his own computer you should teach the newbies that come here how to put that same audio into the app files. My advice for you guys is find a better tutorial its pretty basic to put it into your app and make it 100% functional. Just saying ...
how to call (input) music from internet ?
how about pressing keyboard and display in label?
How do i play a wav that is in project resources?
the windows not detect audio in vb or in the project.
how i resolve this?
how d oyou play this from the vbs not the computer?
I want to make ai program when every time I activate a button it says system online etc or proximity alert for a radar application and sometimes random
My.Computer.Audio.Play ("Audio Path")
Awesome! Hey how to do Auto play once the Excel table is open? Thanks man
Does this work on Excell as a software, and not just in VB.net? I'm trying the same code you used in my program, but it won't even recognize "My" as a valid function type. It just gives me n "Object Required" error whenever I press the button.
Excel has it's own set of codes, these work for only vb.net apps.
why did you think that visual basic code works in excel?
it do not play the audio
how can i stop the audio?
Thank you.
Are you doing video tutorials for kids?
I was new when I made this.
how to call (input) music from internet ?
How did you Change that music file to .wav?
There are many free audio & video file converters online. I used Audacity.
I need to make a sound plays while the Splash Screen is running, how do i do that?
Add the sound code to the form. Specify the form as splash screen.
When I click the button it gave error, what do I do?
you need to add.wav to the code
make sure your sound file is in wav form
How do you add sound effects while a picturebox is moving?I am trying to add footstep sound effect while a picturebox is moving. BUT, the picturebox can only move when the sound effect is done. Here's my script for how the sound effect will play:IF (a key is down) THENMy.Computer.Audio.Play(My.Resources.footsteps, AudioPlayMode.WaitToComplete)END IFCan you put in a script for it, please?
if (Key Is Pressed) Then
My.Computer.Audio.Play("My.Resources.footsteps")
Walking = 1
End If
Sub Form1_Load(etc)
timer1.start
End Sub
sub Timer1_tick(etc)
if Walking = 1 then
Walking = 0
Picturebox(Number).X = Picturebox(Number).X +(Amount)
end sub
Dose That Help? Tested It Works 4 Me
how creat wav file ?
search google "mp3 to wav"
try use format factory
this is amazing ..but what if i want to select song which is in that form and then click on play button
Swapnil Sonsurkar I looked up how to do background music in Visual studio on UA-cam
I think you can apply that using openfiledialog. select the file using the open file dialog then play the song from the openfilediloag path.
not working
tysm
Hi Sir , can I use 'AT command' with visual basic to send sms from connected gsm phone when I press key in visual basic ?
i want it to play automaticely when the music starts without the play botton
just use form1_load.....
@Penesabormenta how to call (input) music from internet ?
Use timer or form1 code property
thank u brother
Does not work, can it be done with VBA commandbutton?
👍