Search Amazon:

Create and Play .Wav Format Files

The sample code linked to this page consists of a VB module containing a collection of routines that you can use to create and play wav format sound files.

While the code simply creates sine waves it provides the basic layout of the wav file. The routine Wav_BuildHeader creates the wav file header based on given parameters (sample rate, resolution, audio mode) in a byte array. Sample sine wave routines demonstrate the construction of the data. The wav files can be contained entirely in memory. You can also write the newly created wav file to disk using the Wav_WriteToFile routine.

Playback of the wav files is accomplished by invoking the canned functionality of the MultiMedia DLL winmm.dll.

By stepping through the code behind the sample form you can see how to call the various routines in the .bas module.

Create and play wav format files.
Download Source Code

Developed By

This sample was created and submitted by David M. Hitchner. If you have any questions or comments concerning these routines, David can be reached at k5dmh@bellsouth.net.

Instructions

Download this project and run it. Step through the routines in the .BAS module to get a full understanding of how the code works.

Sign In
  User Id 
  Password 


Submit Your Own Code and Articles




About TheScarms
About TheScarms

Ask me your programming questions

I read every email and answer all I can.

User Feedback: Be the first to add a comment! Items to Show:     

     
You must log in to post feedback.
Comment:    
 

If you use this code, please mention "www.TheScarms.com"

Email this page


TheScarms AppSentinel lets you securely copy protect and create evaluation versions of your software

TheScarms(tm) AppSentinel lets you quickly and easily create evaluation versions of your software and stop unauthorized copying and unregistered use of your programs!

Get your free
trial copy today!


      The World's Number 1 Web Host

© Copyright 2008 TheScarms