I am trying to dynamically replace my ringtone with a synthesized speech from text. But as soon as I get an incoming call my app seems to loose audio focus and I cannot change my ringtone dynamically.
Is there a way to do this?
Thanks
~Saurabh
I am trying to dynamically replace my ringtone with a synthesized speech from text. But as soon as I get an incoming call my app seems to loose audio focus and I cannot change my ringtone dynamically.
Is there a way to do this?
Thanks
~Saurabh
Finally found the bug in my code.
I was calling a Receiver for my incoming calls. I was creating the texttospeech
object in my onReceive()
function instead of my Receive class constructor.
I don't know why but when I make this change it works.