mediarecorder

MediaRecorder crashes on start

余生颓废 提交于 2019-11-27 15:09:32
i've searched many topics but no straight answer. I have this code : recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setOutputFile(mFileName); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); if(!mStartRecording) { btn.setText("Stop Recording"); try { recorder.prepare(); } catch (IOException e) { e.printStackTrace(); } recorder.start(); mStartRecording = true; } else { btn.setText("Start Recording"); mStartRecording = false; recorder.stop(); recorder.reset(); recorder

Pause & Resume with Android MediaRecorder (API level < 24)

穿精又带淫゛_ 提交于 2019-11-27 14:32:08
While using MediaRecorder , we don't have pause/resume for API level below 24. So there can be a way to do this is: On pause event stop the recorder and create the recorded file. And on resume start recording again and create another file and keep doing so until user presses stop. And at last merge all files. Many people asked this question on SO, but couldn't find anyway to solve this. People talk about creating multiple media files by stopping recording on pause action and restarting on resume. So my question is How can we merge/join all media file programmatically? Note: in my case MPEG4

Is it possible to merge multiple webm blobs/clips into one sequential video clientside?

北战南征 提交于 2019-11-27 14:13:14
问题 I already looked at this question - Concatenate parts of two or more webm video blobs And tried the sample code here - https://developer.mozilla.org/en-US/docs/Web/API/MediaSource -- (without modifications) in hopes of transforming the blobs into arraybuffers and appending those to a sourcebuffer for the MediaSource WebAPI, but even the sample code wasn't working on my chrome browser for which it is said to be compatible. The crux of my problem is that I can't combine multiple blob webm clips

Need a simple example for audio recording

跟風遠走 提交于 2019-11-27 13:12:42
问题 I am in need of simple audio recording and playing example using AudioRecorder in android. I tried with MediaRecorder, it works fine. 回答1: You mean AudioRecord ? Search e.g. "AudioRecord.OnRecordPositionUpdateListener" using Google Code Search. Btw, AudioRecord does recording, not playing. See also: Improve Android Audio Recording quality? Android AudioRecord class - process live mic audio quickly, set up callback function 回答2: here is the sample code for audio record. private Runnable

AudioSource.VOICE_CALL not working in android 4.0 but working in android 2.3

僤鯓⒐⒋嵵緔 提交于 2019-11-27 12:54:59
VOICE_CALL, VOICE_DOWNLINK ,VOICE_UPLINK not working on android 4.0 but working on android 2.3 (Actual Device),I have uploaded a dummy project to record all outgoing call so that you can see it for your self http://www.mediafire.com/?img6dg5y9ri5c7rrtcajwc5ycgpo2nf you just have to change audioSource = MediaRecorder.AudioSource.MIC; to audioSource = MediaRecorder.AudioSource.VOICE_CALL; on line 118 in TService.java If you come across any error, tell me. Any suggestion related to it will be accepted. After a lot of search I Found that Some Manufactures have closed the access to such function

how to change video orientation in MediaRecorder to portrait

陌路散爱 提交于 2019-11-27 11:36:51
问题 When I record video by MediaRecorder, it always records in landscape mode, regardless of real device orientation. How to force MediaRecorder/Camera use real orientation ? 回答1: refer to Camera.Parameters.setRotation() for more information. There is an example there and instead of calling setRotation(rotation) try to call mediaRecorder.setOrientationHint(rotation) when recording video. 回答2: Add the following two lines of code: Camera.setDisplayOrientation(90); // use for set the orientation of

CamcorderProfile.QUALITY_HIGH resolution produces green flickering video

*爱你&永不变心* 提交于 2019-11-27 07:47:56
I haven't found any explanation for this so far. Basically I have a video recording class which works splendidly when setVideoSize() is set to 720 x 480 on my Samsung Galaxy S2. I want it to record in the highest possible resolution so using CamcorderProfile.QUALITY_HIGH I can get the various highest quality recording properties and set them within my class. This works for file format, video frame rate, encoders and bit rate, however when I attempt to set the video size to the width and height returned by the CamcorderProfile (1920 x 1080), the video recorded is just a green flicker. I noticed

How can I add predefined length to audio recorded from MediaRecorder in Chrome?

核能气质少年 提交于 2019-11-27 04:07:16
I am in the process of replacing RecordRTC with the built in MediaRecorder for recording audio in Chrome. The recorded audio is then played in the program with audio api. I am having trouble getting the audio.duration property to work. It says If the video (audio) is streamed and has no predefined length, "Inf" (Infinity) is returned. With RecordRTC, I had to use ffmpeg_asm.js to convert the audio from wav to ogg. My guess is somewhere in the process RecordRTC sets the predefined audio length. Is there any way to set the predefined length using MediaRecorder? This is a chrome bug . FF does

CamcorderProfile.QUALITY_HIGH resolution produces green flickering video

烈酒焚心 提交于 2019-11-27 03:59:56
问题 I haven't found any explanation for this so far. Basically I have a video recording class which works splendidly when setVideoSize() is set to 720 x 480 on my Samsung Galaxy S2. I want it to record in the highest possible resolution so using CamcorderProfile.QUALITY_HIGH I can get the various highest quality recording properties and set them within my class. This works for file format, video frame rate, encoders and bit rate, however when I attempt to set the video size to the width and

MediaRecorder failed when i stop the recording

此生再无相见时 提交于 2019-11-27 03:03:23
问题 I have this error. Can somebody please help me, I think it's something about touch listener... The error is happening when I release my finger. 04-25 20:07:00.263: D/FB Sessions(18429): false 04-25 20:07:04.533: I/MediaRecorderJNI(18429): prepare: surface=0x189250 (identity=1813) 04-25 20:07:10.493: E/MediaRecorder(18429): stop failed: -1007 04-25 20:07:10.493: D/AndroidRuntime(18429): Shutting down VM 04-25 20:07:10.493: W/dalvikvm(18429): threadid=1: thread exiting with uncaught exception