audiorecord

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

Android - AudioRecord class does not read data, audioData and fftArray return zero

ε祈祈猫儿з 提交于 2019-12-21 06:41:24
问题 I am new to android and I have been working on a Pitch Analyzer application (minimum SDK: 8). I read many articles on how to implement Audiorecord class but I wonder why it does not read any data when I record. I tried to display the values of the audioData and fftArray but zero is returned, so I assumed the problem is with the read method. Please try to check these. Here are the codes I used: FFT.java Complex.java record.java final Intent intent = new Intent("pitch.analyzer.PitZer.ASSESSMENT

Android - AudioRecord class does not read data, audioData and fftArray return zero

╄→гoц情女王★ 提交于 2019-12-21 06:41:00
问题 I am new to android and I have been working on a Pitch Analyzer application (minimum SDK: 8). I read many articles on how to implement Audiorecord class but I wonder why it does not read any data when I record. I tried to display the values of the audioData and fftArray but zero is returned, so I assumed the problem is with the read method. Please try to check these. Here are the codes I used: FFT.java Complex.java record.java final Intent intent = new Intent("pitch.analyzer.PitZer.ASSESSMENT

Android AudioRecord questions?

瘦欲@ 提交于 2019-12-18 17:04:44
问题 I have been messing around with the AudioRecord feature of the Android API and found some strange behaviors with it. Background info: My phone is a HTC Incredible I am using the Eclipse plugin for Android development with the emulator. Targeted platform or OS is 2.2... Since it is what my phone uses. Some code: bufferSize = AudioRecord.getMinBufferSize(FREQUENCY, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); audioRecord = new AudioRecord(MediaRecorder.AudioSource

AudioRecord: start() status -38

家住魔仙堡 提交于 2019-12-18 12:58:11
问题 I have the following problem: I use SpeechRecognizer to identify a few words. I use the public void onResults method to destroy the SpeechRecognizer. Right after the destruction I initialize an AudioRecord and start recording from the mic. This leads to the following error in my logcat: 12-09 00:44:01.976: E/AudioRecord(21185): start() status -38 No exception is thrown in my code. The AudioRecord just does not start properly. I am assuming that the SpeechRecognizer does not release the

Recording in Android giving exceptions

帅比萌擦擦* 提交于 2019-12-18 09:48:12
问题 When I am trying to record an audio through the emulator using following code AudioRecord recordInstance = new AudioRecord( MediaRecorder.AudioSource.MIC, this.getFrequency(), this .getChannelConfiguration(), this.getAudioEncoding(), bufferSize); Then I am getting following exceptions in logcat: 12-16 19:07:31.680: INFO/jdwp(223): Ignoring second debugger -- accepting and dropping 12-16 19:07:31.700: ERROR/AudioHardware(34): Error opening input channel 12-16 19:07:31.720: WARN

PCM -> AAC (Encoder) -> PCM(Decoder) in real-time with correct optimization

耗尽温柔 提交于 2019-12-17 08:11:13
问题 I'm trying to implement AudioRecord (MIC) -> PCM -> AAC Encoder AAC -> PCM Decode -> AudioTrack?? (SPEAKER) with MediaCodec on Android 4.1+ (API16). Firstly, I successfully (but not sure correctly optimized) implemented PCM -> AAC Encoder by MediaCodec as intended as below private boolean setEncoder(int rate) { encoder = MediaCodec.createEncoderByType("audio/mp4a-latm"); MediaFormat format = new MediaFormat(); format.setString(MediaFormat.KEY_MIME, "audio/mp4a-latm"); format.setInteger

Record audio played on AudioTrack?

大兔子大兔子 提交于 2019-12-13 04:44:08
问题 I have an android app that plays a generated tone on an AudioTrack, so my question is: is there a way to record whatever is played on that AudioTrack(it's started, stopped, written to, and released frequently), be able to play it back, and save it to the music library? The class that plays the music: package com.example.test; import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android

Android - how to add gain control when recording

你。 提交于 2019-12-13 02:57:28
问题 I work for an audio recorder app and would like to add gain control but I don't know how to do it. I have access to audio buffer but I don't know how to make the sound louder or slower. I see another apps that have a seekBar for selecting the decibels from a specific range. aRecorder.read(buffer, 0, buffer.length); fWriter.write(buffer); // Write buffer to file Please tell me what should I do to implement gain control in my app. Thanks. 回答1: Changing the volume is simple, just multiply all

AudioRecord and MediaRecorder Android parallele

倖福魔咒の 提交于 2019-12-12 21:42:02
问题 I have to use in my application and audiorecord MediaRecorder same time. One register my scripts and the other for displaying the sound input with the amplitudes of the input signal. My application crash when I use simultaneously but independently it works fine. So do you have a solution that I can use at the same time??? Trace logCat : 10-16 22:02:08.675: E/MediaRecorder(9007): start failed: -1 10-16 22:02:08.675: W/System.err(9007): java.lang.RuntimeException: start failed. 10-16 22:02:08