logo
vbRad Home
Source Code
Book Reviews
Forum
Links
About Us
Contribute

Compare Databases with SQL Effects Clarity
 
 Audio implementation of Win32 Multimedia API

Posted on
2/11/2004
Author:
Brian Yule
Email:
Not Shown
Applies To OS:
NT, 9x, 2000
Product:
5, 6



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)





Add Your Comment  

Name: Email Address: all fields optional
Notify me via email when someone responds to this message (valid email required).

Enter the word:
 



Comments
#1. By Anonymous. Posted on 3/13/2006 6:02:52 AM
Is there a way to play a sound via the modem?

#2. By har. Posted on 3/22/2006 8:02:52 PM
http://www.dragongamez.com/killroy2.htm