mediarecorder

Can I use experimental WebKit features in my iOS app?

半城伤御伤魂 提交于 2020-06-16 18:04:48
问题 I am developing an iOS app with react-native. I wanted to use MediaRecorder which is still in 'experimental' phase. I turned it on in advanced Safari settings but when I try to use it in my app: var mediaRecorder = new MediaRecorder(stream) I get this error: ReferenceError: Can't find variable: MediaRecorder This feature works well in safari, but I can't get it to work in my app. Is there a way to turn it on in Xcode/real-native settings? EDIT: Here is the larger section of my code. I use

Can I use experimental WebKit features in my iOS app?

时光毁灭记忆、已成空白 提交于 2020-06-16 18:03:56
问题 I am developing an iOS app with react-native. I wanted to use MediaRecorder which is still in 'experimental' phase. I turned it on in advanced Safari settings but when I try to use it in my app: var mediaRecorder = new MediaRecorder(stream) I get this error: ReferenceError: Can't find variable: MediaRecorder This feature works well in safari, but I can't get it to work in my app. Is there a way to turn it on in Xcode/real-native settings? EDIT: Here is the larger section of my code. I use

recording and speech recognition at the same time with SpeechRecognizer and MediaRecorder

会有一股神秘感。 提交于 2020-05-28 04:45:21
问题 I'm trying to record audio and do speech recognition at the same time. Each of them works separately, but together only the recording works. The code looks like that: private SpeechRecognizer sr; private MediaRecorder recorder; private void startRecording() throws IOException { recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setOutputFile("/dev/null"); recorder.setAudioEncoder

How to fix video & audio out of sync issue on android Video Recording using Camera api 2?

北城余情 提交于 2020-04-16 05:49:44
问题 I am implementing video recording application using Camera2 api. I've used Google samples for video recording. However, there's an audio, video out of sync issue on some devices, such as Samsung J5, J6. I have changed MediaRecorder.AudioEncoder, MediaRecorder.VideoEncoder, VideoEncodingBitrate , but it could not help me. How to handle audio, video sync issue? 回答1: I've found a solution from this article. It mightn't be the best solution but it works. To solve the out of sync issue,

音视频的采集、编码、封包成 mp4 输出

…衆ロ難τιáo~ 提交于 2020-04-06 09:39:00
使用 Android Camera API 完成音视频的采集、编码、封包成 mp4 输出 基于android.hardware.Camera,创建一个横屏应用,实时预览摄像头图像,实现录像并输出MP4的功能。 1、申请权限 <!-- 需要录制音视频权限和写外部存储权限 --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" /> 在activity中动态申请权限 private static final String[] VIDEO_PERMISSIONS = { Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE }; 2、实现摄像头预览功能

(Android小应用)电话监听器

痞子三分冷 提交于 2020-01-30 01:52:11
这是一个Android练手小项目,通过一个BroadcastReceiver广播接收者监听手机启动状态,实现开机启动。因为是电话监听器,所以我们不能让用户察觉,所以不能有软件界面,这是要点,不然也不叫监听器了,主要实现的功能有对所有语音通话进行录制并上传到网上,好了,不废话了,下面一步一步地写…… 首先,我们先来了解一下Service服务 Android中的服务和windows中的服务是类似的东西,服务一般没有用户操作界面,它运行于系统中不容易被用户发觉,可以使用它开发如监控之类的程序。服务的开发比较简单,如下: 第一步:继承Service类 public class PhoneListenerService extends Service {...} 第二步:在AndroidManifest.xml文件中的<application>节点里对服务进行配置: <service android:name="PhoneListenerService"></service> 这里推荐使用eclipse图形化的界面添加 如上图所示,可以添加Service、Permission、BroadcastReceiver等,感兴趣可以自己试一下。 服务不能自己运行,需要通过调用Context.startService()或Context.bindService()方法启动服务。

Android. How to record the microphone over audio stream?

别等时光非礼了梦想. 提交于 2020-01-25 22:01:09
问题 In my application playing music, the user should say at this time into the microphone. Can you please tell me how to make a record? Music and top path from the microphone. I looked through MediaRecorder, but there is not, in my opinion, an appropriate recording source. 回答1: For Recording Through Mic Start and stop recording through Mic.... Start Recording static MediaRecorder recorder = new MediaRecorder(); static String path, filename, time; static int duration; public void startRecording()

Android屏幕录制

最后都变了- 提交于 2020-01-23 23:08:17
1.效果图: 2.添加依赖 dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core-ktx:1.0.2' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' api 'com.blankj:utilcode:1.24.4' } repositories { mavenCentral() } 3.注册权限: <uses-permission android:name=

Using MediaRecorder and NoiseSuppressor in Android

孤人 提交于 2020-01-23 17:51:27
问题 I'm starting off a project experimenting with the Android microphone using code like this: mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setOutputFile(mFileName); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); After that, a prepare() and start() to begin recording mic audio. Trouble is, I'm trying to also add in some audio processing effects like

浏览器端将语音转换为URL格式的字符串(base64 位编码)

折月煮酒 提交于 2020-01-22 13:03:21
我们可以在浏览器端,通过调用 JS 原生的 API ,将语音转换为文字,实现语音输入的效果。思路是: 录制一段音频; 将音频转换为 URL 格式的字符串( base64 位编码); 调用讯飞开放接口,将 base64 位编码转换为文本。 这篇文章实现前两步,将音频转换为 URL 格式的字符串( base64 位编码)。 这里将会用到于媒体录制相关的诸多 API ,先将其列出: MediaDevices ( MediaDevices 使用方法 ) MediaDevices 接口提供访问连接媒体输入的设备,如照相机和麦克风,以及屏幕共享等。 MediaDevices.getUserMedia() 会提示用户给予使用媒体输入的许可。 我们将要访问浏览器的麦克风。若浏览器支持 getUserMedia ,就可以访问麦克风权限。 MediaDevices.getUserMedia() ,返回一个 Promise 对象,获得麦克风许可后,会 resolve 回调一个 MediaStream 对象。 MediaStream 包含音频轨道的输入。 MediaRecorder ( MediaRecorder 使用方法 ) MediaRecorder() 构造函数会创建一个对指定的 MediaStream 进行录制的 MediaRecorder 对象。 MediaStream 是将要录制的流.