mediarecorder

MediaRecorder start failed: -16 when change CamcorderProfile.QUALITY_LOW to CamcorderProfile.QUALITY_HIGH

谁说胖子不能爱 提交于 2019-12-24 14:05:08
问题 Posical duplicate MediaRecorder start failed: -16 MediaRecorder start failed: -16 when change CamcorderProfile.QUALITY_LOW to CamcorderProfile.QUALITY_HIGH . I have tried many solutions but getting the same error. following is the my code: private boolean prepareVideoRecorder() { if(mMediaRecorder == null){ mMediaRecorder = new MediaRecorder(); }else{ Log.d(Constants.TAG,"MediaRecoder is Not Null"); } // Step 1: Unlock and set camera to MediaRecorder mCamera.stopPreview(); mCamera.unlock();

MediaRecorder freezes the UI thread

最后都变了- 提交于 2019-12-24 11:20:07
问题 I'm using CameraKit library to record video in my app. The issue that I'm facing is that when i start recording then i need to show recording progress as well. But as i call video recording method in which MediaRecorder is prepared and started that freezes the UI thread for ~500-700ms which doesn't let progressBar animate and it feels like on long press of recording button is taking long time but infact it is MediaRecorder that is taking time. Can MediaRecorder be started in background thread

How to append to Android MediaRecorder output file

Deadly 提交于 2019-12-24 04:36:27
问题 I am wondering if there is a way to tell the MediaRecorder to append to an existing audio file instead of starting it over from the beginning. In other words, I would like to call setOutputFile() with an existing file and have the new audio appended to that file instead of erasing it. 回答1: Android MediaRecorder does not support appending. Once you are recording the only possible actions are stop and reset. So one option is saving as a WAV file, and then append to an existing WAV file saved on

chrome.desktopCapture - can't record both system audio and microphone?

倖福魔咒の 提交于 2019-12-24 01:37:08
问题 I've built a Chrome extension that captures screen activity and microphone input and outputs a video file. Since chrome.desktopCapture can't record audio input alongside screen capture, I'm getting the mic in its own, separate stream. So: //get screen stream chrome.desktopCapture.chooseDesktopMedia(['screen'], null, (stream_id, opts) => { let constraints = {video: mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId: stream_id }}; navigator.mediaDevices.getUserMedia(constraints)

android使用MediaRecorder实现录音

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 20:03:05
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 有四个按钮,分别是“录音”、“停止”、“播放”、“删除”。如图1所示。 图1: 录音机的界面 MediaRecorder的生命周期 MediaRecorder可以用来录制音频或视频。它具有以下几个状态: Initial:初始状态,在设定视频源或者音频源之后将转换为Initialized状态。 Initialized:已初始化状态,可以通过设置输出格式转换为DataSourceConfigured状态,或者通过重新启动转换成Initial状态。 · 设置录音来源 : · iMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); · 设置输出格式 : · iMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); · 设置编码方式 · iMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); · 设置输出文件 · iMediaRecorder.setOutputFile(PATH_NAME); · 让 MediaRecorder 对象处于就绪状态 · iMediaRecorder.prepare()

浅入浅出Android(008):使用MediaRecorder录音

霸气de小男生 提交于 2019-12-22 19:57:07
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 使用MediaRecorder既可以录音也可以录像。本文先只讲如何录音。测试的系统是android4。 1、增加录音和读写外部存储的权限 修改AndroidManifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.HelloWorld" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="14"/> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> <activity

Android M - MediaRecorder start failed

故事扮演 提交于 2019-12-22 18:14:08
问题 Samsung galaxy S6 edge 6.0.1 works fine, so maybe Android M is not the factor here. First off, the Android 6.0+ permissions are given, so that's not the case . Here it is : if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){ //нужно проверять пермишны if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.RECORD_AUDIO) != PackageManager

How to build a custom camera recorder app?

流过昼夜 提交于 2019-12-22 13:08:11
问题 I am trying to develop a custom camera video recorder. When my devices execute the start MediaRecorder method in beginRecording() in the Activity, the app crashes. I don't know what is wrong, because I follow the Google API Guide. My devices use Android 2.3 or higher version. In my Nexus S 4.1.1 executes ok, but in my Xperia 2.3.3 doesn't go, displaying this trace. My code is: private static final String TAG = "RecordVideo"; private MediaRecorder mRecorder = null; private Camera mCamera =

How to build a custom camera recorder app?

混江龙づ霸主 提交于 2019-12-22 13:06:14
问题 I am trying to develop a custom camera video recorder. When my devices execute the start MediaRecorder method in beginRecording() in the Activity, the app crashes. I don't know what is wrong, because I follow the Google API Guide. My devices use Android 2.3 or higher version. In my Nexus S 4.1.1 executes ok, but in my Xperia 2.3.3 doesn't go, displaying this trace. My code is: private static final String TAG = "RecordVideo"; private MediaRecorder mRecorder = null; private Camera mCamera =

java.lang.RuntimeException: start failed at android.media.MediaRecorder.start(Native Method)

一个人想着一个人 提交于 2019-12-22 04:37:12
问题 I am working on records a phone calls. When i start a record a phone call then it's unfortunately stop. & it's gives error MediaRecorder start fail -2147483648. I Please tell me what is the problem in my code? Here is my Code. public class incomingcall extends BroadcastReceiver { Context c; MediaRecorder recorder; public incomingcall() { } @Override public void onReceive(Context context, Intent intent) { c = context; try { PhoneStateChangeListener pscl = new PhoneStateChangeListener();