mediarecorder

Voice Call recording in android using MediaRecorder

不打扰是莪最后的温柔 提交于 2019-12-01 11:03:05
I have a problem in recording a call I have made a service and called a BroadcastReceiver to get the call state. In TelephonyManager.EXTRA_STATE_OFFHOOK when the call is received. I am using following code to record the call recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); recorder.setOutputFile(audiofile.getAbsolutePath()); try { recorder.prepare(); recorder.start(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e

MediaRecorder.ondataavailable - data size is always 0

做~自己de王妃 提交于 2019-12-01 10:47:50
问题 I'm trying to record a user's voice in the browser using Web API Media Recorder. At this stage, all I'm trying to do with the audio once recorded is add it to the source of an audio element and play it back. When I stop the recorder, the 'ondataavailable' event is triggered, but the size of the data is 0, and nothing can be played back. Here's where my code is at. I'm using React. Any ideas would be very much appreciated! handleRecording (stream) { const recordedChunks = this.state

MediaRecorder start failed -19 and Camera error 100

梦想与她 提交于 2019-12-01 08:42:52
I am developing an app to record video. I got this code in my App which is running fine in Nexus 4 and Sony Ericsson mini pro, but when I test in other devices, like Archos 80G9 and Jiayu G3ST, the app gives me the following error "MediaRecorder start failed -19" or sometimes "camera error 100 ". I tried implementing some changes suggested in other stackoverflow posts but the error still appears. private boolean prepareVideoRecorder() { /** ADDED Sony Ericsson Stoped */ try { mCamera.setPreviewDisplay(null); } catch (java.io.IOException ioe) { Log.d(TAG, "IOException nullifying preview display

MediaRecorder start failed -19 and Camera error 100

て烟熏妆下的殇ゞ 提交于 2019-12-01 06:47:28
问题 I am developing an app to record video. I got this code in my App which is running fine in Nexus 4 and Sony Ericsson mini pro, but when I test in other devices, like Archos 80G9 and Jiayu G3ST, the app gives me the following error "MediaRecorder start failed -19" or sometimes "camera error 100 ". I tried implementing some changes suggested in other stackoverflow posts but the error still appears. private boolean prepareVideoRecorder() { /** ADDED Sony Ericsson Stoped */ try { mCamera

MediaRecorder Silence at Beginning of Recording (Delay?)

泄露秘密 提交于 2019-12-01 06:01:25
My MediaRecorder is setup to record audio from the mic. This works ... except that the first .65 seconds is completely dead air - its as if the first .65 second the record button was pressed but the mic had not turned on yet. I need to determine if: Something is wrong with my code This is just a flaw in the way MediaRecorder works 1 and 2 are true, but there is a work around! Jason Van Anden RehersalAudioRecord contains some very well written code for recording in uncompressed WAV format. Using this, recordings do not have the dead air at the beginning. This class leverages AudioRecord, which

MediaRecorder Silence at Beginning of Recording (Delay?)

橙三吉。 提交于 2019-12-01 03:06:00
问题 My MediaRecorder is setup to record audio from the mic. This works ... except that the first .65 seconds is completely dead air - its as if the first .65 second the record button was pressed but the mic had not turned on yet. I need to determine if: Something is wrong with my code This is just a flaw in the way MediaRecorder works 1 and 2 are true, but there is a work around! 回答1: RehersalAudioRecord contains some very well written code for recording in uncompressed WAV format. Using this,

Android: Reliable Audio Recording, All Devices

a 夏天 提交于 2019-12-01 00:22:35
Can someone please share with me a RELIABLE way to record audio across all devices using MediaRecorder? I'm simply trying to record a low-bitrate AMR format audio file, which according to google is standard across all devices. That's a bunch of crap. In my experience, there are many off-brand devices, tablets, etc. that will fail horribly when you use the default AudioEncoder.AMR_NB. My workaround is currently to use reflection to poll what encoders are in the superclass, then looping through each one with an errorlistener to see which one doesn't fail. Not only is this not graceful, but it

Android: Reliable Audio Recording, All Devices

廉价感情. 提交于 2019-11-30 19:49:57
问题 Can someone please share with me a RELIABLE way to record audio across all devices using MediaRecorder? I'm simply trying to record a low-bitrate AMR format audio file, which according to google is standard across all devices. That's a bunch of crap. In my experience, there are many off-brand devices, tablets, etc. that will fail horribly when you use the default AudioEncoder.AMR_NB. My workaround is currently to use reflection to poll what encoders are in the superclass, then looping through

Problem with android MediaRecorder setVideoSize()

空扰寡人 提交于 2019-11-30 18:10:52
Can android MediaRecorder capture video with resolution higher than 320*240 ? When I used MediaRecorder::setVideoSize() to set the video size, the captured video were all at the resolution of 320*240 . Whats even worse, the higher ones can not get a clear video, they were somehow greenish. (encoder used is h263 , format is mpeg4 ) Android version used here is 1.6 Could you please anyone help me out? I had an issue similar to what is described here. I turned out that I had to restructure my code slightly before I could adjust the video size. The important thing is that setVideoSize() is called

MediaRecorder class starts recording audio after slight delay

帅比萌擦擦* 提交于 2019-11-30 14:26:21
问题 I am having an issue with the MediaRecorder class. When I call the start() method, the recorder starts recording(audio) but after some delay (The delay is quite noticeable - approximately 1 second). I have seen this happening on Android 2.3 devices, specifically Samsung Nexus S. This issue does not appear on Android 1.6 (G1) or any version of Android emulators. Could you please confirm if you are seeing this issue and if there exists a solution for the same? Is this a documented bug? 回答1: