• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Tasker: Play mp3 file when answering call

NinjaSpawn

Lurker
Aug 27, 2016
6
0
I'm trying to make a profile, that will play a specifik audio file when I answer a call and When the call hang up.

The first profile doesn't work, but the second does :/
Not sure how the Phone Offhook works, if it even is the one I need to use?

This is what I have right now:

Profile 1 (answer phone)
Context: Phone Offhook
Task:
Music Play
File: Ringtones/RingtonePickup.mp3
Start: 0
Stream: Ringer

Profile 2 (Hang up)
Context: Phone Idle
Task:
Music Play
File: Ringtones/RingtonePickup.mp3
Start: 0
Stream: Ringer
 
What I did to test it ...

Profile: Aidle (562)
Event: Phone Idle
Enter: Anon (563)
A1: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A2: Beep [ Frequency:8000 Duration:1000 Amplitude:50 Stream:3 ]
A3: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A4: Flash [ Text:phone Idle Long:Off ]

Profile: Aoffhook (569)
Event: Phone Offhook
Enter: Anon (578)
A1: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A2: Beep [ Frequency:8000 Duration:1000 Amplitude:50 Stream:3 ]
A3: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A4: Flash [ Text:phone Offhook Long:Off ]

The Off Hook plays the sound through the earpiece. You need to turn on the Speaker to hear it without the earpiece.

... Thom
 
Upvote 0
What I did to test it ...

Profile: Aidle (562)
Event: Phone Idle
Enter: Anon (563)
A1: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A2: Beep [ Frequency:8000 Duration:1000 Amplitude:50 Stream:3 ]
A3: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A4: Flash [ Text:phone Idle Long:Off ]

Profile: Aoffhook (569)
Event: Phone Offhook
Enter: Anon (578)
A1: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A2: Beep [ Frequency:8000 Duration:1000 Amplitude:50 Stream:3 ]
A3: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A4: Flash [ Text:phone Offhook Long:Off ]

The Off Hook plays the sound through the earpiece. You need to turn on the Speaker to hear it without the earpiece.

... Thom
I tried a test where the phone Offhook had a flash task but it never showed :/
But can you tell me what im missing for it to play a mp3 file when I answer a call?
 
Upvote 0
Did you listen in the earpiece? My assumption is that you have the speaker off when answering the phone and that is the cause of your issue. The beeps in my example illustrate it.

Can you configure your phone app to initially have the speaker on?

Another possible cause is that you need to add some Waits ... perhaps the sound is too short and is being skipped over.

... Thom
 
Upvote 0
This version turns the speaker on before the Beep.

Profile: Test (579)
Event: Phone Offhook
Enter: Anon (580)
A1: Speakerphone [ Set:On ]
A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A3: Flash [ Text:Test Long:Off ]
A4: Beep [ Frequency:8000 Duration:1000 Amplitude:50 Stream:3 ]

... Thom

I can hear the sound but I have to make it wait and it's really low :/
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones