Re: MonitorLineIn of sound card
- From: "Mitch Gallant" <jensigner@xxxxxxxxxxxxxxxx>
- Date: Wed, 21 Jan 2009 08:40:26 -0400
"Alessandro Angeli" <nobody@xxxxxxxxxxxxxxxxxx> wrote in message
news:eKMe6VweJHA.5428@xxxxxxxxxxxxxxxxxxxxxxx
From: "Mitch Gallant"
[...]
For this application I'd rather use a lower-level
approach and would prefer to NOT use DirectX.
What you do with the data is of no interest to Windows. Only how to get
the data is and Windows provides several APIs to receive the input audio
stream:
- waveIn
- DirectSound
- DirectShow (higher-level wrapper above waveIn and DirectSound or native
DirectShow drivers)
- kernel streaming drivers
The mixer API is only needed to select a specific input line on a device
that has more than one (like a SB).
There are also third-party APIs like ASIO.
You need to open the input line and receive the data all the time, then
either analyze or discard it.
Thanks for this information. I quickly tried the approach using the mixerXXX
api as described in the previously referenced MS KB181550 but it failed at
mixerGetLineControls(..) for
mxlc.dwControlType = MIXERCONTROL_CONTROLTYPE_PEAKMETER;
Judging by the number of references to this problem I decided to drop that
approach and use the waveIn api.
I modified the code sample from Petzold's "Programming Windows 5th Edn."
1999 sample RECORD1.C "A Digital Sound Recorder" and put a text display
area in the DialogBox to display the current sampled value and peak abs
value read. I modified the sample to use stereo and 16 bit sampling which is
a fairly trivial change in the WAVEFORMATEX structure. This works quite
well, but for some reason the CPU usage creeps up with time.
- Mitch
.
- Follow-Ups:
- Re: MonitorLineIn of sound card
- From: Bob Masta
- Re: MonitorLineIn of sound card
- References:
- MonitorLineIn of sound card
- From: Mitch Gallant
- Re: MonitorLineIn of sound card
- From: Alessandro Angeli
- MonitorLineIn of sound card
- Prev by Date: earphone jack detect
- Next by Date: Re: MonitorLineIn of sound card
- Previous by thread: Re: MonitorLineIn of sound card
- Next by thread: Re: MonitorLineIn of sound card
- Index(es):
Relevant Pages
|