Dynamic Ringtone - not switching

Post your questions and help other users.

Moderator: Martin

jarid
Posts: 21
Joined: 10 Aug 2015 06:45

Dynamic Ringtone - not switching

Post by jarid » 18 Aug 2015 01:00

I created a flow that is supposed to change the ringtone depending on the incoming contact/group designation. Watching the flow and looking at the log, it correctly identifies the need to either change or not change the ringtone....but it does not.

I only change the ringtone if needed...and change it back to default, again, as needed. (I also track whether to raise the ring volume or ignore the call.)

Is this because the phone is already ringing?

Any suggestions on how to accomplish this?
2015-08-18 00.55.11.png
2015-08-18 00.55.11.png (84.13 KiB) Viewed 18817 times

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Dynamic Ringtone - not switching

Post by Martin » 19 Aug 2015 20:20

Hi,

It could definitely be caused when the phone is already ringing since the phone will most likely not change the ringtone when it's already playing.
What device model and Android version are you using?

Workaround would be to set the ringtone to silent and play the correct ringtone from Automagic using and action Sound. This has the negative side effect that you have to stop playing the ringtone on your own.

Regards,
Martin

jarid
Posts: 21
Joined: 10 Aug 2015 06:45

Re: Dynamic Ringtone - not switching

Post by jarid » 20 Aug 2015 02:08

I am using a Droid Razr Maxx (XT912) running CyanogenMod v11-201560626-SNAPSHOT-XNG3CAO1L8-spyder on Android v4.4.4.

I moved the flow around a bit...along the lines you were thinking. Keeping the default ringtone for Starred and only changing if incoming call is a friend or non-contact.

Again, didn't work. The log and watching the flow indicate it is make all the right decisions/moves...just not changing the ringtone while the phone is ringing.
2015-08-20 02.06.33.png
2015-08-20 02.06.33.png (82.3 KiB) Viewed 18798 times

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Dynamic Ringtone - not switching

Post by MURTUMA » 20 Aug 2015 09:20

Already ringing ringtone doesn't change, because it's loaded in the memory and play from there. Changing the setting does not change that, it only changes what sound will be loaded onto memory. So there's no fix for that.

What martin said was to change ringer mode to silent and have Automagic play the sound. It's dirty trick but it works.

jarid
Posts: 21
Joined: 10 Aug 2015 06:45

Re: Dynamic Ringtone - not switching

Post by jarid » 20 Aug 2015 21:45

I understood Martin's suggestion regarding playing a sound...I was trying to get around that.

I've come up with the flow below. It isn't neat, but does work.

I did try writing the sound file to a playsound.ogg for each different branch, but I am afraid of have the call go to voice message if the flow takes to long and I never hear the ring.

If I were to save the ring sound to a variable, can I have the Sound action play the variable? (I couldn't find this in the documentation.)
2015-08-20 21.40.34.png
2015-08-20 21.40.34.png (93.79 KiB) Viewed 18778 times

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Dynamic Ringtone - not switching

Post by MURTUMA » 21 Aug 2015 07:26

You can't save the sound itself into variable but rather the location of the sound file. In sound action change sound type to "file" and then you can use the variable containing the location of the sound.

Check the action help under file section. It says it supports variables in blue text(link). Clicking the link gives you more help how to use variables.

jarid
Posts: 21
Joined: 10 Aug 2015 06:45

Re: Dynamic Ringtone - not switching

Post by jarid » 21 Aug 2015 17:55

Thank you. I updated my flow...much cleaner and it works!

Do I need to explicitly use the Stop Flow or does Automagic understand some boxes just terminate?
2015-08-21 17.51.38.png
2015-08-21 17.51.38.png (96.47 KiB) Viewed 18760 times

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Dynamic Ringtone - not switching

Post by MURTUMA » 21 Aug 2015 19:09

jarid wrote:Do I need to explicitly use the Stop Flow or does Automagic understand some boxes just terminate?
When the last action is executed, the flow will stop. By looking the screenshot I can't see any problem in your flow.

jarid
Posts: 21
Joined: 10 Aug 2015 06:45

Re: Dynamic Ringtone - not switching

Post by jarid » 21 Aug 2015 19:31

Great. Thank you.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Dynamic Ringtone - not switching

Post by MURTUMA » 22 Aug 2015 09:48

No problem!:)

Post Reply