Playing a tone

Login to reply to this topic.
Mon, 2005-05-16 07:38
Joined: 2005-01-31
Forum posts: 122
Hi,

I want to play tones when the call is active.I can catch the call alright.
I tried to use MMdaAudioToneUtility's PrepareToPlayTone() and then Play(). The Prepare function returns 0 but the play function returns -13 (KErrDied).
Any ideas why KErrDied is returned?
Note: KErrDied is returned only if call is active otherwise the code for playing tone works fine.

I then tried to use PrepareToPlayDTMF(TDesC& astr). I pass _L("P12345678") as the arguement. But, the prepare function returns KErrArgument.

Can it be done using public api? On browsing the forum, I saw that there was talk about using RAdvGsmPhoneCall's SendDTMFTone method. Even if I use etelagsm.h, can I be sure that the related LIB files will be present on all phones.

Any ideas and comments would be really appreciated

Regards,
kurtrips

Tue, 2005-05-17 09:19
Joined: 2005-03-15
Forum posts: 94
my guess :)
Could it be due to the fact that your audio device is already in use. You could try to use your code to play tone first, and then make an incoming call to this device, your tone would mostly pause or stop based on the NewL() parameters used by you.

For example, if the priority of Tone Utility is EMdaPriorityPreferenceTime then the playback operation fails when audio device is already in use.

Vivek

Vivek Chopra

Tue, 2005-05-17 09:47
Joined: 2005-01-31
Forum posts: 122
Re: my guess :)
Hi Vivek,
Thanks for replying.

Quote from: vivekchopra
Could it be due to the fact that your audio device is already in use. You could try to use your code to play tone first, and then make an incoming call to this device, your tone would mostly pause or stop based on the NewL() parameters used by you.

That's a good idea. I'll try that out.
But I am trying to play beep during an outgoing call. Anyway, the audio device is always gonna be already in use in such cases. But I'm sure there must be a way to play tones during a call.

Let's see.

Regards
kurtrips
Tue, 2005-05-17 10:12
Joined: 2005-03-15
Forum posts: 94
Playing a tone
3rd and 4th parameter of NewL() function define the priority/preference of tone playing. (TMdaPriority & TMdaPriorityPreference are the parameters)

You could try to manipulate these two parameters to set the higher priority for playing tone. That might be helpful.

I am also still learning, can't give you a definite answer for sure Smiley

Vivek

Vivek Chopra

Sat, 2005-05-21 11:53
Joined: 2005-01-31
Forum posts: 122
Re: Playing a tone
Thanks dude, that did help Grin
  • Login to reply to this topic.