android-audiorecord

How to get audio amplitude with speech recognizer?

孤街醉人 提交于 2019-12-10 11:33:37
问题 I'm trying to make a custom dialog while speech recognizing instead of using the official one. I got that part, but when then I decided to show the amplitude of the sound while recognizing, in order to make it more fancy, like Google Now search bar does (its a circle around the microphone that grows if voice its louder): Then I started to code how to obtain the amplitude of the sound, and finally I got it with AudioRecord Class. The problem comes when I try to mix both (SpeechRecognizer and

Recording audio from external source in an android application

痞子三分冷 提交于 2019-12-09 06:41:26
I saw there was a similar question here: Is it possible to record from the external mic when recording video in Android? However, the question was never really answered and android documentation does not clearly state how this is done. This person in this thread states that it is possible, but does not say how. Real-time audio capture and playback from an external mic It would make sense for you to make the selection in the "setAudioSource" section, but none of the options are for external sources. MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource

Recording audio from external source in an android application

六月ゝ 毕业季﹏ 提交于 2019-12-08 08:52:37
问题 I saw there was a similar question here: Is it possible to record from the external mic when recording video in Android? However, the question was never really answered and android documentation does not clearly state how this is done. This person in this thread states that it is possible, but does not say how. Real-time audio capture and playback from an external mic It would make sense for you to make the selection in the "setAudioSource" section, but none of the options are for external

Increase volume of recording Android AudioRecord

青春壹個敷衍的年華 提交于 2019-12-06 19:30:09
问题 I'm using AudioRecord and lame to record mic input to a mp3 sample for 12 seconds. The audio is recorder as expected but I realized the volume is too low. Is there a way to increase the volume of the recording? 回答1: There is no gain settings in the audioRecord class to play with, so you cannot control the volume of the audio being recorded. The low volume of the audio is related to the hardware and varies from device to device. Here are a few options you can try. 1) try opening in the audio

How to get audio amplitude with speech recognizer?

泄露秘密 提交于 2019-12-06 11:56:45
I'm trying to make a custom dialog while speech recognizing instead of using the official one. I got that part, but when then I decided to show the amplitude of the sound while recognizing, in order to make it more fancy, like Google Now search bar does (its a circle around the microphone that grows if voice its louder): Then I started to code how to obtain the amplitude of the sound, and finally I got it with AudioRecord Class. The problem comes when I try to mix both (SpeechRecognizer and AudioRecord), because seems like they are not able to share microphone, or something like that... In

Unable to retrieve AudioTrack pointer for write()

ぐ巨炮叔叔 提交于 2019-12-06 03:37:53
问题 I am trying to implement AudioTrack to retrieve audio in my android device for incoming call from IAX but facing exception after some while . private void writeBuff(short[] buf) { try { if (this.track == null) { Log.w("IAX2Audio", "write() without an AudioTrack"); return; } int written = 0; while (written < buf.length) { if (this.track != null) { int res; res = this.track.write(buf, written, buf.length - written); switch (res) { case AudioTrack.ERROR_INVALID_OPERATION: Log.e("IAX2Audio",

Increase volume of recording Android AudioRecord

回眸只為那壹抹淺笑 提交于 2019-12-05 01:24:15
I'm using AudioRecord and lame to record mic input to a mp3 sample for 12 seconds. The audio is recorder as expected but I realized the volume is too low. Is there a way to increase the volume of the recording? Shrish There is no gain settings in the audioRecord class to play with, so you cannot control the volume of the audio being recorded. The low volume of the audio is related to the hardware and varies from device to device. Here are a few options you can try. 1) try opening in the audio record in different modes and see whats works best . check - http://developer.android.com/reference

Implement getMaxAmplitude for audioRecord

醉酒当歌 提交于 2019-12-04 20:25:36
问题 I am using audioRecord instead of mediarecorder in my app it's working fine but I have a logic that depends highly on the maxamplitude which is really hard to obtain using the audiorecord here is what I am using when reading the buffer private void writeAudioDataToFile(){ byte data[] = new byte[bufferSize]; String filename = getTempFilename(); FileOutputStream os = null; try { os = new FileOutputStream(filename); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e

AudioRecord with Gain Adjustment not working on Samsung Device

家住魔仙堡 提交于 2019-12-04 13:12:46
问题 I have written code for recording audio file using AudioRecord and while writing file on SD card i am making two version. Version 1 Recorded file is saved on SD Card as it is. Version 2 I am applying Gain feature on recorded file and saving on SD card. This works awesome on Sony Ericson mobiles.Also audio volume is boost to great extent. But i am struggling to make it work on Samsung Devices. when i play recorded file it sound like Talking Tom :P Initially i thought Samusung device did not

How to record audio on android wear

半腔热情 提交于 2019-12-04 08:54:10
问题 There is some way to record audio on android wear? I used AudioRecord API and it crashes the application. Am I doing something wrong? short[] audioData = new short[minBufferSize]; AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, minBufferSize); audioRecord.startRecording(); while(recording){ int numberOfShort = audioRecord.read(audioData, 0, minBufferSize); for(int i = 0; i < numberOfShort;