View contents of this chapter

A Wave Player

A wave file is an audio stored on the computer. Compound multimedia control devices are required to play these files. Compound multimedia control devices get all their data from a file, not from an outside source such as an audio CD. The source code needed for this example is stored in the "Source Code\Chapter20\Wave Player" directory.

Private Sub Form_Load()
   MMControl1.DeviceType = WaveAudio
   MMControl1.FileName = App.Path & "\drum.wav"
   MMControl1.Command = "Open"
End Sub

Private Sub Form_Unload(Cancel As Integer)
   MMControl1.Command = "Close"
End Sub

Run the wave player to test the application. As you play the wave file, consider the following points.

  • The file plays only once and then the player's position points to the end of the file. Click the rewind button to return to the beginning.
  • The Record button is active. You can record at the beginning or end of the file and then rewind the file to play back the original sound plus your recording.


© Universal Teacher Publications        INDEX Previous Screen Next Screen