选择录制声音的音频源 [英] Selecting an audio source for recording sounds

查看:118
本文介绍了选择录制声音的音频源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用"winmm.dll"别名"mciSendStringA"带有打开新类型waveaudio别名捕获"的功能;命令以记录来自麦克风的声音.但是有时候,声音不是来自麦克风,而是来自麦克风 音频板输出.

I'm using "winmm.dll" Alias "mciSendStringA" with the "open new type waveaudio alias capture" command to record a sound from the microphone. But it happends sometimes the sound does not come from the microphone but from the audio board output.

当我以前在ROXIO声音编辑软件中选择音频板输出作为声源时,就会发生这种情况.

This happends when I have previousely selected the audio board output as the sound source in a ROXIO sound edition software.

有人知道如何切换回麦克风作为我软件的声源吗?

Does some body knows how to switch back to the microphone as the sound source into my software ?

在此先感谢您.

推荐答案

 这并不像看起来那样简单.我相信可以使用 核心音频API 但是,这将比仅仅几行代码复杂得多.

 This is not as simple of a task as it would seem.  I believe it might be able to be done using the Core Audio APIs but,  it would be a lot more complex than just a few lines of code.

 您可以切换到使用第三方库,例如 NAudio ,可以用来录制和播放音频.它提供了一种枚举输入设备并选择要从中进行录音的麦克风或其他输入设备的方法.

 You could switch to using a 3rd party library like NAudio which you can record and play audio with.  It has a method to enumerate the input devices and select the microphone or other input device to record from.

还可以选择打开系统的声音"界面.对话视窗,一个可以让您选择要使用的设备的工具.您可以在启动应用程序时执行此操作,也可以从表单上的按钮执行此操作,以便用户可以选择 麦克风或要使用的输入设备.这样可以完成...

 There is also the option of opening the system's "Sound" dialog window,  the one that lets you select the device you want to use.  You could do that when your app is started or from a button on your form so the user can select the mic or input device to use.  That can be done like this...

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        'The last number in the command can be set to 1 to open the window to the Recording Devices Tab
        Shell("control mmsys.cpl,,1") '0=Playback, 1=Recording, 2=Sounds, 3=Communications
    End Sub


这篇关于选择录制声音的音频源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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