mediarecorder

Is it possible to record audio on Android while lock screen is on?

随声附和 提交于 2019-12-22 00:38:42
问题 I'm writing a sound recorder app and I'm wondering if it's possible to activate the MediaRecorder while the phone has its lock screen up. If so, is it just a matter of a special permission or something else? Thanks in advance. 回答1: you should try using PowerManager class with permission android.permission.WAKE_LOCK . you can find more Here. 回答2: Yes it is possible. Lock screen does not affect the working of services in an application. So if you are using a service, then your recording will

How to record raw AAC audio files in Android using MediaRecorder? AAC_ADTS doesn't work

纵饮孤独 提交于 2019-12-21 18:33:34
问题 I'm using the Android MediaRecorder to record AAC encoded audio files. Setting the output format to MPEG-4 worked pretty well. But as my audio player supports neither MPEG-4 nor 3GP I tried to get raw AAC files by using the output format AAC_ADTS , which is supported by Android since API level 16. mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS); mRecorder.setOutputFile(mFileName);

Android AudioRecord and MediaRecorder

雨燕双飞 提交于 2019-12-21 13:06:07
问题 I'm developing an audio processing application where I need to record audio, and then process it to obtain features of that recording. However, I want the audio in a playable format to play it after with MediaPlayer. I've seen that to record audio to process it it's better to use AudioRecord, because I can get the raw audio from there. But then I can't write the data to a file in a playable format (is there any library to do this in android?). I used this method to record raw data and then

How to use setCamera (MediaRecorder)?

久未见 提交于 2019-12-21 11:06:24
问题 According to Android SDK MediaRecorder.setCamera can be used to recycle the existing camera instance for video capture and preview without resetting the preview. I was not able to find any sample, and all my attempts were futile: I either get the wrong state exception, or MediaRecorder.prepare fails. Does anyone know if this method usable at all? How can I use it then? Any samples available on the Web? For reference: http://developer.android.com/reference/android/media/MediaRecorder.html

MediaRecorder starts with a 1 sec delay. How do I get rid of the silence?

天涯浪子 提交于 2019-12-19 04:55:15
问题 I am trying to use MediaRecorder in a Service to record sounds. But it creates a 1 sec delay (silence) at the start. how to i get rid of this? I tried using RehearsalAudioRecorder still has no luck. If anyone has fixed this problem before please advice. Start Intent serviceIntent = new Intent(); serviceIntent.setAction("com.soundrecoder.RecorderService"); serviceIntent.putExtra("audioFile", path); serviceIntent.putExtra("state", true); startService(serviceIntent); Stop Intent serviceIntent =

Problem with android MediaRecorder setVideoSize()

纵饮孤独 提交于 2019-12-18 19:31:46
问题 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? 回答1: I had an issue similar to what is described here. I turned out that I had to restructure

Android MediaRecorder in streaming

℡╲_俬逩灬. 提交于 2019-12-18 15:53:37
问题 Its possible to "stream" result of MediaRecorder? The unique method i can see is mediaRecorder.setOutputFile that receives a FileDescriptor. So i can write the result to a File or send via socket to receiver. I tried the second solution but the result video is corrupted because is not "seekable" in stream. The idea is to use the camera of android device to publish result to Red5. 回答1: Yes, it possible, there are many examples for that. You can checkout sipdroid example. Or even Android IP

Couldn't hear incoming voice in recorded calls in android 7?

假如想象 提交于 2019-12-18 12:34:33
问题 I am developing an Android app for recording calls. This is my code snippet. recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); recorder.setOutputFile(file_path); This is working perfectly for devices below android 7, but when I use Android 7 mobile devices I can hear only outgoing voice but cannot hear incoming voice . Can anyone

MediaRecorder - record calls application

早过忘川 提交于 2019-12-18 09:44:21
问题 im trying to develope application that recording calls. when im recording the output sound sounds very wired - electronic sounds instead the other person voice. here is my code: public class MainActivity extends Activity implements OnClickListener { private Boolean Recording; private Button btn_REC; private MediaRecorder mrec; private File audiofile = null; private static final String TAG = "SoundRecordingDemo"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

how to switch between front and back camera when using MediaRecorder android

泪湿孤枕 提交于 2019-12-18 02:57:14
问题 if anyone has any idea that how to switch between front and back camera when using MediaRecorder . I defing a button for this function, but have no idea how to define the onclickListener. the total activity is the following: import java.io.File; import java.io.IOException; import android.app.Activity; import android.content.Intent; import android.content.pm.ActivityInfo; import android.hardware.Camera; import android.media.MediaRecorder; import android.os.Bundle; import android.os.Environment