×
Namespaces

Variants
Actions

Routing a voice call between the earpiece and the loudspeaker on Symbian

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code ExampleTested with
Devices(s): Nokia E90 Communicator
Compatibility
Platform(s): S60 3rd Edition
Article
Keywords: KTelephonyAudioOutput, KTelephonyAudioOutputPreference
Created: User:Technical writer 1 (09 Oct 2008)
Last edited: hamishwillee (04 Jul 2012)


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

Contents

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

File:Ear Lound switch speakers.zip

This page was last modified on 4 July 2012, at 04:59.
59 page views in the last 30 days.
×