- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个 DSP 软件,可以在共享环回模式下使用 WASAPI api 捕获播放的音频。
hr = _pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_LOOPBACK, 0, 0, _pFormat, 0);
这部分工作正常,但现在我希望能够检测实际播放的 channel 数。换句话说,我如何能够检测音频播放是立体声、5.1、7.1?
问题是:
* 由于环回必须使用共享模式,因此可以播放多个源。
* 此分析必须实时进行。等不及播放完毕了。
* 检测任何播放源根本不使用的 channel 和暂时静音的 channel 之间的区别
在我看来,最好的解决方案是,如果我可以检索所有播放源/子混音的列表,并分别查询它们的 channel 数量。这样我就不必分析音频数据流本身。
最佳答案
环回录音以端点上定义的混合格式进行,因此无论原始音频格式是什么,您都可以获得混合格式的数据,从可能的多个播放源混合并转换为此类共享格式。
WASAPI loopback contains the mix of all audio being played...
The
GetMixFormat
method retrieves the stream format that the audio engine uses for its internal processing of shared-mode streams...After an application has used GetMixFormat or IsFormatSupported to find an appropriate format for a shared-mode or exclusive-mode stream, the application can call the Initialize method to initialize a stream with that format. An application that attempts to initialize a shared-mode stream with a format that is not identical to the mix format obtained from the GetMixFormat method, but that has the same number of channels and the same sample rate as the mix format, is likely to succeed. Before calling Initialize, the application can call IsFormatSupported to verify that Initialize will accept the format.
也就是说,尽管 WASAPI 在音频格式方面提供了一定的灵 active ,但在环回捕获时 channel 配置和采样率由共享格式定义。
在进行混音时,您无法真正识别“非事件” channel :此信息在混音为共享格式的过程中会丢失。
此外,实际的共享格式可以通过控制面板交互配置:
关于c++ - WASAPI:识别环回记录中的非事件 channel ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48335752/
我在 wp8 中使用 WASAPI。每次返回不同大小的缓冲区时,我都在共享模式下使用 Getbuffer 方法。我在 8000Hz/16bit 中捕获,有时是 Getbuffer 返回包含 80 个样
我正在为需要能够在各种设备上录制和播放的程序开发音频代码,其中一些是高端设备,具有各种不同的 wav 和 AIFF 格式。我希望能够使用 WASAPI 库,但我遇到了一些主要问题。目前最大的问题是,据
我正在尝试使用 WASAPI 通过输出设备打开独占流。我在选择可接受的格式时遇到问题,因为似乎没有关于给定设备接受哪些格式的提示。 在我的例子中,IAudioClient::GetMixFormat(
如何使用 WASAPI(或类似的东西)将音频连续采样到(线程安全)环形缓冲区中,以便消费者线程可以在设定的时间间隔内从该缓冲区读取? 目前我们有一个.sample()在设定的采样间隔后返回大量样本的方
按照排他模式流中的示例,我使用Windows核心音频功能(主要是WASAPI)来呈现排他流。 这将创建两个交替播放并交替填充的缓冲区。有一个与缓冲区完成有关的事件会唤醒线程,以便它可以重新填充刚刚完成
我们有一个使用 waveXXX() 的应用程序和 mixerXXX()处理与某些乐器之间的音频 I/O 的功能(想想:示波器或电子设备而不是乐器,这并不重要)。终于到了停止在 Windows XP 上
我想分析我的默认播放设备并检测节拍。我一直在使用 BASS WASAPI 来获取所选设备的 FFT 数据: int ret = BassWasapi.BASS_WASAPI_GetData(_fft,
我正在阅读文档,例如 Capturing a stream或 Loopback recording ,但我找不到关于如何使用 Windows WASAPI 从 Loopback 音频设备(有时称为“您
我目前正在阅读MSDN的文档,以将流渲染到音频渲染器。 换句话说,就是从麦克风播放我捕获的数据。 http://msdn.microsoft.com/en-us/library/dd316756%28
我用 wasapi用于环回捕获。之后的所有数据都保存到wav文件。 当它开始捕获时,它一直在传递数据,直到我停止捕获过程,即使没有应用程序使用音频设备,因此没有人产生音乐。结果,我写入文件不是有值(v
我正在尝试使用 Windows 核心音频 API 从麦克风捕获音频 相关的代码行是 const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEn
我正在使用 NAudio 并尝试使用 WasapiLoopbackCapture 记录在我的电脑上播放的内容。我遇到的问题是我需要将记录的数据作为 PCM 16 位 44100khz 单声道。为此,我
我正在尝试编写一个与 Windows Core Audio 和 WASAPI 接口(interface)的程序。我在使用以下几行时遇到困难。 CComHeapPtr name; hr = pAudio
我有一个 DSP 软件,可以在共享环回模式下使用 WASAPI api 捕获播放的音频。 hr = _pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED
当我在其中一个扬声器上打开独占模式音频流时,会发出奇怪的嗡嗡声。这种嗡嗡声不会在我的其他设备上的相同条件下发生,也不会在一般的独占推送模式或共享模式下发生。 问题似乎是 WASAPI 将周期设置为比我
是否有可能排除音频数据被 IAudioClient 环回模式(AUDCLNT_STREAMFLAGS_LOOPBACK)捕获,或者呈现一个不包含在环回捕获的音频数据。 独占模式 (AUDCLNT_SH
我尝试在独占模式下使用 Windows Audio Session API (WASAPI) 播放简单的正弦波形,但无论我做什么,都会遇到声音故障。我一直在使用 MSDN Exclusive-Mode
我第一次尝试使用 AudioClient 界面,但运气不好。到目前为止,我设法使用成功的 MMDeviceEnumerator 和 MMDevice 接口(interface)获得了默认的 Audio
我正在启动一个最低要求为 Windows 7 的项目。我将使用 NAudio 作为我的音频接口(interface)。我不确定我应该使用什么:DirectSound 还是 WASAPI?我将执行以下操
sample code of WASAPI capture on MSDN , 循环直到 GetNextPacketSize 返回 0。 我只是想了解什么时候会发生这种情况: 如果麦克风上注册了静音,
我是一名优秀的程序员,十分优秀!