Archived:How to mute/unmute the microphone on S60 3rd Edition devices
Article Metadata
Compatibility
S60 3rd Edition, FP1
Article
Contents |
Overview
How to mute/unmute the microphone on S60 3rd Edition devices
Description
Controlling the microphone mute state is possible with Phone Client Extension API, part of the API extension plug-in package for S60 3rd Edition.
Extensions plug-in package for S60 3rd Edition SDK for Symbian OS, for C++, MR
Extensions plug-in package for S60 3rd Edition SDK for Symbian OS, for C++, supporting FP1
Solution
The below code shows how to load the PhoneClientExt DLL and how to construct and use a command handler (CPhCltCommandHandler) to mute the microphone.
Required capability: WriteDeviceData
/*** Header file ***/
#include <RPhCltServer.h> // link against PhoneClient.lib
#include <PhCltExt.h> // link against PhoneClientExt.lib
...
RPhCltServer iPhoneClientServer;
RLibrary iLibrary;
CPhCltCommandHandler* iPhCommandHandler;
/*** Source file ***/
_LIT(KPhoneCltExDllName, "PhoneClientExt.dll");
User::LeaveIfError( iPhoneClientServer.Connect() );
User::LeaveIfError( iLibrary.Load(KPhoneCltExDllName) );
TInt res = iLibrary.Lookup(1)();
CPhCltExtFactory* phCltExtFactory = reinterpret_cast<CPhCltExtFactory*>( res );
iPhCommandHandler = phCltExtFactory->CPhCltCommandHandlerLD();
User::LeaveIfError( iPhCommandHandler->Open( iPhoneClientServer ) );
// Mute the microphone. This should be done inside an active object
// (a class derived from CActive)
iPhCommandHandler->MuteMicrophone( iStatus, ETrue );
SetActive();
See also
How to mute a ringing tone on S60 3rd Edition devices

