发出计算机中安装的外部声卡的声音 [英] out sound of an external sound card installed in the computer

查看:90
本文介绍了发出计算机中安装的外部声卡的声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我具有允许流播放的功能:当我对计算机的麦克风讲话时,声音直接来自计算机的声卡.但是我对此代码有疑问,不允许我在声卡外部发出声音.我在计算机上安装了3个声卡,我希望他发出特定卡的声音.
是否有人可以帮助我.预先感谢您的支持.

这是我在此站点上使用的开始"功能:

Hello,
I have a function that allows out a stream: When I speak into the microphone of the computer the sound comes directly from the computer''s sound card. But I have a problem with this code does not allow me out the sound in a sound card externe.I have 3 soundcards installed on my computer and I want out he sound of a specific card.
Is someone can help me please. Thank you in advance for your support.

Here is the function ''Start'' that I took of this site:

private void Start()
        {
            Stop();
            try
            {
                PaGa.WaveFormatt fmt = new PaGa.WaveFormatt(44100, 16, 2);
                m_Player = new PaGa.WaveOutPlayer(-1, fmt, 16384, 3, new PaGa.BufferFillEventHandler(Filler));
                m_Recorder = new PaGa.WaveInRecorder(-1, fmt, 16384, 3, new PaGa.BufferDoneEventHandler(DataArrived));
            }
            catch
            {
                Stop();
                throw;
            }
        }

推荐答案

Using DirectShow''s Graph Builder[^] you can set and render you output device and test your path


它不能解决您的问题;只是一个重要的注意事项:

这在功能上是正确的,但毫无意义:
It does not solve your problem; just an important side note:

This is functionally correct but pointless:
try {
/...
} catch { //there are no cases when you should catch all and not use an instance of Exception
    Stop();
    throw;
}



正确的模式是这样的:



Correct pattern is this:

try {
/...
} finally { //finally is specially designed for such cases
    Stop();
}



—SA



—SA


这篇关于发出计算机中安装的外部声卡的声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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