Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Visual Basic 2010 Express Tutorial 21 - Playing Sound Files - SpeakABCs 5/11

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
9,581
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 23, 2010

http://www.SchoolFreeware.com
For this tutorial, wav sound files will be used. This tutorial will cover three ways sound files can be played: Hard coded, part of the solution, and by relative location.

For relative location use Application.StartupPath

For example if a.wav is within the WAV_Folder, then the code to play would be:

My.Computer.Audio.Play(Application.StartupPath + "\WAV_Folder\a.wav")

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (SchoolFreeware)

  • When I run it, the sound can't be played. It closes and shows an error

    What do I have to do?

  • @334anoniem What is the error message? Also, the code can be downloaded at SchoolFreeware's website.

see all

All Comments (17)

Sign In or Sign Up now to post a comment!
  • Is there a way to make the sound files a part of the.exe file?? in other words combine the sound file into the .exe so that there is no folder after building the project??? if there isnt then is there a way to automatically send the sound files to the computers %Temp% folder?? i want to create a project that has sound and i want to distribute it to my friends but i dont want them to mess the sound files up or accidentlyMove them, so could someone tell me how to do either of my ideas?OranotherWay

  • Help! I can't find the sound files! Would someone end me the link?

  • it was awsome dude...

  • Okay, you can do it much easier than playing a sounds! -ENTER- means end of the line

    Sub speak (byval text as string) - next line -

    dim speech as object = createobject ("sapi.spvoice") -next line -

    speech.speak(text) -next line -

    end sub

    -next line -

    You can call this sub and give any text as an argument - > speak("Hello")

  • how to make the audio off?

  • hey, how to copy a the file from the solution using Folder Browse Dialog?

  • @SchoolFreeware It says something like "It's not valid wave" something like that.

  • @crendix they need the sound too

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more