By Brian Yule (byule at PembrokeTechnology.com)
Download the project (40 kb)
Related:
Visual Basic TAPI Implementation
This audio implementation is written to:
- Play and record WAV files.
- Play and record Audio Streams.
- Record, Pause and Append to an existing Audio Stream.
This code has been used for:
- A telephone answering machine by integrating with TAPI.
- Video Conferencing by integrating with Video For Windows.
The code comes as standard .VBP with a bunch of classes that you can reuse
and a form to drive the classes and show the implementation.
The record new records a WAVE file to the C:\\MEDIA\ Directory.
The file is named Untitled.Wav. When the file is recorded the list will refresh with the new file
located in the list for playing!
It doesn't have any dependencies! At the same time, the project is a complete wrapper around winmm.dll
that ships with Windows. Below is an example of how easy it is to drive the classes:
| Add the following to a Form |
'Start Recording
Private Sub cmdRecord_Click()
Call s.Record(File1.Path & BACKSLASH & SaveFileName)
End Sub
'Append Recording to an existing file
Private Sub cmdAppend_Click()
If Dir(File1.Path & "\Untitled.wav") <> vbNullString Then
Call s.Record(File1.Path & BACKSLASH & SaveFileName, True)
End If
End Sub
'End Recording
Private Sub cmdEndRecord_Click()
Call s.EndRecord
End Sub
Download the project (40 kb)