audiorecord

Android audio FFT to display fundamental frequency

做~自己de王妃 提交于 2019-11-30 10:19:20
I have been working on an Android project for awhile that displays the fundamental frequency of an input signal (to act as a tuner). I have successfully implemented the AudioRecord class and am getting data from it. However, I am having a hard time performing an FFT on this data to get the fundamental frequency of the input signal. I have been looking at the post here , and am using FFT in Java and Complex class to go with it. I have successfully used the FFT function found in FFT in Java, but I am not sure if I am obtaining the correct results. For the magnitude of the FFT (sqrt[re re+im im])

Android AudioRecord to Server over UDP Playback Issues

此生再无相见时 提交于 2019-11-29 19:55:23
I am trying to make a simple Android application that streams live microphone audio to a server for playback. The resulting playback sounds strange, with large gaps in the audio. Does anyone know what I am doing wrong? EDIT: Solved. Turns out I was assuming that each incoming buffer would be completely full, a faulty assumption on my part. Here is my activity: public class MainActivity extends Activity { private static String TAG = "AudioClient"; // the server information private static final String SERVER = "xx.xx.xx.xx"; private static final int PORT = 50005; // the audio recording options

Android : recording audio using audiorecord class play as fast forwarded

孤街醉人 提交于 2019-11-29 15:46:20
问题 I am trying to record a audio & stores into a sdcard as well as send to server. When I am trying to play recorded voice its playing,but not as I have recorded. If I record voice for 10mins it ll play for 4min i.e someone has pressed fast forward button with some noisy sound. I am not getting where I am going wrong. Can anybody say me how to solve this problem (should play how much i have recorded i.e 10min recorded then should play only 10mins). Here is the code.. sorry for posting bulk code.

Encoding AAC Audio using AudioRecord and MediaCodec on Android

China☆狼群 提交于 2019-11-28 17:19:22
I am trying to encode aac audio using android AudioRecord and MediaCodec. I have created a encoder class very similar to ( Encoding H.264 from camera with Android MediaCodec ). With this class, I created an instance of AudioRecord and tell it to read off its byte[] data to the AudioEncoder (audioEncoder.offerEncoder(Data)). while(isRecording) { audioRecord.read(Data, 0, Data.length); audioEncoder.offerEncoder(Data); } Here is my Setting for my AudioRecord int audioSource = MediaRecorder.AudioSource.MIC; int sampleRateInHz = 44100; int channelConfig = AudioFormat.CHANNEL_IN_MONO; int

Android AudioRecord to Server over UDP Playback Issues

断了今生、忘了曾经 提交于 2019-11-28 15:41:33
问题 I am trying to make a simple Android application that streams live microphone audio to a server for playback. The resulting playback sounds strange, with large gaps in the audio. Does anyone know what I am doing wrong? EDIT: Solved. Turns out I was assuming that each incoming buffer would be completely full, a faulty assumption on my part. Here is my activity: public class MainActivity extends Activity { private static String TAG = "AudioClient"; // the server information private static final

Recording .Wav with Android AudioRecorder

こ雲淡風輕ζ 提交于 2019-11-28 07:01:26
I have read a lot of pages about Android's AudioRecorder. You can see a list of them below the question. I'm trying to record audio with AudioRecorder, but it's not working well. public class MainActivity extends Activity { AudioRecord ar = null; int buffsize = 0; int blockSize = 256; boolean isRecording = false; private Thread recordingThread = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void baslat(View v) { // when click to START buffsize = AudioRecord.getMinBufferSize(44100,

Encoding AAC Audio using AudioRecord and MediaCodec on Android

走远了吗. 提交于 2019-11-27 20:08:49
问题 I am trying to encode aac audio using android AudioRecord and MediaCodec. I have created a encoder class very similar to (Encoding H.264 from camera with Android MediaCodec). With this class, I created an instance of AudioRecord and tell it to read off its byte[] data to the AudioEncoder (audioEncoder.offerEncoder(Data)). while(isRecording) { audioRecord.read(Data, 0, Data.length); audioEncoder.offerEncoder(Data); } Here is my Setting for my AudioRecord int audioSource = MediaRecorder

split two channels of AudioRecord of CHANNEL_IN_STEREO

拜拜、爱过 提交于 2019-11-27 17:02:26
问题 I'm working on a project using stereo record of the Android phones (note 3). But I need to split the data from different channels (right, left). Any idea of how to perform that? Now, I use AudioRecord to record the sound of internal microphones. And I can record, save the sound to .raw and .wav files. Some codes as follows. private int audioSource = MediaRecorder.AudioSource.MIC; private static int sampleRateInHz = 44100; private static int channelConfig = AudioFormat.CHANNEL_IN_STEREO;

How to adjust microphone sensitivity while recording audio in android

情到浓时终转凉″ 提交于 2019-11-27 13:21:56
I'm working on a voice recording app. In it, I have a Seekbar to change the input voice gain. I couldn't find any way to adjust the input voice gain. I am using the AudioRecord class to record voice. recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, RECORDER_SAMPLERATE, RECORDER_CHANNELS, RECORDER_AUDIO_ENCODING, bufferSize); recorder.startRecording(); I've seen an app in the Google Play Store using this functionality. As I understand you don't want any automatic adjustments, only manual from the UI. There is no built-in functionality for this in Android, instead you have to modify

Need a simple example for audio recording

跟風遠走 提交于 2019-11-27 13:12:42
问题 I am in need of simple audio recording and playing example using AudioRecorder in android. I tried with MediaRecorder, it works fine. 回答1: You mean AudioRecord ? Search e.g. "AudioRecord.OnRecordPositionUpdateListener" using Google Code Search. Btw, AudioRecord does recording, not playing. See also: Improve Android Audio Recording quality? Android AudioRecord class - process live mic audio quickly, set up callback function 回答2: here is the sample code for audio record. private Runnable