mediarecorder

Trim or cut audio recorded with mediarecorder JS

ぃ、小莉子 提交于 2019-12-03 17:26:47
Requested Knowledge How to shorten (from the front) an array of audio blobs and still have playable audio. Goal I am ultimately trying to record a continuous 45 second loop of audio using the JS MediaRecorder API. The user will be able to push a button and the last 45s of audio will be saved. I can record, playback, and download a single recording just fine. Issue When I have an array called chunks of say 1000 blobs from the MediaRecorder and use chunks.slice(500, 1000) the resulting blob array can't be used to playback or download audio. Oddly enough chunks.slice(0,500) still works fine. Code

Android MediaRecorder produces corrupt video with green lines

ぐ巨炮叔叔 提交于 2019-12-03 16:23:01
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.OutputFormat.MPEG_4); mMediaRecorder.setOutputFile(Utility.CAPTURE_VIDEO_FILENAME); mMediaRecorder

Video recorded with Android MediaRecorder is corrupted on Samsung Galaxy S2

 ̄綄美尐妖づ 提交于 2019-12-03 15:52:25
Good day! I'm learning how to record video with MediaRecorder but recorded video is corrupted when I play it. See this screenshot: http://www.4shared.com/photo/QtmJCHRi/corrupted-video.html . Picture marked with red rectangle in the left upper corner is what camera can see. But it is so small, it's repeating and there is many green areas. Please advise what am I doing wrong. HW is Samsung Galaxy S2 (GT-I9100, Android 2.3.5). I tried to follow this tutorial: http://developer.android.com/guide/topics/media/camera.html#saving-media Thank you in advance! CameraRecorderActivity.java package cz.ryvo

Android MediaRecorder and setOutputFile

荒凉一梦 提交于 2019-12-03 13:50:21
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? You can of course read the file in later and do whatever you want with it in the way of processing. Assuming that u holds the Uri to the resulting audio file, here

Media Recorder start failed in android for camera

时间秒杀一切 提交于 2019-12-03 13:05:53
问题 I am working on video recording app in which i want to display preview and when user click on record button it start recording and when user click stop button it stop recording. I got video preview on my surface but when i press start button it crash with error "MEDIA.RECORDER.START(Native MEthod). Here is my code Please help me guys. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); surfaceView =

Voice recognition fails to work when the voice is under recording

别说谁变了你拦得住时间么 提交于 2019-12-03 12:42:33
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(RecognizerIntent.EXTRA_CALLING_PACKAGE,"voice.recognition.test"); intent.putExtra(RecognizerIntent

How to know when MediaRecorder has finished writing data to file

被刻印的时光 ゝ 提交于 2019-12-03 12:13:23
问题 We're using MediaRecorder to record video to a file on the external storage using setOutputFile() before doing the actual recording. Everything works fine, but the main issue is that as soon as the recording is done, we want to start playing the recorded video back in a VideoView. How to know when the file is ready to be read and played back? 回答1: The FileObserver class suits your needs perfectly. Here is the documentation. It's easy to use. When a observed file is closed after writing, the

Blob video duration metadata [duplicate]

廉价感情. 提交于 2019-12-03 11:56:20
问题 This question already has answers here : How can I add predefined length to audio recorded from MediaRecorder in Chrome? (3 answers) Closed last year . I am writing a software that manipulates camera stream video in firefox. I am generating a Blob with video type recorded with MediaRecorder API . What i am doing to save the blob as video in local storage is using FileSaver library : FileSaver.saveAs(BlobVideo,"video.mp4"); It seems the video doesnt have any max duration, so i cannot navigate

Android M - MediaRecorder start failed

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Samsung galaxy S6 edge 6.0.1 works fine, so maybe Android M is not the factor here. First off, the Android 6.0+ permissions are given, so that's not the case . Here it is : if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){ //нужно проверять пермишны if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED || ContextCompat

File that I recorded with MediaRecorder can't be played

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using MediaRecoder to record sound, but after I'm done recording it can't be played. I tried with Google Play Music, ES Media Player, even uploaded it to pc and tried opening it with Winamp. Nothing plays it! //AUDIO RECORDER recorder = new MediaRecorder (); recorder . reset (); recorder . setAudioSource ( MediaRecorder . AudioSource . MIC ); recorder . setOutputFormat ( MediaRecorder . OutputFormat . THREE_GPP ); recorder . setAudioEncoder ( MediaRecorder . AudioEncoder . AMR_NB ); if ( Environment . getExternalStorageState (). equals (