C++ / W32 - Recording sound, Direct Show or WaveInOpen?
what to choose when thinking of WinXP, Vista, Win7 ++ :
Record audio with Direct Show / Direct ... ?
Go with classic WaveInOpen ( i've seen somewhere somebody saying that this is going to be oudated in W7/W8 - possible ? )
Ps. I need a callbac开发者_StackOverflow中文版k functionality, to pass the buffer to the encoder.
Thanks!
WaveIn is easy to use, there is plenty of example code on the net, and it gives you a callback in the way you need it.
DirectSound uses a circular buffer and can be a little cumbersome to set up, and most likely you'll need to take care of the circular buffer rather than "just filling a buffer". DirectSound, however, can give you tighter control of the audio, namely a bit better latency.
IMO, it's very unlikely that Microsoft will ever deprecate/remove the Wave API. They'd break thousands of applications. I actually don't think that MS has ever removed a core API from Windows.
So I'd go for the Wave API for simplicity.
精彩评论