Page 1 of 3

Dynamic Ringtone - not switching

Posted: 18 Aug 2015 01:00
by jarid
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 18813 times

Re: Dynamic Ringtone - not switching

Posted: 19 Aug 2015 20:20
by Martin
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

Re: Dynamic Ringtone - not switching

Posted: 20 Aug 2015 02:08
by jarid
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 18794 times

Re: Dynamic Ringtone - not switching

Posted: 20 Aug 2015 09:20
by MURTUMA
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.

Re: Dynamic Ringtone - not switching

Posted: 20 Aug 2015 21:45
by jarid
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 18774 times

Re: Dynamic Ringtone - not switching

Posted: 21 Aug 2015 07:26
by MURTUMA
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.

Re: Dynamic Ringtone - not switching

Posted: 21 Aug 2015 17:55
by jarid
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 18756 times

Re: Dynamic Ringtone - not switching

Posted: 21 Aug 2015 19:09
by MURTUMA
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.

Re: Dynamic Ringtone - not switching

Posted: 21 Aug 2015 19:31
by jarid
Great. Thank you.

Re: Dynamic Ringtone - not switching

Posted: 22 Aug 2015 09:48
by MURTUMA
No problem!:)