Android - detect if speakers are playing audio programmatically - android

I'm working on a diagnosis app for android, I want to test whether the speakers are working fine or not. I thought the way to do this is to play a sound and check whether the speakers are playing the audio or not. I looked for code but didn't find anything useful. How can this be achieved in android? Is there a better way to do the same thing?

Related

How can I use an app (programming with Android Studio) to control the sound outputs of a device?

I would like to develop an app with which you can control the focus of individual sound outputs, so that you can, for example, play music with Spotify and at the same time play a video via Youtube, which then no longer has any sound. Is something like that even possible?
Thanks for an answer

How To disable system settings automatically while playing music in Android

This question is for anyone who knows about audio on Android devices.
We need an Android app for auditory training.
In this app, individualised music is downloaded for each user and then listened to for a while for trining purposes.
It is essential that this music is played unchanged, i.e. without the influence of equalisers, room sound, bass amplification, etc.
Is there a way to bypass the system audio settings in the app or to deactivate them automatically?
Different manufacturers seem to handle the system audio settings somewhat differently. We have noticed differences between Samsung, Google, Sony, Motorola, OnePlus, Redmi.
Therefore, it might make the most sense to bypass the system audio within the app.
We have made attempts with CONTENT-TYPE and USAGE_ because we had the hope that USAGE_VOICE-COMMUNICATION would bypass the equalisers. But that doesn't work and some manufacturers seem to activate compressors or noise reduction, which degrades the quality of the music.
So far we are working with the integrated player.
Does a self-programmed player make a difference?
Does anyone know a solution?
Thank you!

Is there a way to prevent stopping the audio in Spark AR on recording without disable the microphone?

In my current project I have an Audio file which plays all the time. As soon as I click the record button the audio stops. When I disable the microphone it works but I actually want to record my own voice (like a karaoke) This Problem only occurs only on Android.
Is there any hack to fix this Problem?
Just worked on a filter where I had to build a karaoke style gameplay, what I noticed was Spark does not like playing audio AND recording on mic as it probably causes weird artifacting if not implemented properly. It seems like something that will be added line.
Possible fixes to get your filter working for now, add instructions to use the filter with headphones, connecting to an external audio device will let you play audio and record using the mic at the same time. This works on android, not on iOS. You have to give players visual cues to sing along or whatever your objective maybe.
Hope this is sorted out and fixed in the coming updates, really handicaps the kind of experiences possible on the platform.
Hope this helped.

Process music being played by another Android app?

I'm looking to make an Android app that can process music being played by another app. More specifically I want to analyze the raw audio. I've done some research and looked around, but I'm beginning to think this isn't possible, and maybe for good reason.
Does anyone have any ideas on how I might be able to achieve this capability?
as your requirement is to analyse all aps audio and want to process raw audio too.only one possibility is there which is to start recorder in background service and analyse audio all the time like many of the call recorder app on play store is doing to record a call.
it does have some drawbacks too
background noise
you will not able to know when music starts and when stops.

Play pre-recorded audio into a voice call

The question have been asked before ( How to play an audio file on a voice call in android, play an audio file on a voice call etc), but I will ask it anyway: Is it possible to play an audio file into an ongoing voice call. I know the short answer is "No", but I have not figured out why it is not possible.
I know the SDK does not have support for it, but would it by any chance be possible in some way to write your own code that handles this, maybe with help from C/C++ code (using the NDK)? Does anyone have any idea on how to solve this? Or is the answer a strict "no, you cannot play pre-recorded audio into a voice call"?
I do not really care if the solution does not work on all devices, as long as I can find some devices that support the solution, and I can consider the get root access if that is needed.
I used Audiotrack to play audio with stream set to STREAM_VOICE_CALL during voice call on my One-Plus(Test Device) and it worked perfectly, however the audio which I speak is heard clearly and the music played is not heard. Probably because of the noise cancellation feature applied. I used Lollipop based Rom for this.So the answer is yes we can play.

Categories

Resources