Android record camera and music from players - android

I am trying to do following functionality in my mobile app:
1) In my app I have record button. When pressed it starts camera recording
2) if I have music playing in my mobile phone in any of
players - this music should overlay the video
3) External microphone
in this situation should also record additional sound
So as a result we will have video record+music+microphone sound
Right now, I got stuck while trying to get access to android.permission.CAPTURE_AUDIO_OUTPUT
(I am not using root access btw and can't use it)
Is there a way to solve 1+2+3(record+music+microphone) ? If yes, how can one solve it?

Not really an answer, but too long for a comment.
Guess you should take a look at MediaRecorder here and the android.permission.RECORD_AUDIO permission. But MediaRecorder is only working with MediaPlayer. So if you are using Exoplayer or similar it's not a solution. Be aware, that this might not work on all hardware devices and with all Android Versions (I think you should test with Android 10 first)!
Be aware of AudioFocusManager on Android. If you start the camera, it will request the AudioFocus, so other music apps on your device will stop playing music if you request the camera with sound. (There are differences between Android 10 and below).
Furthermore, camera is using device microphone, so I think recording microphone and camera input at the same time might not work, but you can always use the video-sound in this case.

Related

disable screen record with sound in flutter

I am trying to disable screen record and screenshot in my flutter app and I already did using flutter_windowmanager package.
my problem is with screen recording, the sound of the video inside th app is still running and recorded by screen recording !
any suggestions for also preventing sound record ?
No. If your app is playing loud enough the microphone can hear it, it can be recorded. There's no way to prevent that- algorithmically canceling out sound from one source in an audio recording like that would be difficult, if not impossible. Nor would it really buy you all that much- they could always just hold an external mic up to the phone (they can also just capture your app with a second camera, which makes removing video recording also of limited use, if done to prevent a user from recording).
The one thing you could do is claim the mic yourself and not give it up. But that would be annoying to anyone actually using your app. And wouldn't rpevent capture with an external device of course.

Android capture internal (application) audio

I want to capture internal audio, programmatically. For instance, I want to play an audio file (on my device) and then capture the audio output - not using the microphone with the volume turned up.
Example use case: I want to make a library that other developers can use in their games, allowing users to record in-game audio.
Android says there is Playback Capture functionality, however, I just cannot find an example. I've googled for hours. Whenever I google 'android capture app sounds' or 'android record audio', I either get links to voice recording apps or some code recording from the microphone (usually nearly 10 years old)... e.g
Does anyone have a link to a working example?
You can reference MediareCorder with https://developer.android.com/guide/topics/media/mediarecorder

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.

Android Service to detect video playback on a third party Video Player

I need to develop an Android Service (API level > 21), which should be able to detect video playback on a third party Video player, so that it can further disable the Notification pop-ups during a video playback.
On searching, I found several posts talking about detecting the play-states of videos in a VideoView, such as the following:
How to detect when VideoView starts playing (Android)?
But, I couldn't find anything that can help detecting video playback on a video player, wherein, the video player is installed as a third party app and is not a part of the Android application/ service.
So, the challenges are:
1) The android service needs to detect a video playback
2) Registering package names for video player apps with the Service is out of question, since the Service should be able to detect the playback even when a new video player is installed from the Playstore.
3) Need to extend this idea for online video streaming as well.
Any help in this regard would be really appreciated.
Thanks in advance.
There is no way to implement 100% reliable video playback detection :(
Just and idea: try listening to the audio focus changes... this might help with detection of video playback, assuming the target player respects the audio output stream usage policy, recommended by Google. You might also want to get notified about system UI visibility changes (to detect fullscreen playback).
Audio focus:
https://developer.android.com/guide/topics/media-apps/volume-and-earphones.html
System UI visibility changes:
https://developer.android.com/reference/android/view/View.OnSystemUiVisibilityChangeListener.html
Also, you are correct saying that package name based detector is not an option since detecting active/running package is no longer possible on android 7.

How can I record a video with sound of my app using Android Studio?

I am developing an app with Android Studio 2.1 and I would like to record a video of an usage example, with sound.
I have already recorded some videos, but always without sound. As the sound in my app is a key feature, I would like to have the video with the audio output of my app.
Is it possible? In case it is, how could I use it?
Thanks!
Maybe you should try using external app for recording both screen and sound. I have dig in just few mins and i have found some apps.
Here I left link to a top http://www.androidauthority.com/best-screen-recording-apps-600838/
The last one seems to be the one you are looking for (SCR Screen Recorder, which requires root), hope it works!
Other option could be to use a male to male audio cable and record the audio transmitted to the pc.

Categories

Resources