Recording sound, and then using/saving it on Android - java

I want to add a feature into my app where you can record sound and then use it within the app (MediaPlayer)
How can I do this?
How do I record sound?
How do I get it into a Mediaplayer?
Does it have to be saved? or can it go from being recorded -> into app straight away...

Use AudioRecord class.

Related

How embed chronometer in recorded video Android studio

I have set app permission, capturing video, saving video file. Here what I have do it. Chronometer displayed during the recording like as I have to also displayed on the output video file. Kindly advise me to do that.
I think Grafika is old one and not usable.

Read current audio output - Android

I want to know if it is possible to access the audio that is currently playing on the Android device.
Example: if Spotify is running in the background, I want to access the audio to control some LEDs that are connected to my RaspberryPi.
I want to create some sort of equalizer that changes colors depending on the sound that is currently playing. I appreciate if some one could tell me if accessing the main audio output is possible or not.
Unless you are using a rooted phone, it's not possible to capture output of a random app on Android.
You can however create an app that plays media files and captures the output for the purpose of visualization with "Visualizer" effect. You can take a look on the sample here: https://android.googlesource.com/platform/development/+/master/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.java
(look for "Visualizer").
If you are using Raspberry Pi anyway, you can just play all your music through it, capture and analyze it there. You will need an external USB sound card though. See for example this post: http://www.g7smy.co.uk/2013/08/recording-sound-on-the-raspberry-pi/
There they just record and play audio back, but you can insert an analysis phase in between.

Android: Take video without user input

I was wondering if there was a way to record video without user input in android. I've tried to to use other code before, but it pops up the camera app which is not what I want.
You are welcome to use MediaRecorder, in conjunction with android.hardware.Camera or the android.hardware.camera2.* classes, to record a video, without the user having to do anything other than run your app.
Using an ACTION_VIDEO_CAPTURE Intent to launch a third-party video recorder will usually require that the user tap something to start recording the video.

Speechrecognition while filming with camera

I'm developing an android app that needs to film and use speechrecognition at the same time. The problem is, that the camera uses the microphone so the speechrecognition api wont have acces to the microphone.
My solution was to disable the audio in the camera and only record the video. Problem with this solution is that when using the RecognitionListener you can't acces the audio file.
Then i tried to use the RecognizerIntent with startActivityForResult. The problem with this solution is that the activity will open a 'pop up' and the camera stops working. Does anyone have an idea how to fix this problem.
When you record video. did you receive any callback for what is recording? I mean if you can receive audio, you can save that audio alone, and then access it by recognizer

Is it possible to make an Android App that records Audio while taking fotos?

I've read somewhere that it isn't still possible to record Audio while using the Camera function on Android phones. But this source was kind of outdated.
I've also read, that this is possible on Iphone.
But I need this function for Android to create an App.
Can anybody say more to that?
Is there a possibility on Android to archive that in an Application?
I don't see why not. They don't share the same hardware. Even if not, you could easily fake it by recording video (which also records sound) and just taking the first still image of the video as your photo.

Categories