mediarecorder

How to trigger Vibration on Sound Input?

两盒软妹~` 提交于 2019-12-05 03:33:21
I am trying to create an android application where I filter one specific frequency of a beep and make the phone vibrate. I am taking input from the MIC of mobile and using MediaRecorder class, by using this class, I can record, save and play the input. Now I need my mobile to vibrate whenever there is a beep/or any sound. The input is given by a wire to the Headphone jack of the mobile so I know that there is only one frequency being input. I have a button, Clicking which starts recording. I have Permissions to vibrate and record in my manifest file already. record.setOnClickListener(new View

Android MediaRecorder produces corrupt video with green lines

强颜欢笑 提交于 2019-12-05 01:10:22
问题 I'm trying to add video recording capability to my app using MediaRecorder in Android, but the resulting video looks corrupt with green lines (audio is fine). The following code is what I use to initialize the MediaRecorder object: mMediaRecorder = new MediaRecorder(); mCamera.unlock(); mMediaRecorder.setCamera(mCamera); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mMediaRecorder.setOutputFormat(MediaRecorder

Maximum number of simultaneous MediaRecorder instances on android?

我与影子孤独终老i 提交于 2019-12-04 22:29:07
I created android app that records device screen (using MediaProjection ) API and video from camera at the same time. I use MediaRecorder in both cases. I need a way to find out whether device is actually capable of recording two video streams simultaneously. I assume there is some limit on number of streams that can be encoded simultaneously on given devices but I cannot find any API on android platform to query for that information. Things I discovered so far: Documentation for MediaRecorder.release() advises to release MediaRecorder as soon as possible as: " Even if multiple instances of

Voice recognition fails to work when the voice is under recording

烈酒焚心 提交于 2019-12-04 21:45:19
问题 I am working on a function that when a button is pressed, it will launch voice recognition and at the same time will record what the user says. Codes as follows: button_start.setOnTouchListener( new View.OnTouchListener() { @Override public boolean onTouch(View arg0, MotionEvent event) { if (pressed == false) { Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra

Android MediaRecorder and setOutputFile

偶尔善良 提交于 2019-12-04 21:24:47
问题 I've read the Android SDK and I've found that the MediaRecorder class can take input from a Camera, Audio or other source and compress it. Through the setOutputFile method you can specify where you want the data to be stored (File or URI), but what if I want to store that data in a memory buffer and send it over a connection? Or process it before sending it? I mean is there a way not to create a file but to use a memory buffer only? 回答1: You can of course read the file in later and do

Is it possible to record audio on Android while lock screen is on?

好久不见. 提交于 2019-12-04 18:41:24
I'm writing a sound recorder app and I'm wondering if it's possible to activate the MediaRecorder while the phone has its lock screen up. If so, is it just a matter of a special permission or something else? Thanks in advance. you should try using PowerManager class with permission android.permission.WAKE_LOCK . you can find more Here. Yes it is possible. Lock screen does not affect the working of services in an application. So if you are using a service, then your recording will proceed. However, if your phone is in standby, then it may not work. In that case, just grab a wakelock to keep the

Android Mediarecorder recorded video duration different from expected duration

有些话、适合烂在心里 提交于 2019-12-04 17:26:40
问题 I recorded a video using android Mediarecorder. (Main Problem: I need to know the exact startTime[System time] and endTime[System time] of the video and the [endTime - startTime] must match the duration of the actual video) MediaRecorder.start startTime = System.currentTimeMillis() then on stop MediaRecorder.stop endTime = System.currentTimeMillis() I am expecting the video to have this duration expected_duration = (endTime - startTime) However, the expected_duration is always more than the

Opencv4android Mediarecorder.getSurface() no View display

删除回忆录丶 提交于 2019-12-04 17:14:54
I want to use Opencv4android sample Tutorial1 to do Video Recorder. And I use this solution, but my smartphone not display anything on Screen. Just black view. Can anyone help me? here is my code Tutorial1Activity public class Tutorial1Activity extends Activity implements CvCameraViewListener2 { private static final String TAG = "OCVSample::Activity"; private CameraBridgeViewBase mOpenCvCameraView; private boolean mIsJavaCamera = true; private MenuItem mItemSwitchCamera = null; //*****************writetoSD***********************// public FileWriter fw; // = new FileWriter(folder_path, false);

MediaRecorder.AudioSource.VOICE_CALL is not working for call Recording in Android 4.1.2

回眸只為那壹抹淺笑 提交于 2019-12-04 15:45:24
https://github.com/esnyder/callrecorder I've applied this source code to perform call recording but It's not recording call (Two Way Recording). After searching a lot I've got android have banned call recording service after version 4.1. But there is an CallRecorder App on google play which is working fine in my mobile too. How can I perform call recording feature in my app? Auto-Droid ツ AudioSource.VOICE_CALL not working in android 4.0 but working in android 2.3 posting late on thread but still Check this link hope it will help https://play.google.com/store/apps/details?id=com.rivalogic

Android MediaRecorder Multiple Files

回眸只為那壹抹淺笑 提交于 2019-12-04 13:19:42
问题 I am using a MediaRecorder to record video from the camera save it as .mp4 to the SDCard, which works flawlessly. I would like to limit the length of the .mp4 files to 10 seconds each and then automatically create a new file (ie: If a user records 30 seconds I would like to create three files, segment1.mp4 (0:00-0:10), segment2.mp4 (0:10-0:20), and segment3.mp4 (0:20-0:30)). Here is where I set up the recorder and the output. What should I be doing to make this happen while recording? private