The information in this article applies to:
SUMMARYMmmctrl.exe is a self-extracting compressed file that contains a Visual Basic project demonstrating how to detect and use multiple MCI devices in a system. The techniques shown and the Windows API functions used in this sample project allow your program to have multiple sound card support so you can enable one sound card for recording sounds and another sound card for playing sounds. MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center. Click the file names below to download the files: Mmmctrl.exeFor more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. When you run the self-extracting executable file, the following files are expanded to the Multiple Multimedia Control Sample project directory:
How to Use the Sample ProjectWhen you run the project from the Visual Basic IDE, the Multiple Multimedia Control Sample form displays. The form is divided into a Play section and a Record section.The Play section has a Wave Output Devices list box that shows all the wave output devices available for playing wave files. Select one of the output devices in the list box. Open File shows a dialog box so you can select a wave file to play. The file name and path are displayed in the text box. When you select a wave file, the appropriate multimedia control buttons are enabled. If you select a file without selecting a wave device, the following error message displays: The specified parameter is out of range for the specified command. To prevent displaying this error message, select a wave device before opening a file. The Record section also has a listbox that displays all wave input devices. Select one of the input devices in the list box. Open enables the selected wave input device for recording and enables the appropriate multimedia control buttons. If you check the Use Control Panel Recording Format check box, the wave input device will record in the format, sample rate, and number of channels set in the Multimedia Properties dialog box of Control Panel. If the Use Control Panel Recording Format check box is cleared, then the wave input device will record at the default MCI setting of 8-bit mono using a 11kHz sampling rate. Save opens a dialog box so that you can save the wave file you just recorded. How the Sample WorksIn the Form Load event, the number wave input and output devices are retrieved using the waveOutGetNumDevsA function for output devices and waveInGetNumDevCapsA function for input devices. The type and capabilities of each device are retrieved using the waveOutGetDevCaps for output devices and waveInGetDevCaps for input devices. The capabilities are stored in a user-defined variable. The name of each device is added to the appropriate list box.When you open a file to record or for playback, you also enable the appropriate multimedia control for this task. Depending on the multimedia control command you select, the event executes the appropriate mciSendCommandA function. If the Use Control Panel Recording Format check box is checked, the a user- defined function retrieves the Control Panel settings in the registry by first using the RegOpenKeyExA function to open the WaveFormats registry key. The RegQueryValueStringA and the RegQueryValueExA functions are used to retrieve the registry key values. The RegCloseKey is used to close the registry key. REFERENCES
For more information about sound cards or using the multimedia API
functions, please see the following topics:
Q147811 : HOWTO: Detect If Computer Has Sound Card That Plays Wave Audio Additional query words: kbwin32sdk kbapi kbVBp kbdsd kbDSupport kbVBp500 kbVBp600
Keywords : kbfile kbGrpVB |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |