Hi Tim,
over the TCP connection I am receiving encoded mic output from source application ,at target app i am decoding the audio data , now
I have decoded audio data(using AAC) in my target application, that I want to redirect to virtual audio mic(earlier i was playing it using SDL player). do I need to store that decoded data again in ring buffer within the driver code??,
I can transfer that decode data to driver using IOCTL, but there I will receive inside driver.cpp custom IOCTL handler, from custom IOCTL handler how can I transfer the data to MiniportWaveRTStream::WriteBytes and copy it to m_pDmaBuffer. plz help with some sample code snippet.
VOID MiniportWaveRTStream::WriteBytes
(
In ULONG ByteDisplacement
)
/*++
Routine Description:
This function writes the audio buffer using a sine wave generator
Arguments:
ByteDisplacement - # of bytes to process.
–*/
{
ULONG bufferOffset = m_ullLinearPosition % m_ulDmaBufferSize;
//// Normally this will loop no more than once for a single wrap, but if
//// many bytes have been displaced then this may loops many times.
while (ByteDisplacement > 0)
{
ULONG runWrite = min(ByteDisplacement, m_ulDmaBufferSize - bufferOffset);
SIZE_T actuallyWritten;
m_RingBuffer->Take(m_pDmaBuffer + bufferOffset, runWrite, &actuallyWritten);
if (actuallyWritten < runWrite)
{
RtlZeroMemory(m_pDmaBuffer + bufferOffset + actuallyWritten, runWrite - actuallyWritten);
}
bufferOffset = (bufferOffset + runWrite) % m_ulDmaBufferSize;
ByteDisplacement -= runWrite;
}
}
if i have to feed my audio buffer to m_pDmaBuffer , do i need to write that much code inside WriteBytes(mentioned above), except
memcpy(m_pDmaBuffer ,my audio buffer received USING IOCTL, length)???
plz need your help.