android-mediarecorder

Android Capture video mediaRecorder.start() failed -19

删除回忆录丶 提交于 2020-01-13 02:41:12
问题 I need to record the video and save it but I get error on start() method of media recorder: failed - 19 (what is this error supposed to be? There is no comment on it in documentation :( ) I'm fighting with this error second day, I have tried multiple codes (google tutorial, intel sample, ...) I found all over the web, but couldn't make work any of them. Please help me find what is causing the problem. I'm even starting to doubt that my mobile phone (SE live, wt19i ) is capable of recording

java.lang.RuntimeException: start failed

只谈情不闲聊 提交于 2020-01-12 14:42:53
问题 I am trying to record audio in one of my Activities using MediaRecorder. Part of the code is shown below. File file = new File(AppConstants.MSGS_DIR, filename); MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(AudioSource.MIC); recorder.setOutputFormat(OutputFormat.THREE_GPP); recorder.setAudioEncoder(AudioEncoder.AMR_WB); recorder.setOutputFile(file.getAbsolutePath()); try { recorder.prepare(); recorder.start(); } catch (IOException e) { System.out.println("Exception: "

java.lang.RuntimeException: start failed

为君一笑 提交于 2020-01-12 14:42:51
问题 I am trying to record audio in one of my Activities using MediaRecorder. Part of the code is shown below. File file = new File(AppConstants.MSGS_DIR, filename); MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(AudioSource.MIC); recorder.setOutputFormat(OutputFormat.THREE_GPP); recorder.setAudioEncoder(AudioEncoder.AMR_WB); recorder.setOutputFile(file.getAbsolutePath()); try { recorder.prepare(); recorder.start(); } catch (IOException e) { System.out.println("Exception: "

Recording the tapped button with the audio

☆樱花仙子☆ 提交于 2020-01-11 07:12:29
问题 I am creating an instrument. I want that the record button can record the audio and what was tapped. But when I tap the record button, it only record the audio. I want to record the audio and what was tapped by the user. Here it my code for record. public void startRecord() throws Exception { record = new MediaRecorder(); record.setAudioSource(MediaRecorder.AudioSource.MIC); record.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); record.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB)

Video recording and onPreviewFrame callback at the same time

落花浮王杯 提交于 2020-01-10 04:34:10
问题 I'm trying to record video using MediaRecorder and get raw frames (byte arrays) from onPreviewFrame callback method Seems it's not that easy, mb it's not even possible, I don't know... But I found some answers (for similar questions) and people say that you should reconnect camera instance ( Camera.reconnect() ) after calling MediaRecorder.start() and set preview callback again I tried something like this but it doesn't work (recording works but onPreviewFrame is never called) I also tried to

OnAudioFocusChangeListener is not executed when the audio is played and paused?

爱⌒轻易说出口 提交于 2020-01-05 04:36:07
问题 I am developing an application, in which i need to capture the audio being played. So i implemented OnAudioFocusChangeListener in my activity to listen for any audio changes. But the listener is not getting called when music is played or paused. Below is my code public class AudioManagerExample extends Activity implements OnAudioFocusChangeListener{ AudioReceiver adreceiver; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

Recording Videos in Chunks Using Media Recorder Android

我的梦境 提交于 2020-01-04 04:18:20
问题 I am implementing an Application that includes the functionality of saving Recorded Video in to Different Video Files based on a certain amount of Time. For Achieving that i have implemented a Custom Camera and used the MediaRecorder.stop() and MediaRecorder.start() in a certain Loop. But this approach is creating a Lag Effect while restarting Media Recorder (Stop and Start). Is it possible to seamlessly Stop and Start Recording using Media Recorder or any Third Party Library ? Any help is

How to pause/resume the video recording

天涯浪子 提交于 2020-01-02 19:48:40
问题 I want to implement pause/resume functionality while recording video. MediaRecorder is not having any method for pause/resume. Native camera application is having pause/resume feature. Is it possible to implement it? Please guide me. Any help or guidance will be well appreciated. 回答1: Finally i find the answer :) i research about ffmpeg it seems more deeply and some more days digging around it but can't get proper resource for ffmepg and i try to use mp4parser lib and successfully completed

How to detect when there is some speech near MIC in Android

心已入冬 提交于 2020-01-02 08:21:30
问题 Question Statement: I want to start recording when there is some Voice/Noise in vicinity of Phones MIC and stop when user stops speaking. Just Like Talking Tom etc. Is there any third party library or some native code to do this? Thanks 回答1: Just add this code to your application and you will detect when user start to speak and when he stops. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get the minimum buffer size

How to detect when there is some speech near MIC in Android

主宰稳场 提交于 2020-01-02 08:21:23
问题 Question Statement: I want to start recording when there is some Voice/Noise in vicinity of Phones MIC and stop when user stops speaking. Just Like Talking Tom etc. Is there any third party library or some native code to do this? Thanks 回答1: Just add this code to your application and you will detect when user start to speak and when he stops. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get the minimum buffer size