简体   繁体   中英

Android play sound during phone call

I want to play music from android phone when some one receives a call. I am able to play music but other side can not listen that music. How can I make other side to listen to music(what should be the coding so that music playback can be inserted into mic for other side to hear)?

I am getting mixed suggestion regarding this feature. check here it is possible

If you're still curious, the reason you cannot play to the other side is that Android's hardware usually doesn't interconnect the actual GSM call stream with any part of software stack that can be used to modify it; what it does is mirroring actual call data (microphone/speaker) to software after it's been sent to line (allowing a little control like setting microphone mute, sending DTMFs and hanging the call).

The exact sound routing is done in phone chip, so no control over it can be achieved; more to say, Bluetooth audio streams are decoded and mirrored in chip (this technology is called DAIBT for direct audio interface), and this effectively works for latency and power effeciency.


Some vendors (currently known: Qualcomm) are providing vendor-specific way to inject audio into GSM call uplink on certain chipsets (MSM8960, APQ8064) - refer to this answer: https://stackoverflow.com/a/15205455/438039 ;

I am using HTC device and it was not possible to achieve the above functionality in this device. This setting varies according to manufacturer. My code might play sound to the listener side in some other manufacturer phones.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM