Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

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:

-
Related Discussions
Thread Thread Starter Forum Replies Last Post
S60 3rd Edition Emulator CCamera camera class problem william_j Symbian Tools & SDKs 3 2006-11-01 14:15
Deployment rexwal SNAP Mobile 1 2006-04-25 00:22
Observation Camera I/F details kallej_jamtland General Discussion 0 2003-10-02 08:50
Saving Camera image will not work in 6600 but it does in 3650 iotuus Symbian Media (Graphics & Sounds) 9 2006-01-01 09:02
e65 question lefteros General Discussion 0 2007-06-10 23:51
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX