The only way to do this is using p/invoke and the multimedia library. Take a
look at the waveIn<xxxxxx> functions.
Search for WimMM in MSDN. or Multimedia SDK.
Hey Bob! MS just added some managed code support to the Oct DirectX SDK.
I've been waiting for them to get up to speed on managed code, and sure
enough, there's some examples in C#, including DirectSound. Long overdue.
I've tried using the WinMM library before, with mixed results. I'm hoping
that the .NET runtime speeds up a bit. Though I haven't traced the
problems I've experienced, they pretty much have to be coming from the
transition between unmanaged DLLs and managed code. I'm not sure what
..NET is doing there, or how to find out.
I was trying an approach closer to 'IJW' via layered C++ unmanaged/managed
DLLs (the latter accessed by the C# app). Maybe the p/Invoke/attribute
approach is faster, but I had a lot of various data types to transport, so
I tried to isolate them on the C++ side. Seemed slow. You wouldn't think
P/Invoke could be much faster than the IJW approach but maybe so.