Android Mediarecorder - "Start Failed: -19"

MediaRecorder: start failed

recorder.prepare();
Thread.sleep(1000);
recorder.start();

For incoming call it was taking time to prepare.

Hold the prepare for 1 sec and everything is worked fine.

E/MediaRecorder: start failed: -38

Updated

While working on this, I found out that I was testing my project on android Lolipop and it is not possible to read and write directly on LocalSockets. You have to use ParcelFileDiscriptor to stream audio.

MediaRecorder Android 11 start failed -1004

Replace "/dev/null" with the correct file path "${externalCacheDir.absolutePath}/test.3gp" and it should work.

MediaRecorder Start Failed Error

code 2147483648 refers to MEDIA_ERROR_SYSTEM (low-level system error).

Based on the documentation:

A BroadcastReceiver object is only valid for the duration of the call
to onReceive(Context, Intent). Once your code returns from this
function, the system considers the object to be finished and no longer
active.

In other words, the MediaRecorder instance that you expect to be there might actually not exist anymore since you're within a different BroadcastReceiver instance than the one that created the MediaRecorder. Its not a great idea to perform this task in BroadcastReceiver since it will only execute for 10 seconds after which System could declare app as not responding.

One solution would be to execute this code to Service



Related Topics



Leave a reply



Submit