I wish to make automated calls to a list of numbers to then play a recorded audio message to them. The ones that don't pick up get a call back later.
What's the cheapest and easiest way to develop this using some pre-existing tools? Any directions welcome.
Note: You can play back the audio data only to the standard output
device. Currently, that is the mobile device speaker or a Bluetooth
headset. You cannot play sound files in the conversation audio during
a call.
from the official docs
I ended up using automated flow apps (Automate [link below] is one such app that I used. Disclaimer: I've no affiliation with app) to trigger automated calls. The flow was initiate on a GCM notification to the phone, which provided the number for call. With all permissions granted and conditions fulfilling (network, sim, call credits, etc.), app should be able to make call to the number.
Now, I'm trying to figure out how to play an audio message for the receiver.
So, if you were looking for 'how' part, here's the how part. If you know the next steps, enlighten me!
https://play.google.com/store/apps/details?id=com.llamalab.automate&hl=en&gl=US
Related
Is there any way to build our own Call screening application(Incoming call answer bot) to transfer the specific audio recording to an incoming call? To do that
The application should answer the call. (There is an official API to answer the phone call in recent versions of Android)
The application should be able to receive the voice.
The application should be able to transmit the recording as an outgoing voice.
Is it possible to do 2,3?
In short - I'd be very surprised if 2 and 3 are possible because of legal issues - it is not legal to record conversations in the US (and other parts of the world, probably) and Google, like Apple, do not allow it. This is the main reason call recording has always been clunky on Android (e.g. forcing the user to use the speaker).
If applications have access to voice calls, there will not be a problem recording them
It gets worse on Android 9 onwards...
I'm using code from the following URL in order to get sound data from the microphone with AudioRecord:
http://www.dreamincode.net/forums/topic/303235-visualizing-sound-from-the-microphone/
The problem I'm seeing is that if another app is also using the microphone, I'm getting an error (status -3) from AudioRecord. Everything works as expected if I kill the other app which is using the microphone. Is there an elegant solution to allow my app to access the microphone even if another app is already using it?
Thank you.
Sadly, only one app at a time can access the microphone (just like the camera).
Also, there is no standard way to inform another app that you want access to the microphone (so that they release the resources and let you access it). You could however send a broadcast to all other apps ("requesting the microphone"), but the other apps would have to implement this feature (and very few or zero developers will do this).
I would recommend you to simply inform the user that the microphone is currently not available, because you can't do anything else.
If you are using the "OK Google" function with the option to access it from any page, try turning that off (the 'any page' bit From Google app screen MENU>SETTINGS>VOICE>"OK GOOGLE DETECTION">FROM ANY SCREEN=OFF): it hijacks the microphone, or can do.
I have an Android app that happens to be running in the background on the user's Android phone, while the user is speaking on a phone call that someone placed to the user. At a certain point, my app would like to silence the audio from the phone call and play its own audio. Moreover, I'd like to do this without disrupting the user's speech.
What permission does my app need to have, to do this? Is there any permission that's available to third-party apps that is sufficient to let my app do this?
It looks like AudioManager.setStreamMute(STREAM_VOICE_CALL, true) will mute the audio output from the voice call. But I can't tell what permission this needs: it's not listed in the Android API documentation, or in the Pscout permission map. Also, I can't tell if there any restrictions on using this API from an app running in the background, on any version of Android.
(If the problem statement wasn't clear: Alice has installed my app on her phone. Bob calls Alice. Alice picks up the call and is talking to Bob. At a certain point, my app wants to completely mute Bob's voice and play its own audio clip instead, so Alice hears the audio clip instead of anything that Bob says. But, I don't want to turn off the microphone on Alice's phone: if Alice is saying anything, that should still be picked up over the call and Bob should still hear it on the phone call.)
You can try: android.permission.MODIFY_AUDIO_SETTINGS.
I am writing a android app which is supposed to play back a audio file when a call is in progress coming from a specific number .. I tried many approaches.. but all went in vein
Separate Thread
Listener on Telephone service
starting a service in parallel
can any one please help me how to proceed regarding this ?
Update :
I am able to play a mp3 file on call recieve and i am able to play it load on speaker.. but how ever loud i play the calling party is not able to listen to it.... is there anyway i can push the speaker stream to call stream
From the api doc here
Note: You can play back the audio data only to the standard output
device. Currently, that is the mobile device speaker or a Bluetooth
headset. You cannot play sound files in the conversation audio during
a call.
So from this and lots of other so answers we can conclude that we can not play an audio during a call process.
But a long time ago from a personal experience with a handset I got a result where the audiotrack was playing while there was a call established and both the voices were heard at the same time. So I think this depends on handsets if it allows it then you can play.
You can try another thing experimentally. play the audio using a different route ( speakerphone or bluetooth).
Another option is to build your custom android build
It is possible to programmatically interact with a phone call? Can you, for example, play audio to a caller from a program?
Google has not exposed any API which allows us to feed data to a particular ongoing call. You can however have control over a call. Check this article : here