从特定音频光束重建WAV音频 [英] Reconstructing WAV audio from specific audio beams

查看:87
本文介绍了从特定音频光束重建WAV音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当简单的用例:

I have a fairly simple use case:

一个人站在kinect前面说些什么。

A person is standing in front of the kinect and says something.

Kinect 2 API产生相应的音频光束。

The Kinect 2 API produces a corresponding audio beam.

我想从这个光束中捕获音频样本。

I want to capture the audio samples from this beam.

我看到的问题是每帧的相对时间戳不一致;也就是说,它们并不是完全相差16毫秒,有时它们会跳过5毫秒到50毫秒。因此,我不能简单地将传入的样本附加到以前
的传入样本中,因为我将改变时间和时间。捕获的波形的相位(我试过这个,听起来很糟糕)。

The problem I am seeing is that the relativetime timestamps for each frame are not consistent; that is, they are not exactly 16ms apart, and sometimes they will skip over anywhere from 5ms to 50ms. Therefore, I cannot simply append incoming samples to previously incoming samples, as I will be altering the timing & phase of the waveforms captured (I have tried this, and it sounds awful).

不幸的是,SDK附带的样本没有帮助,因为audiobeam样本实际上没有捕获音频并将其写入WAV文件,录制样本(将样本写入WAV文件)不使用音频光束API。

Unfortunately, the samples that come with the SDK don't help, because the audiobeam sample don't actually capture the audio and write it to a WAV file, and the recording sample (which DOES write the samples to a WAV file) does not use the audio beam API.

似乎我必须将传入的子帧样本复制到特定索引(基于其父级audiobeamframe的时间戳)到中间缓冲区。 是否有另一种更好的方法来捕获和重建audiobeam样本?

It seems that I have to copy the incoming subframe samples to a particular index (based on the timestamp of their parent audiobeamframe) into an intermediate buffer. Is there another, better way to capture and reconstruct audiobeam samples?

推荐答案

非托管c ++示例中的AudioCapture-Console(Raw)是您要查看的示例。 WASAPI是核心Windows音频API,可以从麦克风阵列进行低级音频捕获。请记住,这是c ++,由于这个时间要求,没有受支持的管理
库用于核心Windows Media api,如DirectShow,Media Foundation或WASAPI。

AudioCapture-Console (Raw) in the unmanaged c++ samples is the sample you want to look at. WASAPI is the core Windows audio api that can do low level audio capture from the mic-array. Keep in mind, this is c++ there are no supported managed libraries for core Windows Media api's like DirectShow, Media Foundation or WASAPI because of this timing requirement.

任何低延迟/"实时"捕获支持,您还需要使用多媒体类调度程序来确保捕获线程以更高的优先级运行。

For any low latency/"realtime" capture support, you also need to use the Multimedia Class Scheduler to ensure the capture thread is running at a higher priority.


这篇关于从特定音频光束重建WAV音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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