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.

КОМЕНТАРІ • 46

  • @TheSoftwareCreators
    @TheSoftwareCreators  4 роки тому +2

    Some other options include:
    stackoverflow.com/questions/46134294/play-a-song-on-a-visual-basic-program

  • @tiagolopes5900
    @tiagolopes5900 7 років тому +5

    Thanks finally one video that show how to do this !!!! Thanks a lot

  • @sujoymishra2382
    @sujoymishra2382 4 роки тому +2

    What is the software are use in this?
    Can it work with notepa

  • @PauloCosta-it2pv
    @PauloCosta-it2pv 5 років тому +2

    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 ...

    • @RieLearn
      @RieLearn 4 роки тому

      how to call (input) music from internet ?

  • @armandoalmazan5894
    @armandoalmazan5894 4 роки тому +1

    how about pressing keyboard and display in label?

  • @ForSynthsSake
    @ForSynthsSake 3 роки тому +1

    How do i play a wav that is in project resources?

  • @fhalstocilva383
    @fhalstocilva383 4 роки тому

    the windows not detect audio in vb or in the project.
    how i resolve this?

  • @AdvancedPlacementMech
    @AdvancedPlacementMech 4 роки тому

    how d oyou play this from the vbs not the computer?

  • @linuxuser1234
    @linuxuser1234 4 роки тому

    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

  • @TCG137Media
    @TCG137Media 4 роки тому

    My.Computer.Audio.Play ("Audio Path")

  • @RafaelTeixeiraCastelo
    @RafaelTeixeiraCastelo 3 роки тому

    Awesome! Hey how to do Auto play once the Excel table is open? Thanks man

  • @alexkorinth6459
    @alexkorinth6459 4 роки тому

    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.

    • @TheSoftwareCreators
      @TheSoftwareCreators  4 роки тому

      Excel has it's own set of codes, these work for only vb.net apps.

    • @stuffing09
      @stuffing09 10 місяців тому +1

      why did you think that visual basic code works in excel?

  • @harishpawar8542
    @harishpawar8542 6 років тому +3

    it do not play the audio

  • @superrafy9415
    @superrafy9415 3 роки тому

    how can i stop the audio?

  • @FusionDeveloper
    @FusionDeveloper 2 роки тому

    Thank you.

  • @faitfranco7861
    @faitfranco7861 4 роки тому

    Are you doing video tutorials for kids?

  • @RieLearn
    @RieLearn 4 роки тому

    how to call (input) music from internet ?

  • @hermitthelegend1188
    @hermitthelegend1188 5 років тому

    How did you Change that music file to .wav?

    • @TheSoftwareCreators
      @TheSoftwareCreators  5 років тому +1

      There are many free audio & video file converters online. I used Audacity.

  • @cam.8056
    @cam.8056 7 років тому

    I need to make a sound plays while the Splash Screen is running, how do i do that?

    • @TheSoftwareCreators
      @TheSoftwareCreators  7 років тому

      Add the sound code to the form. Specify the form as splash screen.

  • @thiagomaia356
    @thiagomaia356 6 років тому

    When I click the button it gave error, what do I do?

    • @hey_therexd
      @hey_therexd 5 років тому

      you need to add.wav to the code
      make sure your sound file is in wav form

  • @jasperdahil8264
    @jasperdahil8264 8 років тому +1

    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?

    • @megalomanic7820
      @megalomanic7820 7 років тому +2

      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

  • @jayemalfonso6794
    @jayemalfonso6794 6 років тому +1

    how creat wav file ?

  • @swapnilsonsurkar2136
    @swapnilsonsurkar2136 8 років тому

    this is amazing ..but what if i want to select song which is in that form and then click on play button

    • @Maxxica
      @Maxxica 7 років тому

      Swapnil Sonsurkar I looked up how to do background music in Visual studio on UA-cam

    • @hakimhomecent1619
      @hakimhomecent1619 6 років тому

      I think you can apply that using openfiledialog. select the file using the open file dialog then play the song from the openfilediloag path.

  • @techbhanucomputer4389
    @techbhanucomputer4389 6 років тому +1

    not working

  • @breathingdoll
    @breathingdoll 3 роки тому

    tysm

  • @bessemjaouadi7704
    @bessemjaouadi7704 6 років тому

    Hi Sir , can I use 'AT command' with visual basic to send sms from connected gsm phone when I press key in visual basic ?

  • @sawakokuronuma8689
    @sawakokuronuma8689 6 років тому

    i want it to play automaticely when the music starts without the play botton

    • @thefrogge
      @thefrogge 6 років тому +1

      just use form1_load.....

    • @RieLearn
      @RieLearn 4 роки тому

      @Penesabormenta how to call (input) music from internet ?

    • @jeremytiempo9639
      @jeremytiempo9639 3 роки тому

      Use timer or form1 code property

  • @usama57926
    @usama57926 6 років тому

    thank u brother

  • @lukaslussem9463
    @lukaslussem9463 5 років тому

    Does not work, can it be done with VBA commandbutton?

  • @above_7864
    @above_7864 4 роки тому

    👍