How To Use MCI to Play AVI/WAVE Files from Memory (155360)
The information in this article applies to:
- Microsoft Platform Software Development Kit (SDK) 1.0
This article was previously published under Q155360 SUMMARY
MCI (Media Control Interface) provides a high-level interface to play
multimedia files (or "device elements" as defined in MCI). By default, MCI
WAVE/AVI drivers (MCIAVI and MCIWAVE) use mmioOpen to open a file. If the
file name contains a "+" character, mmioOpen will look for a custom
procedure as identified by the three-character file extension to handle the
reading and writing of a file. This technique can be applied to allow MCI
to play WAVE/AVI files that are already loaded into memory.
The following steps demonstrate this approach. We use "MEY" as the file
extension in this example:
- Install a custom MMIO procedure as follows:
mmioInstallIOProc(mmioFOURCC('M', 'E', 'Y', ' '), (LPMMIOPROC)IOProc,
MMIO_INSTALLPROC | MMIO_GLOBALPROC);
Note that IOProc is the name of the custom procedure.
- Use the MCI open command except to add a plus sign (+) at the end of a
file name. For instance,
open test.MEY+ type waveaudio (or avivideo) alias test
Because there is a "+" character in the file name, mmioOpen will not
open any files. Instead, the custom mmio procedure is identified.
Subsequently, all the I/O messages are routed to that procedure.
- Then, we can use usual MCI command. For instance:
- When done with this custom mmio procedure, we should remove it by
mmioInstallIOProc(mmioFOURCC('M', 'E', 'Y', ' '), NULL,
MMIO_REMOVEPROC);
Modification Type: | Minor | Last Reviewed: | 7/11/2005 |
---|
Keywords: | kbhowto KB155360 kbAudDeveloper |
---|
|