Media recorder stopped notification - android

I need help setting up a notification everytime the media recorder is stopped for a certain amount of time. My program starts and stops media recorder often but its usually instant so I need the code to say everytime media recorder is null for say 10 seconds call notification method.

Related

Background Audio Recording with Media Recorder in Android Studio with Java

I am trying to record audio and save it in a temporary file every 30 seconds the app is running and send it to firebase.
I am able to get this working but the problem is when the app goes to background, I can't create a new instance of the Media Recorder and it crashes the app.
I have a foreground service which works well.
Please how can I fix this?
I am expecting that every 30 seconds, a new temporary file will be created and saved, the next 30 seconds a new audio file will be set for saving the next audio even while the app is running in background.

Voice Recording is muted after calling record Android

I'm voice recorder developer.
my problem is voice recording is muted after calling with record, not just calling
it is ok that the recording is muted while calling because after calling the app get back MediaRecorder.AudioSource.MIC and is available for recording
but calling with calling record, the app records mute at all
this problem occurs AudioRecord and MediaRecorder both.
is there any way to get MIC again so record after calling?
please help me and save my time.

android how to get the statue of phone whether it is playing a sound file

A user make a new task A and set the alarm, then he make another new task B in the same time and also set the alarm.
When the alarm for task A come up,the user doesn't dismiss the alarm on time,the alarm for task B just come after it.Well,now it's duet.
I want some help for judge the statue if the phone is playing any music sounds or how to prevent the alarm to show duet.
My project must depend on API 7.
To get the statue of phone whether it is playing a sound file, you can refer this document.
Before your app starts playing any audio, it should hold the audio focus for the stream it will be using. This is done with a call to requestAudioFocus() which returns AUDIOFOCUS_REQUEST_GRANTED if your request is successful.

Android MediaPlayer suddens stops playing streams

I am using the Android's default MediaPlayer to play audio streams. I am facing a problem wherein the stream stops after sometime and doesn't recover post that. If I stop the MediaPlayer object and then again call a Play on it, the same stream plays fine. This means that the Stream was up but my MediaPlayer somehow stopped playing it and never recovered
Is there some solution to this? Can I detect when does my MediaPlayer stops receving and playing data so that I can reinitiate the player?
Thanks
You can listen for errors using onErrorListener
http://developer.android.com/reference/android/media/MediaPlayer.OnErrorListener.html
In my app, I start a progress dialog that says "Recovering". Meanwhile I reinitialise my media Player and seekTo the time it reached before the error, then I dismiss the dialog.

Is there any Listener for Media Recorder?

Actually i am creating an application which starts recording when user start speaking and
stop recording automatically when user stop speaking.
so is there any way to find if user is speaking or not?
is there any listener for Media Recorder for this?
No, AFAIK there are no listeners or intents that would notify your app that sound level has gone above some threshold (e.g. user started talking).
You could use AudioRecord class to record the microphone audio and then analyze it to see the volume. However this would require your app to run at that time.

Categories

Resources