Voice Recording is muted after calling record Android - 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.

Related

Media recorder stopped notification

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.

Mixing audio with music player and AudioManager.requestAudioFocus

Is it possible to mix my app's audio with the music player audio?
I find that by default, android does mix the audio of the music player with my app.
However this stops working after calling AudioManager.requestAudioFocus method. Meaning, if the music player is playing, when my app starts playing, it stops the music player. I want them to play at the same time.
I request the audio focus so I can know when other interruptions such as phone calls have happened. I do want to stop my app's audio when a phone call happens.
My audio plays sin waves, it is a medical device. I request the audio focus with AudioManager.STREAM_MUSIC and AudioManager.AUDIOFOCUS_GAIN.
I am using AudioTrack to play them.

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.

Android: How to "Voice Detecting" to Voice Recorder

I've done voice recording and playing following this link:
Record audio and play the recorded audio
I need a change in it. It is recording and playing on button click. Rather I want to a background service or whatever that continuously "listening mic", if it detects some voice then it should record it (let say max length of recording is 1 min) and on voice recording finishing (either there is no input or 1 min recording completes) then it should play it automatically.
Kindly, guide me to achieve it...
Thanks,

Categories

Resources