Re: MonitorLineIn of sound card

Tech-Archive recommends: Fix windows errors by optimizing your registry



"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



.



Relevant Pages

  • video renderer sample for Windows CE 5.0
    ... Is there something a good sample-code it wants to make video renderer ... of DirectShow with Windows CE 5.0? ... Because Windowsis different the point where API is detailed. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: newbe about API
    ... Emne: Re: newbe about API ... > I found all these API-CALL strings are finally compiled to ... more than that...and Windows simply takes this to an extreme that this ... DLL, when a weak point is found (which, with Microsoft, is something ...
    (alt.lang.asm)
  • Re: In the Shallow End
    ... When a document claims how an API is supposed to be used and then gives the user examples that actually work, ... Vague in your instance means you have no context to VMS or UNIX of that era. ... Windows offers lots of this stuff. ... That's why Apple had to dump a whole paradigm to plunge ahead and take the lead. ...
    (comp.sys.mac.advocacy)
  • Re: a pre-beginners question: what is the pros and cons of .net, compared to ++
    ... as the windows forms architecture wraps a number of activex ... and retains backwards compatibility with both COM and the classic Win32 api. ... C++ cannot inherently do video capture either, since you have to import COM. ... Outlook or Word or IM programs, each of which would run in managed code ...
    (microsoft.public.dotnet.general)
  • Re: Interpreting a BAS module
    ... unicode and ansi strings. ... applications make calls out to Windows to ask it to do something (e.g. ... you have to utilize an API that is designed to ... AddressOf is also used in subclassing. ...
    (microsoft.public.vb.general.discussion)