Re: Getting output voltage for a sound card
- From: NoSpam@xxxxxxxxxxx (Bob Masta)
- Date: Thu, 12 Oct 2006 12:22:48 GMT
On Wed, 11 Oct 2006 22:50:01 -0700, =?Utf-8?B?TWFub2o=?=
<Manoj@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I have an application where I should make sure that output voltage of a sound
card is not above specified level.
I have observed that different cards have different output voltage, multi
channel cards have even higher output voltage when compared to conventional
stereo cards.
I wanted to know if there's a method or API to find the voltage at the
speaker out of a sound card.
Sorry, not possible. In fact, it's not even possible to find the
percentage or dB change versus mixer control. As you note,
every card is different. You will need to calibrate the mixer
(Master and Wave Out) or else always force it to max. To
calibrate, create a full-scale (+/-32767 binary) sine wave
that you can play continuously while you monitor the
output voltage versus mixer position. I recommend
you not try to use the sliders for control, but write directly
to the mixer API. But if you haven't already gotten sucked
into the black hole of mixer programming, then you can use
the sliders to get some basic calibration. Just note that
the slider resolution often *appears* to be a lot finer than
the true attenuator steps, so a tiny slider change may suddenly
make the output jump (because there are dummy steps on
the slider that do nothing).
You will need a good AC voltmeter to measure the output
voltage. The vast majority of inexpensive meters don't
have sensitive AC voltage ranges... 200.0 full-scale is
typical, but you will be trying to read something closer to
2 volts from line out. Another possibility would be
to use an oscilloscope, if you have access to one.
Note that meters are calibrated to read RMS volts
with a sine wave input, whereas the scope will of course
read peak-to-peak. (RMS = 0.7071 times 0-to-peak.)
If you use a meter, be sure to observe its frequency
limits. 50-60 Hz is always OK, and you can probably go up to
about 1000 Hz even on cheap meters before the
response starts to fall off.
If you have an external amp, you also need to account for the position
of its volume controls. Voltages can be much higher, of course;
plan on 10s of volts RMS.
After you know what voltage you get from a full-scale output
at any given mixer setting, you can scale that voltage proportional
to the full-scale binary range to find any other output voltage.
That all assumes we are talking about sine waves, or some other
continuous wave whose levels can be related to the sine measurements.
It's best to work in peak values, since they correlate with binary.
If you are dealing with arbitrary speech or music levels, you will
have to limit them based on their peak values.
Note that if you limit a signal by scaling its binary values, you
also reduce its effective bits and hence increase its distortion
level. For every 50% reduction (6 dB) you lose one bit, so
reducing a 16-bit signal by 48 dB gives you the performance
of an 8-bit sound card.
Hope this helps!
Bob Masta
dqatechATdaqartaDOTcom
D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Home of DaqGen, the FREEWARE signal generator
.
- Follow-Ups:
- Re: Getting output voltage for a sound card
- From: Chris P. [MVP]
- Re: Getting output voltage for a sound card
- Prev by Date: RE: possible to read EXIF with WIA before full transfer?
- Next by Date: Re: Getting output voltage for a sound card
- Previous by thread: Callback - I need a little explaination...
- Next by thread: Re: Getting output voltage for a sound card
- Index(es):
Relevant Pages
|