mediarecorder

Is there pause available in mediarecorder class

我们两清 提交于 2019-12-02 06:19:10
问题 Is there a way to pause the recording and start after a while. 回答1: Short answer: no Once you are recording the only possible actions are stop and reset. 回答2: There is no pause() functionality when recording media. I would try conjoining two separate audio files together once the user hits your "stop" button in the app. Either that, or try to find a way to write to the same file stream after using the stop() method. 来源: https://stackoverflow.com/questions/6128440/is-there-pause-available-in

MediaRecorder: start failed

三世轮回 提交于 2019-12-02 02:57:12
问题 I have googled about it but didn't find any solution I am recording incoming and outgoing calls code works fine with outgoing call but gives exception on incoming call recorder = new MediaRecorder(); File sdCard = Environment.getExternalStorageDirectory(); File dir = new File(sdCard.getAbsolutePath() + "/OK"); dir.mkdirs(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setOutputFile(Environment

Is there pause available in mediarecorder class

故事扮演 提交于 2019-12-02 01:37:36
Is there a way to pause the recording and start after a while. Short answer: no Once you are recording the only possible actions are stop and reset. There is no pause() functionality when recording media. I would try conjoining two separate audio files together once the user hits your "stop" button in the app. Either that, or try to find a way to write to the same file stream after using the stop() method. 来源: https://stackoverflow.com/questions/6128440/is-there-pause-available-in-mediarecorder-class

MediaRecorder: start failed

无人久伴 提交于 2019-12-01 22:44:39
I have googled about it but didn't find any solution I am recording incoming and outgoing calls code works fine with outgoing call but gives exception on incoming call recorder = new MediaRecorder(); File sdCard = Environment.getExternalStorageDirectory(); File dir = new File(sdCard.getAbsolutePath() + "/OK"); dir.mkdirs(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setOutputFile(Environment.getExternalStorageDirectory().getAbsolutePath()+"/OK/"+"yes"+".3gpp"); recorder.setAudioEncoder(MediaRecorder

How to print log messages with in Android framework

耗尽温柔 提交于 2019-12-01 19:13:15
I am trying to print log messages within core Android framework files. For example, I tried logging messages within MediaRecorderClient.cpp under frameworks\base\media\libmediaplayerservice\ . I've tried LOGV , LOGE , LOGD , printf , and __android_log_print , without any success. Which command should I use to print log messages? Log should be used, but it will print to logcat not system print. Example: Log.d("filter", example text); // filter is any tag you want to use as filter You can open logcat in eclipse from window-show view -> other -> android -> logcat What kind of error do you receive

Android: Two instances of Media recorder at same time

余生长醉 提交于 2019-12-01 17:06:36
Can i run two instances of Android MediaRecorder class at the same time? For example public MediaRecorder mrec1 ; public MediaRecorder mrec2 ; mrec1.setCamera(mCamera); mrec1.setPreviewDisplay(surfaceHolder.getSurface()); mrec1.setVideoSource(MediaRecorder.VideoSource.CAMERA) . . . . mrec2.setAudioSource(MediaRecorder.AudioSource.MIC); mrec2.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mrec2.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); . . . . mrec1.prepare(); mrec2.prepare(); mrec1.start(); mrec2.start(); I get this error when second start() is called i just want to know is

MediaRecorder: setCamera() - error camera is not aviable

北城以北 提交于 2019-12-01 14:32:41
Anyone know how to using it for mediarecorder ? im using recorder.setPreviewDisplay(holder.getSurface) where holder - it's camera ( i see chest rectangle on my screen of phone) When i runn my app - in logcat i see error (camera is not aviable) im try to using function setCamera - but it's not help me. Anyone know how to right use it ? or maybe i can record video(only video, without audio) some other way? ok SOLVED this code for example mediaRecorder = new MediaRecorder(); camera.unlock(); mediaRecorder.setCamera(camera); Have you forgot to set the permissions on your android manifest? <uses

Get supported Codec for Android device

社会主义新天地 提交于 2019-12-01 14:06:09
问题 Is there a way to ask an Android device what audio and video Codecs it supports for encoding? I found devices that do not support some of the codecs listed as mandatory in http://developer.android.com/guide/appendix/media-formats.html and there seem to be devices supporting additional codec not listed there. 回答1: That could be interesting for you: private static MediaCodecInfo selectCodec(String mimeType) { int numCodecs = MediaCodecList.getCodecCount(); for (int i = 0; i < numCodecs; i++) {

MediaRecorder: setCamera() - error camera is not aviable

做~自己de王妃 提交于 2019-12-01 13:09:00
问题 Anyone know how to using it for mediarecorder ? im using recorder.setPreviewDisplay(holder.getSurface) where holder - it's camera ( i see chest rectangle on my screen of phone) When i runn my app - in logcat i see error (camera is not aviable) im try to using function setCamera - but it's not help me. Anyone know how to right use it ? or maybe i can record video(only video, without audio) some other way? ok SOLVED this code for example mediaRecorder = new MediaRecorder(); camera.unlock();

MediaRecorder.ondataavailable - data size is always 0

泪湿孤枕 提交于 2019-12-01 13:08: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.recordedChunks; const mediaRecorder = new MediaRecorder(stream) const _this = this; mediaRecorder.start();