Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DirectShow filter microphone low-latency

8 views
Skip to first unread message

inside...@gmail.com

unread,
Sep 10, 2007, 5:01:53 PM9/10/07
to
I'm modifying a pair of working DirectShow networking filters that use
UDP for low-latency video. What I need to do is add audio, so I'm
adding an Audio input pin (I will multiplex audio and video over the
same UDP port). For now I'm testing with a Logitech USB but want it to
work with any audio source filter (especially microphones).

The problem is I can't get the microphone to send me several packets
per second (the most apparently is 2). I need 20-30 per second or else
I can't achieve low latency. I don't know if this is a limitation in
Logitech but I doubt it. Initially I'm just using PCM audio, I will
add a codec later.

The audio pin on my NetSend filter has a GetMediaType that looks like
this (below). In this case, I believe I am getting 2 x 32000 byte
packets per second from the logitech. I thought because of the
SetSampleSize I would get 20 per second. Any ideas would be much
appreciated.

pmt->SetType(&MEDIATYPE_Audio);
pmt->SetSampleSize(3200); // should produce 20 packets per
second
pmt->SetFormatType(&FORMAT_WaveFormatEx);
WAVEFORMATEX* pAud = (WAVEFORMATEX*)pmt->
AllocFormatBuffer(sizeof(WAVEFORMATEX));
if(pmt->SetFormat((BYTE*)pAud , sizeof(WAVEFORMATEX)))
{
pAud->wFormatTag = WAVE_FORMAT_PCM;
pAud->nChannels = 1;
pAud->nSamplesPerSec = 32000;
pAud->nBlockAlign = 2;
pAud->nAvgBytesPerSec =
pAud->nSamplesPerSec * pAud->nBlockAlign;

pAud->wBitsPerSample = 16;
pAud->cbSize = 0;
}

pmt->SetTemporalCompression(FALSE);
pmt->SetFormat((BYTE *)pAud, sizeof(WAVEFORMATEX));
pmt->SetSubtype(&MEDIASUBTYPE_PCM);

-George

0 new messages