This page was last modified 09:13, 24 August 2007.
TSS000029 - Implementing the camera snap sound in a S60 device
From Forum Nokia Wiki
Subject:
| Implementing the camera snap sound in a S60 device
| TSS000029
|
| Platform(s):
| Device(s), SW version(s):
|
S60 1st Edition S60 2nd Edition
| N/A
|
Category:
| Symbian C++
|
Subcategory:
| Multimedia
|
Description:
| The most effective way to play the snap sound is to use the CAknKeySoundSystem class. The following code example explains how to implement the feature in your own application: // myapp.h #include <aknsoundsystem.h> const TInt KSnapSoundId = 2; class MyClass { ... private: CAknKeySoundSystem* iCameraSound; }; void MyClass::ConstructL() { ... iCameraSound = static_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi())->KeySounds(); if (iCameraSound) { TRAPD(error, iCameraSound->AddAppSoundInfoListL( R_CAMERA_SNAP_SOUND)); if ((error != KErrAlreadyExists) && (error != KErrNone)) { User::LeaveIfError(error); } } } void MyClass::PlaySnapSound() { iCameraSound->PlaySound(KSnapSoundId); } Also add the following code into your application’s resource .rss #define KcameraSoundFile "Z:\\system\\sounds\\digital\\Camera1a_2_8kHz.wav" #define KSnapSoundId 2 RESOURCE AVKON_SOUND_INFO_LIST r_camera_snap_sound { list = { AVKON_SOUND_INFO { sid = KSnapSoundId; priority = 45; preference = EAknAudioPrefCamera; // defined in avkon.hrh file = KCameraSoundFile; } }; }
|
Creation date:
| October 29, 2003
|
Last modified:
| -
|