Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop failed when click quickly to record and pause #5

Open
loikfb opened this issue Nov 30, 2015 · 3 comments
Open

Stop failed when click quickly to record and pause #5

loikfb opened this issue Nov 30, 2015 · 3 comments

Comments

@loikfb
Copy link

loikfb commented Nov 30, 2015

Here's my stack Trace :

11-30 16:27:20.674 2436-3017/com. E/MediaRecorder: stop failed: -1007
11-30 16:27:20.675 2436-2436/com. W/System.err: java.lang.RuntimeException: stop failed.
11-30 16:27:20.675 2436-2436/com.W/System.err: at android.media.MediaRecorder.stop(Native Method)
11-30 16:27:20.675 2436-2436/com. W/System.err: at com.github.lassana.recorder.AudioRecorder$PauseRecordTask.doInBackground(AudioRecorder.java:125)
11-30 16:27:20.675 2436-2436/com. W/System.err: at com.github.lassana.recorder.AudioRecorder$PauseRecordTask.doInBackground(AudioRecorder.java:117)
11-30 16:27:20.675 2436-2436/com.W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:295)
11-30 16:27:20.675 2436-2436/com.W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-30 16:27:20.675 2436-2436/com. W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
11-30 16:27:20.675 2436-2436/com. W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
11-30 16:27:20.675 2436-2436/com. W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
11-30 16:27:20.675 2436-2436/com. W/System.err: at java.lang.Thread.run(Thread.java:818)

@dougouk
Copy link

dougouk commented Jun 14, 2017

Is it this about this possibly?

Note that a RuntimeException is intentionally thrown to the application, if no valid audio/video data has been received when stop() is called. This happens if stop() is called immediately after start(). The failure lets the application take action accordingly to clean up the output file (delete the output file, for instance), since the output file is not properly constructed when this happens.

@lassana
Copy link
Owner

lassana commented Jun 15, 2017

@dougouk I think -1007 code means that there something wrong with recording configuration (e.g. the device doesn't support it).

@anonym24
Copy link

anonym24 commented Jul 14, 2018

@dougouk not necessarily
50% you could do something wrong 50% MediaRecord is just buggy: https://stackoverflow.com/questions/51332386/mediarecorder-and-videosource-surface-stop-failed-1007-a-serious-android-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants