All Forums
 Microsoft Windows CE
 CE Audio and Multimedia
 Is thaere waveInSetVolume?
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

faredu

0 Posts

Posted - 18 Jan 2007 :  11:10:55  Show Profile
I am writing a program to test audio playing and recording of ADS pruducts. I need setting the volume of speaker and microphone
waveOutSetVolume is working, Is there a API that is like waveInSetVolume?
Thanks very much!!!

jjoseph

47 Posts

Posted - 18 Jan 2007 :  13:22:49  Show Profile
Hi,
waveOutSetVolume is a Windows CE API call. You are right, there does not appear to be a waveInSetVolume, but you might want to investigate this functionality through the Audio Mixer API calls. An MSDN link about the audio mixer can be found here: MSDN Article
But do not expect it to be as simple as waveInSetVolume would be.

You could also try accessing the AC97 Codec directly in a fashion similar to Forum Topic 1245, but if you plan on moving eventually to Windows CE 6.0, direct hardware access may no longer be allowed in user applications.
Go to Top of Page

ctacke

877 Posts

Posted - 18 Jan 2007 :  14:19:39  Show Profile  Email Poster
There is no global or generic API for setting microphone gain. Many devices use codecs that support auto-gain control (AGC) and it would be either ineffective or conflicting to have such an API.

The typical mechanism that an OEM would implement to support something like this would be a few custom messages for the driver. For example lets assume the driver supported a command like SET_MIC_GAIN, then your app would do something like this:


DWORD gainLevel = myDesiredGain;
hWave = waveInOpen(...);
waveInMessage(hWave, SET_MIC_GAIN, gainLevel, 0);

A typical architecture for codecs that support AGC would be to turn on AGC if the level passed in is set to -1, otherwise set it to the specified level.

Of course this does not mean that the ADS audio driver supports this mechanism, it's simply an example of how it might be implemented to be friendly for typical application developers.
Go to Top of Page

faredu

0 Posts

Posted - 23 Jan 2007 :  00:58:54  Show Profile
jjoseph:
I have try mixer API, it work on WinXP but not WinCE, the return value of mixerGetNumDevs on WinCE always is zero
ctacke:
SET_MIC_GAIN can not be found any where, would you please tell me a URL or something else?
Thanks!
Go to Top of Page

faredu

0 Posts

Posted - 23 Jan 2007 :  01:00:19  Show Profile
jjoseph:
I have try mixer API, it work on WinXP but not WinCE, the return value of mixerGetNumDevs on WinCE always is zero
ctacke:
SET_MIC_GAIN can not be found any where, would you please tell me a URL or something else?
Thanks!
Go to Top of Page

ctacke

877 Posts

Posted - 23 Jan 2007 :  08:37:52  Show Profile  Email Poster
Correct, it cannot be found because, as I said in my original post, it is an "example of how it might be implemented." There is no inherent mechanism to set this in CE and it's up to the OEM to provide such capability depending on the audio hardware present on the board.
Go to Top of Page

faredu

0 Posts

Posted - 24 Jan 2007 :  10:02:12  Show Profile
There is a "software way" to change the gain level: get the captured data, multiply each byte by a factor. it's hardware-independent
Hope this is not bad for development of applications
Thanks!
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000