VB MCI Control Does Not Support PC Speaker DriverID: Q84268
|
The MCI custom does not support playing wave (.WAV) sound files through a PC speaker driver such as SPEAKER.DRV. The MCI custom control (and the Windows Media Player application) uses the MCI sound drivers, which do not support the PC speaker. The Windows default sounds and the Sound Recorder application are the only way to play sounds through the SPEAKER.DRV PC speaker driver.
The MCI control manages the recording and playback of multimedia files
on Media Control Interface (MCI) devices, such as audio boards, MIDI
sequencers, CD-ROM drives, audio CD players, video disc players, and
videotape recorders and players.
Although the MCI control will not allow you to play .WAV files through the
PC speaker, you can use the OLE Client Controls provided with the
Professional Edition of the Microsoft Visual Basic for Windows, or with the
Microsoft Visual Basic for Windows Professional Toolkit to create and play
a linked Sound Recorder object from your Visual Basic for Windows program.
The following is an example of this behavior. (Note that you must have the
appropriate Windows sound drivers loaded in order to run this program):
OLEClient1.Class = "SoundRec"
OLEClient1.Protocol = "StdFileEditing"
OLEClient1.SourceDoc = "C:\windows\chimes.wav" ' Name of .WAV file.
OLEClient1.SourceItem = "LINK"
OLEClient1.ServerType = 0 ' Linked object.
OLEClient1.Action = 1 ' Create object from source file.
OLEClient1.Action = 7 ' Activate Sound Recorder - plays sound.
OLEClient1.Action = 10 ' Delete the object.
-or-
OLE1.Class = "SoundRec"
OLE1.SourceDoc = "C:\windows\chimes.wav" ' Name of .WAV file.
OLE1.SourceItem = "LINK"
OLE1.Action = 1 ' Create object from source file.
OLE1.Action = 7 ' Activate Sound Recorder - plays sound.
OLE1.Action = 10 ' Delete the object.
SPEAKER.DRV and WDL AND windows AND 3.10
Additional query words: 1.00 2.00 3.00 MCI.VBX
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: June 23, 1999