WASAPI:Write to input device's endpoint buffer?

Hi,

To implement a virtual microphone, there is a virtual audio driver and an application,who is responsible for receiving voice data from network and save to local.

The common way is:
Windows recorder <-> Windows high level audio API(WHLA API) <-> virtual audio driver(VAD) <-> virtual microphone

But there is no standard way to hand the audio data received from network to VAD, so I want to complete this by using Core Audio APIs in the following way:

Windows recorder <-> WHLA API <-> EndPoint Buffer <-> virtual audio driver(VAD)
The virtual audio driver still provide a standrad interface to system, but the difference is directly writting audio data to virtual microphone’s endpoint buffer, not to VAD.

Diagram about EndPoint buffer:http://msdn.microsoft.com/en-us/library/windows/desktop/dd316780(v=vs.85).aspx

On MSDN(http://msdn.microsoft.com/en-us/library/windows/desktop/dd316764(v=vs.85).aspx), there is only samples of capture(get) data from input device(microphone), and render(set) data to output device(player), I’m not sure
whether can I write to input device’s endpoint buffer? Pseudo code is following:

while (true) {
CaptureClient->GetBuffer(pBuf); // get microphone’s endpoint buffer
memcpy(pBuf, audioData); // write audio data to gotten buffer
CaptureClient->ReleaseBuffer();
}

Thanks

fanggai318wy@163.com wrote:

To implement a virtual microphone, there is a virtual audio driver and an application,who is responsible for receiving voice data from network and save to local.

You might get a better response by posting this to the [wdmaudiodev]
mailing list. The real audio nuts hang out there.

But there is no standard way to hand the audio data received from network to VAD, so I want to complete this by using Core Audio APIs in the following way:

Windows recorder <-> WHLA API <-> EndPoint Buffer <-> virtual audio driver(VAD)
The virtual audio driver still provide a standrad interface to system, but the difference is directly writting audio data to virtual microphone’s endpoint buffer, not to VAD.

Well, the endpoint buffer in a normal stack is owned and created by the
VAD and shared with the Windows Audio Engine.

On MSDN(http://msdn.microsoft.com/en-us/library/windows/desktop/dd316764(v=vs.85).aspx), there is only samples of capture(get) data from input device(microphone), and render(set) data to output device(player), I’m not sure whether can I write to input device’s endpoint buffer?

That depends on what you mean by “I” here. As I said, the endpoint
buffer is owned by the VAD and shared with the Audio Engine. The Audio
Engine doesn’t expose any direct interfaces to that buffer, but the VAD
can. That, essentially, is what you have implemented now. You have a
custom interface into your VAD that allows a user-mode application to
inject audio.

It’s not clear that you can do any better.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thank you, Tim

I’ll ask for more help on [wdmaudiodev]