Visual Basic 2010 Express Tutorial 21 - Playing Sound Files (SpeakABCs Part 5 of 11)



For this tutorial, wav sound files will be used. For users with MP3 files, the MP3 sound files will work the same way. 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”).

SpeakABCs Tutorials
Tutorial 18 - Form Setup and KeyPresses
Tutorial 19 - RadioButtons adn ASCII Values
Tutorial 20 - Changing Background and Font Color With the Color Dialog
Tutorial 21 - Playing Sound Files
Tutorial 22 - Adding a Menu
Tutorial 23 - Inserting a SplashScreen
Tutorial 24 - Adding an AboutBox
Tutorial 25 - Formatting Text and a TextBox to Make a HelpBox
Tutorial 26 - Adding an Icon
Tutorial 27 - Wrapping Up the Application

You are more than welcome to take the code and do what you please with it - minus the girl’s wav files (please make your own). The compiled SpeakABCs applications, on the download page, must not be distributed or modified. The compiled SpeakABCs applications are a little different than the one shown in these tutorials.

The SpeakABCs applications on the download page, were built with XOJO (RealBasic). XOJO (RealBasic) is considered to be somewhat of a Visual Basic for Mac.
For more information on XOJO (RealBasic) see www.xojo.com

SpeakABCs Downloads (Please do not distribute the Girl’s Voice Wavs. Please Make your own Wavs)
SpeakABCsCode.zip
WAV_Folder.zip
ABC_icons.zip




The current version of Visual Basic can be downloaded for free at Microsoft's Website