如何指定与mciSendString API一起使用的声卡 [英] How to specify a sound card for use with mciSendString API

查看:53
本文介绍了如何指定与mciSendString API一起使用的声卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在更新旧的VB6应用程序.回想过去,我在mciSendString命令周围编码了一个包装器,以便能够记录和播放音频.那时,计算机通常只有一个声卡.

I am updating an old VB6 app. Back in the day, I coded a wrapper around the mciSendString command to be able to record and playback audio. Back then, computers typically had a single audio card.

现在,许多客户拥有多个声卡(通常是一个内置声卡和一个USB耳机).

Now, many of the customers have multiple sound cards (typically a built in one and a USB headset).

我似乎找不到用于指定要与mciSendString一起使用的声卡的API.有人可以指出我正确的方向吗?

I can't seem to find the API to specify which sound card to use with mciSendString. Can someone point me in the right direction?

推荐答案

Microsoft提供了 answer .

Microsoft has provided the answer.

要设置多媒体控件使用的WaveAudio设备(声卡),必须使用mciSendCommand API.多媒体控件没有直接提供一种方法来让您设置用于播放或录制的设备.

To set the WaveAudio device (soundcard) used by the Multimedia Control, you must use the mciSendCommand API. The Multimedia Control does not directly provide a method to let you set the device used for playing or recording.

Dim parms As MCI_WAVE_SET_PARMS
Dim rc As Long

' Specify the soundcard. This specifies the soundcard with a deviceID
' of 0. If you have a single soundcard, then this will open it. If you
' have multiple soundcards, the deviceIDs will be 0, 1, 2, etc.
parms.wOutput = 0

' Send the MCI command to set the output device.
rc = mciSendCommand(MMControl1.DeviceID, MCI_SET, MCI_WAVE_OUTPUT, parms)

这篇关于如何指定与mciSendString API一起使用的声卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆