create alarm with a sound that I provide..

Login to reply to this topic.
Wed, 2007-10-17 11:03
Joined: 2007-10-17
Forum posts: 11

Hi all!

I'm trying to set a alarm with a sound file that I provide. My code is:

AlarmClientUtils pr;
TInt valor = pr.StartAlarmServer();
//valor returns KErrNone

RASCliSession iSession;
valor = iSession.Connect();
//valor return KErrNone

TASShdAlarm* iAlarm = new TASShdAlarm();
TDateTime *aDateTime = new TDateTime(2007,EOctober,16,10,50,0,0);
TTime *aUtcTime = new TTime(*aDateTime);

iAlarm->Message() = _L("Mensaje!!");
_LIT(KSonido,"C:\\mysound.wav");
TAlarmSoundName iSoundName(KSonido);
iAlarm->SoundName() = iSoundName;

//verify that path is passed correctly, and it's OK
console->Write(iAlarm->SoundName());
iAlarm->SetUtcNextDueTime(*aUtcTime);

valor = iSession.AlarmAdd(*iAlarm);
//valor returns KErrNone

TAlarmGlobalSoundState aState;
iSession.GetAlarmSoundState(aState);
//aState returns EAlarmGlobalSoundStateOn

and this code set the alarm with the date, time and message correctly, but sound is never played. a sound is played but is the alarm's sound system. how I can do for that the alarm plays my sound and not the alarm's sound system?

I tryed differents paths for the sound like "C:\\system\\sound\\mysound.wav" but never was played, and differents types of files like .rng, .acc,....

Thank you!!

  • Login to reply to this topic.