问题
In the last few days I was trying to write small program to monitor the audio line-in using win-api (winmm.dll). I can pinvoke api functions such as waveInOpen but I can't figure out how to use these functions to achieve my target.
the question is - can someone can briefly tell me how can I get the data from the audio line in using these API (C#).
回答1:
Well I finally found what I was looking for here.
http://www.codeguru.com/forum/archive/index.php/t-264694.html
Although this is a C code example, it is depicting the simple outline of using the windows audio api to read data from the sound-card line-in/microphone device.
I am now working on recodeing this C code to C#. if successful I will post it here.
回答2:
You don't have to!!!
Look this:
Measure speaker volume by recording playing sound with microphone
Join forces with the guy :)
来源:https://stackoverflow.com/questions/3931757/using-p-invoke-and-win-api-to-monitor-audio-line-in-c