audiorecord

Creating a WAV file from raw PCM data using the Android SDK

南楼画角 提交于 2019-11-27 12:26:15
I'm trying to use the AudioRecord class to record a WAV file. The problem is that it only supplies the raw PCM data, and if I write it to a file, there is no header information, so it will not play in any media player. How can I create a WAV file from this raw data? Or alternatively, is there any other way to record sound in Android to a WAV file (or, alternatively MP3)? Oh, and I know that MediaRecorder can'y be used because it doesn't support either WAV or MP3 formats. OK, I've got this figured out. This post was crucial in helping me: http://computermusicblog.com/blog/2008/08/29/reading-and

Writing PCM recorded data into a .wav file (java android)

别来无恙 提交于 2019-11-27 06:34:01
I'm using AudioRecord to record 16 bit PCM data in android. After recording the data and saving it to a file, I read it back to save it as .wav file. The problem is that the WAV files are recognized by media players but play nothing but pure noise. My best guess at the moment is that my wav file headers are incorrect but I have been unable to see what exactly the problem is. (I think this because I can play the raw PCM data that I recorded in Audacity) Here's my code for reading the raw PCM file and saving it as a .wav: private void properWAV(File fileToConvert, float newRecordingID){ try {

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

谁说我不能喝 提交于 2019-11-27 06:14:35
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(MediaFormat.KEY_CHANNEL_COUNT, 1); format.setInteger(MediaFormat.KEY_SAMPLE_RATE, 44100); format.setInteger

Recording .Wav with Android AudioRecorder

雨燕双飞 提交于 2019-11-27 01:39:56
问题 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); }

Android: Need to record mic input

感情迁移 提交于 2019-11-26 21:33:09
Is there a way to record mic input in android while it is being process for playback/preview in real time? I tried to use AudioRecord and AudioTrack to do this but the problem is that my device cannot play the recorded audio file. Actually, any android player application cannot play the recorded audio file. On the other hand, Using Media.Recorder to record generates a good recorded audio file that can be played by any player application. But the thing is that I cannot make a preview/palyback while recording the mic input in real time. Any feedback is very much appreciated! Thanks in advance!

How to adjust microphone sensitivity while recording audio in android

好久不见. 提交于 2019-11-26 16:19:42
问题 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. 回答1: As I understand you don't want any automatic adjustments,

Creating a WAV file from raw PCM data using the Android SDK

狂风中的少年 提交于 2019-11-26 15:59:55
问题 I'm trying to use the AudioRecord class to record a WAV file. The problem is that it only supplies the raw PCM data, and if I write it to a file, there is no header information, so it will not play in any media player. How can I create a WAV file from this raw data? Or alternatively, is there any other way to record sound in Android to a WAV file (or, alternatively MP3)? Oh, and I know that MediaRecorder can'y be used because it doesn't support either WAV or MP3 formats. 回答1: OK, I've got

Android AudioRecord example [closed]

不羁的心 提交于 2019-11-26 12:43:49
I am designing an Android app and I need to implement an AudioRecord class to record the user's sound. After some research (that didn't provide enough information) and few failed attempts, I was wondering if anyone could help me by posting an example (code) on how to capture high quality sound using AudioRecord. I would really appreciate it. Thank you Rahul Baradia Here I am posting you the some code example which record good quality of sound using AudioRecord API . Note: If you use in emulator the sound quality will not much good because we are using sample rate 8k which only supports in

Writing PCM recorded data into a .wav file (java android)

此生再无相见时 提交于 2019-11-26 12:05:40
问题 I\'m using AudioRecord to record 16 bit PCM data in android. After recording the data and saving it to a file, I read it back to save it as .wav file. The problem is that the WAV files are recognized by media players but play nothing but pure noise. My best guess at the moment is that my wav file headers are incorrect but I have been unable to see what exactly the problem is. (I think this because I can play the raw PCM data that I recorded in Audacity) Here\'s my code for reading the raw PCM

Android: Need to record mic input

蹲街弑〆低调 提交于 2019-11-26 09:06:27
问题 Is there a way to record mic input in android while it is being process for playback/preview in real time? I tried to use AudioRecord and AudioTrack to do this but the problem is that my device cannot play the recorded audio file. Actually, any android player application cannot play the recorded audio file. On the other hand, Using Media.Recorder to record generates a good recorded audio file that can be played by any player application. But the thing is that I cannot make a preview/palyback