0

I'm working on an Android project. its a phone assistant and auto answers the phone and a pre-defined voice plays for the other party. But there is a problem that android doesnt allow us to play audio when a calling is in progress.

so i looked a lot and searched whole web and i found this answer: https://stackoverflow.com/a/28000021/4254527

This Answer seems to be true. but i dont know how to crate a custom media player. so how can i create a custom media player that doesnt extends from android media player class and plays music during a call.

Community
  • 1
  • 1
Saman Sattari
  • 3,322
  • 6
  • 30
  • 46
  • This cannot be done in a standard way. Android devices do not allow you to play back audio streams while in call. Now all the other methods that might work are hacks so you will find that it might work on one or two models there is no way that will work on all model. I have tried doing this and it is nearly impossible to cater for the differences. I even had problems with a model running different firmware having different results. – Namphibian Feb 08 '15 at 22:49
  • @Namphibian thnx anyway. but can we write a public email to google that they open this feature to us? – Saman Sattari Feb 09 '15 at 14:11
  • We could certainly try however keep in mind that most companies dont produce stock android phones. They take android and then add some elements of their own to it and they can decide to include or exclude a feature as well. There is another challenge here. The reason they dont allow you to play audio stream over calls is due to security concerns. People could fake calls etc with this capability. – Namphibian Feb 10 '15 at 04:26
  • Also beware that if you wanted to listen/record something for your assistant, then this is rumored to require root access (ie. not be allowed) from Android 9 onwards. – nsandersen Feb 13 '19 at 10:16

0 Answers0