[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Recording Volume Control

Posted on 2005-05-09
6
Medium Priority
?
827 Views
Last Modified: 2008-01-09
I downloaded a sample VB6 application from the MSDN website which controls the master and microphone PLAYBACK volume controls. I got it from:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q178/4/56.asp&NoWebContent=1

However, I need to control the RECORDING volume as well. Can anyone tell me what I would have to change to add this functionality to the above sample?

Thanks
0
Comment
Question by:SETP
  • 3
  • 3
6 Comments
 
LVL 13

Accepted Solution

by:
softplus earned 1500 total points
ID: 13957896
Hi SETP,
Use the MIXERLINE_COMPONENTTYPE_SRC_* constants when getting the volume control.
Example:
instead of
' Get the waveout volume control
         ok = GetVolumeControl(hmixer, _
                              MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, _
                              MIXERCONTROL_CONTROLTYPE_VOLUME, _
                              volCtrl)

use
         ok = GetVolumeControl(hmixer, _
                              MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE, _
                              MIXERCONTROL_CONTROLTYPE_VOLUME, _
                              volCtrl)

They defined MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE and MIXERLINE_COMPONENTTYPE_SRC_LINE here, but you can guess at the others: just start at MIXERLINE_COMPONENTTYPE_SRC_FIRST.

Actually looking further into your code example, they do this as well :)) - so it must be ok :))

Does that make sense? :)
John
0
 

Author Comment

by:SETP
ID: 13958092
Hi softplus

Thanks for your reply. However, the code you suggested I use is already in that sample. Only problem is that that code controls the Microphone PLAYBACK volume, and not the RECORDING volume. I saw this code for the recording volume:

Public Const MIXERCONTROL_CT_UNITS_SIGNED = &H20000
Public Const MIXERCONTROL_CT_CLASS_METER = &H10000000
Public Const MIXERCONTROL_CT_SC_METER_POLLED = &H0&
Public Const MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER Or MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_SIGNED)
Public Const MIXERLINE_COMPONENTTYPE_DST_WAVEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
Public Const MIXERCONTROL_CONTROLTYPE_PEAKMETER = (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)

ok = GetVolumeControl(hmixer, _
                              MIXERLINE_COMPONENTTYPE_DST_WAVEIN , _
MIXERCONTROL_CONTROLTYPE_PEAKMETER, _
                              inputVolCtrl)

But many users have complained that this only works in Windows 98 or earlier, and not in 2000 or XP. This appears to be true since it doesn't work on my Win XP. Apparently, it only works with Mixers that have a VUMeter, which Win 98 did but XP and 2000 don't.
0
 
LVL 13

Expert Comment

by:softplus
ID: 13958135
Hmm, that's the gerneral wave-in device, have you tried this:

ok = GetVolumeControl(hmixer, _
                              MIXERLINE_COMPONENTTYPE_DST_WAVEIN , _
                     MIXERCONTROL_CONTROLTYPE_VOLUME, _
                              inputVolCtrl)

?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:SETP
ID: 13958165
Hmm...  that appears to execute without any problems. But it doesn't look like it's doing anything, but maybe I'm not checking properly. When I change the PLAYBACK volumes, I can see an immediate change in the Windows Volume Control mixer. I actually see the sliders move up and down. Now I'm expecting the same to happen whtn changing the RECORDING volume. I'm expecting the sliders in the Recording section of the Windows Volume Control mixer to move up and down. Maybe I should record two sounds and compare the volume instead.

There is an article where a Microsoft guy tries to explain how to control the recording volume, but in my opinion it's very badly written and I can't follow it. Here is the link:

http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraskdr/html/askgui10162001.asp?frame=true
0
 
LVL 13

Expert Comment

by:softplus
ID: 13958292
Ok, I think we're on the right track :)
According to the article, "Next, check if the destination audio line is MIXERLINE_COMPONENTTYPE_DST_WAVEIN. This means that the audio line is a destination that will be the final recording source for the waveform audio input (ADC)." - so this should be available. However it also mentions that soundcards are different :) - so you might want to provide some sort of chooser for your users, i.e. enumerate the mixers (like mentioned in step 4 / 5). Offer a list to the user and allow the user to pick the one he wants to use (and allow him to try others if one doesn't work with his hardware).
John
0
 

Author Comment

by:SETP
ID: 14086971
OK, I'm now using a component from xFX JumpStart which does everyhting for me.

Thanks for your help softplus
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question