Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
This page was last modified 13:18, 9 October 2008.

CS001137 - Routing a voice call between the earpiece and the loudspeaker

From Forum Nokia Wiki



ID CS001137 Creation date October 9, 2008
Platform S60 3rd Edition Tested on devices Nokia E90 Communicator
Category Symbian C++ Subcategory Telephony


Keywords (APIs, classes, methods, functions): KTelephonyAudioOutput, KTelephonyAudioOutputPreference


Note!
This API is not part of the public SDK. It can be found in the SDK API Plug-in.


Overview

The CR Keys To Control Phone Volume API included in the SDK API Plug-in package also includes keys for routing the voice call between the earpiece and the loudspeaker.

This snippet requires the following capabilities:

  • ReadUserData
  • WriteUserData
  • ReadDeviceData
  • WriteDeviceData

Because of the capability requirements, self-signing is not possible. A Developer Certificate is needed.

MMP file

The following capabilities and libraries are required:

CAPABILITY ReadUserData WriteUserData ReadDeviceData WriteDeviceData

LIBRARY centralrepository.lib

Source file

The required headers files are:

  1. include <telephonyinternalcrkeys_partner.h> //from SDK API Plug-in
  2. include <centralrepository.h> //CRepository

A simple way to switch the voice call routing between the earpiece and the loudspeaker is shown in the code snippet below. The routing mode is changed by reading the value of the Central Repository key and rewriting the opposite value.

TInt mode(-1);
 TInt errNo =
   RProperty::Get(KTelephonyAudioOutput,
                  KTelephonyAudioOutputPreference,
                  mode);
 
 switch(mode)
   {
   case EPSPrivate: 	 
     RProperty::Set(KTelephonyAudioOutput,
                    KTelephonyAudioOutputPreference,
                    EPSPublic);
 	break;
   
   case EPSPublic:
     RProperty::Set(KTelephonyAudioOutput,
                    KTelephonyAudioOutputPreference,
                    EPSPrivate);
 	break;
   default:
 	break;
   }


Example application

Image:Ear Lound switch speakers.zip

Related Discussions
Thread Thread Starter Forum Replies Last Post
Getting speaker voice Digish General Symbian C++ 1 2007-10-18 11:57
VoIP : Call Forwarding amjedab VoIP 4 2008-09-20 02:17
Nokia 6280 problem :( Andyvalver General Discussion 1 2006-07-04 02:58
Keypress during call nusntu Symbian Networking & Messaging 1 2006-07-22 09:08
Hoe to play audio through Handset speaker - (not through the loudspeaker) brian.egan Symbian Media (Graphics & Sounds) 5 2008-09-17 16:36
 
Powered by MediaWiki
RDF Facets: qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX