android-audiorecord

Android AudioRecord Supported Sampling Rates

喜你入骨 提交于 2019-12-17 07:09:10
问题 I'm trying to figure out what sampling rates are supported for phones running Android 2.2 and greater. We'd like to sample at a rate lower than 44.1kHz and not have to resample. I know that all phones support 44100Hz but was wondering if there's a table out there that shows what sampling rates are valid for specific phones. I've seen Android's documentation ( http://developer.android.com/reference/android/media/AudioRecord.html) but it doesn't help much. Has anyone found a list of these

AudioRecord object not initializing

走远了吗. 提交于 2019-12-17 01:43:12
问题 In the below code my audioRecord object is not initializing. I tried moving it to the onCreate method and made it a global. I've logged the state and that returns a value of 1 which means ready to use. The debugger says that startRecording is being called on an uninitialized object. It is also saying that it could not get the audio source. Why am I getting these errors? package com.tecmark; import java.io.BufferedOutputStream; import java.io.DataOutputStream; import java.io.File; import java

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

Android: AudioRecord Class Problem: Callback is never called

跟風遠走 提交于 2019-12-12 07:10:29
问题 My Android Java Application needs to record audio data into the RAM and process it. This is why I use the class "AudioRecord" and not the "MediaRecorder" (records only to file). Till now, I used a busy loop polling with "read()" for the audio data. this has been working so far, but it peggs the CPU too much. Between two polls, I put the thread to sleep to avoid 100% CPU usage. However, this is not really a clean solution, since the time of the sleep is not guaranteed and you must subtract a

Increase volume output of recorded audio

爷,独闯天下 提交于 2019-12-12 07:10:06
问题 I am trying to make a call recording app in Android. I am using loudspeaker to record both uplink and downlink audio. The only problem I am facing is the volume is too low. I've increased the volume of device using AudioManager to max and it can't go beyond that. I've first used MediaRecorder, but since it had limited functions and provides compressed audio, I've tried with AudioRecorder. Still I havn't figured out how to increase the audio. I've checked on projects on Github too, but it's of

How to disable audio recording apps in Android

霸气de小男生 提交于 2019-12-12 04:47:45
问题 We are developing live streaming video application. So we need to give secure for Audio & Video content. What I am tried I am able to restrict screenshots & video content with help of following code activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); But I can't restrict audio recording through other apps. How to restrict the audio recording by other apps? 回答1: I've never heard of such official tools in Android that would simplify

How to play recorded audio file from 'onActivityResult()'?

二次信任 提交于 2019-12-12 04:35:50
问题 I'm using this library to record audio in my app. Here's my code: recordDefectAudio.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (ContextCompat.checkSelfPermission(getBaseContext(), android.Manifest.permission.RECORD_AUDIO) + ContextCompat.checkSelfPermission(getBaseContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(MainActivity.this, new String[]{android.Manifest

Soundtouch library compile issue

谁说胖子不能爱 提交于 2019-12-11 16:06:15
问题 I am trying to compile Soundtouch library with Android NDK. I successfully installed Cygwin and SWIG required for Soundtouch library. When I try to run ndk-build.cmd, i am getting an error jni/soundtouch/wrapper_wrap.cpp: In function 'void Java_com_talkingyeti_jni2_wrapperJNI_SoundTouch_1putSamples(JNIEnv*, _jclass*, jlong, _jobject*, jlong, jlong)': jni/soundtouch/wrapper_wrap.cpp:545: error: 'SAMPLETYPE' was not declared in this scope jni/soundtouch/wrapper_wrap.cpp:545: error: 'arg2' was

Recorded audio Using AndroidRecord API fails to play

霸气de小男生 提交于 2019-12-11 08:39:46
问题 Am developing an android app that has the feature to record the user speech. For this I have used the AndroidRecord Audio API. Currently the pcm file(recorded audio file - recordedAudio.pcm) getting generated successfully in the sd card. But am not able to play that file. I tried in PC also with windows media palyer and some other players. But nothing helps. Following are my code snippet . private int minBufSize; private AudioRecord recorder; private int sampleRate = 44100; private int

Android: AudioRecord Error code -20 when initializing native AudioRecord object

吃可爱长大的小学妹 提交于 2019-12-10 13:49:49
问题 Android: I want to read buffers from mic so that i can perform process on it, Following is my code int sampleRateInHz = 8000;// 44100, 22050 and 11025 int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO; int audioFormat = AudioFormat.ENCODING_PCM_16BIT; //int bufferSize =11025 + int bufferSize = AudioRecord.getMinBufferSize(sampleRateInHz,channelConfig, audioFormat); short[] buffer = new short[bufferSize]; AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,