gpt4 book ai didi

.net - 将音频传输到特定设备

转载 作者:行者123 更新时间:2023-12-03 02:31:26 28 4
gpt4 key购买 nike

我正在开发一个基于WPF的应用程序,它也使用DirectShow。我需要实现一项功能,其中必须在所选设备之一上传输视频音频。为了阐明我的问题,假设我们有许多连接到系统的音频设备,因此必须允许用户在他/她选择的设备上播放视频文件中的音频。另外,如何通过连接到系统的音频设备进行枚举?我不知道如何将音频传输到不同的设备?我是DirectShow开发的新手,请帮助我解决这个问题。欢迎任何想法建议。

谢谢。

最佳答案

MSDN:

To enumerate the audio devices available on the user's system, use the ICreateDevEnum interface with the audio renderer category (CLSID_AudioRendererCategory). For each audio device, the audio renderer category contains two filter instances. One of these corresponds to the DirectSound Renderer, and the other corresponds to the Audio Renderer (WaveOut) filter. The DirectSound instance has the friendly name "DirectSound: DeviceName," where DeviceName is the name of the device. The WaveOut instance has the friendly name DeviceName.

The audio renderer category contains two additional filter instances, named "Default DirectSound Device" and "Default WaveOut Device." These correspond to the default sound device, as chosen by the user through the Control Panel. They are actually mappings to one of the pairs described in the previous paragraph. For example, if the system has two audio devices, Device A and Device B, the audio renderer category will contain the following:



在.NET中,您可以通过[应该] DirectShow.NET库对该API进行包装。

关于.net - 将音频传输到特定设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10831711/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com