Namespaces
Variants
Actions

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

Jump to: navigation, search
Article Metadata

Code Example
Tested 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.png
Note: :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.
96 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved