audiorecord

AudioRecord and AudioTrack latency

我的梦境 提交于 2020-01-10 19:36:07
问题 I'm trying to develop an aplication like iRig for android, so the first step is to capture the mic input and play it at the same time. I have it, but the problem is that i get some latency that makes this unusable, and if I start processing the buffer i'm afraid it will get totally unusable. I use audiorecord and audiotrack like this: new Thread(new Runnable() { public void run() { while(mRunning){ mRecorder.read(mBuffer, 0, mBufferSize); //Todo: Apply filters here into the buffer and then

Android : java.lang.RuntimeException: Unable to instantiate activity ComponentInfo: java.lang.NullPointerException

笑着哭i 提交于 2020-01-03 05:19:28
问题 I am trying to record audio, after that should play record immediately. Where I am going wrong. Please help me out. I am not getting. showing null pointer exception... Here is the code import android.app.Activity; import android.media.AudioFormat; import android.media.AudioManager; import android.media.AudioRecord; import android.media.AudioTrack; import android.media.MediaRecorder; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View

Frequency detection on Android - AudioRecord

眉间皱痕 提交于 2020-01-02 21:49:29
问题 This is my second question because i hawe a problem. I've to implement a simple Frequency detection on Android. For the DFT i've found the jTransform library (https://sites.google.com/site/piotrwendykier/software/jtransforms). In the API of jTransform http://incanter.org/docs/parallelcolt/api/edu/emory/mathcs/jtransforms/fft/DoubleFFT_1D.html#complexForward%28double%5B%5D%29 i had seen that i've to pass a double vector at the complexForward() method, and obliviously not a File. So, for first,

Android AudioRecord Initialization delay

烂漫一生 提交于 2020-01-01 12:30:47
问题 Here is a sample of the relevant code im working on: AudioRecord recorder = setupAudio(); recorder.startRecording(); SetupAudio method: public AudioRecord setupAudio() { AudioRecord recorder; minBufferSizeInBytes = AudioRecord.getMinBufferSize( RECORDER_SAMPLERATE, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT); Log.e("MoverAudio","BufferSize: " + minBufferSizeInBytes); recorder = new AudioRecord(MediaRecorder.AudioSource.CAMCORDER, RECORDER_SAMPLERATE, AudioFormat.CHANNEL_IN

Live Audio Recording and Playing in Android and Thread & callback handling

社会主义新天地 提交于 2019-12-27 19:14:13
问题 I want to record the live audio and play it.As far as UI is concerned the app just has three buttons:one for start recording and streaming it, one for playing a pre recorded file and the last one for stopping the current task(recording / playing). For that purpose I have used AudioRecord and AudioTrack classes for recording and playing respectively. My Program looks like.... /** * @author amit * */ public class AudioRecorder extends Activity { private String LOG_TAG = null; /* variables which

Live Audio Recording and Playing in Android and Thread & callback handling

≡放荡痞女 提交于 2019-12-27 19:13:57
问题 I want to record the live audio and play it.As far as UI is concerned the app just has three buttons:one for start recording and streaming it, one for playing a pre recorded file and the last one for stopping the current task(recording / playing). For that purpose I have used AudioRecord and AudioTrack classes for recording and playing respectively. My Program looks like.... /** * @author amit * */ public class AudioRecorder extends Activity { private String LOG_TAG = null; /* variables which

Automatic Gain Control(AGC) for external mic

余生长醉 提交于 2019-12-25 07:09:04
问题 I have an audio recording app on android market which records using PCM-WAV format. My app also offers custom gain control ([-20dB, +20dB]) , so I alter the original audio data with user selected gain value. It works pretty well when using device built-in mic, but I have a user which uses some external mic plugged into his device, and the output is too loud and full of distortions (because of the loudness of his ext mic). Even when he set the gain to -20dB, the output is loud and contains

AudioRecord returns some empty data after start

大兔子大兔子 提交于 2019-12-24 14:42:34
问题 I wrote a standard code for receiving data from microphone by using AudioRecord. Here is my code: AudioReceiver() { int minHardwareBufferSize = AudioRecord.getMinBufferSize(SAMPLE_RATE, CHANNEL_CONFIG, AUDIO_FORMAT); Log.d(TAG, "minHardwareBufferSize = " + minHardwareBufferSize); int bufferSizeBytes = (minHardwareBufferSize > MIN_BUFFER_SIZE_BYTES) ? minHardwareBufferSize : MIN_BUFFER_SIZE_BYTES; bufferSizeShorts = bufferSizeBytes / 2; //резервируем буфер с запасом в 2 раза audioRecorder =

Change Android Audio Record Default input Source

一笑奈何 提交于 2019-12-23 10:19:55
问题 I am currently writing an app that calls for the recording and real time processing of audio data. For this, I am using the AudioRecord class. This works all well and good, except the default setting for recording audio on my primary testing device, a galaxy nexus, is to record from the back speaker. I am assuming most phones default record source will be the back, or bottom microphones, because when you are using the phone to call, your mouth is near the bottom. However, my app requires that

Change Android Audio Record Default input Source

旧巷老猫 提交于 2019-12-23 10:18:26
问题 I am currently writing an app that calls for the recording and real time processing of audio data. For this, I am using the AudioRecord class. This works all well and good, except the default setting for recording audio on my primary testing device, a galaxy nexus, is to record from the back speaker. I am assuming most phones default record source will be the back, or bottom microphones, because when you are using the phone to call, your mouth is near the bottom. However, my app requires that