android,codec,pcm,audiorecord,audiotrack
Ok guys, finally I resolved for myself the problem encoding/decoding audio. It's been a annoying task during the last week. The main problem of my code was the encoding was well done but the decoding wasn't so I was working around it and modify these class with the help of...
This looks like a concurrency problem. It seems that after the check myRecorder != null, the variable is actually set to null in a different thread, which is possible because as you probably know threads run in parallel. I'd recommend you lock on the object and execute your loop. Then,...
android,audio-recording,audiorecord
Here, this is my code, which work for me: public class MainActivity extends Activity { AudioRecord record = null; AudioTrack track = null; boolean isRecording; int sampleRate = 44100; Button startRecord, stopRecord, playRecord = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setVolumeControlStream(AudioManager.MODE_IN_COMMUNICATION); startRecord = (Button) findViewById(R.id.start_recording); stopRecord =...
android,audio-recording,rtp,audiorecord
I solved this problem using RtpSocket and RtpPacket classes from SipDroid. Example for the usage is also in the RtpStreamSender and RtpStreamReceiver classes....
I have got the solution of this. I created a wave file added default headers before starting the recording and after the recording is finished i am adding the payload to the header.
android,audio-recording,audiorecord
The data depends on the parameters you sent to the constructor. AudioRecord (int audioSource, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeInBytes) sampleRateInHz is the number of samples per second. channel config is either MONO or STEREO meaning 1 or 2 channels. format is PCM8 or PCM16 meaning 8 bits...
android,case-sensitive,android-permissions,audiorecord
After a lot of hours, I finally figured out the problem. If you use the autocomplete feature of Android Studio and type <uses-permission android:name="RECORD_AUDIO" /> followed by enter, Android Studio will fill in <uses-permission android:name="ANDROID.PERMISSION.RECORD_AUDIO" /> This, however does not work, since case apparently matters. No warnings, nothing. After I...
android,audio-streaming,audiorecord,android-audiorecord,audiotrack
Ok solved, it's all about the sample rate and the buffer size.
android,mediarecorder,android-mediarecorder,audiorecord,android-audiorecord
It's quite likely that the real problem is that his microphone is overdriving the input jack - if that is the case, software can't fix the problem as what the A/D converter sees is already hopelessly distorted. Your client may need to add an attenuator (resistive voltage divider) to the...
android,exception,memory,out,audiorecord
The solution was destroying (and releasing) the AudioRecord object on every pause and just recreating it on each start.
java,android,sampling,audiorecord
You could check if 44100 is supported by your device. Android does not provide an explicit method to check it but there is a work-around with AudioRecord class' getMinBufferSize function. public void getValidSampleRates() { for (int rate : new int[] {8000, 11025, 16000, 22050, 44100}) { // add the rates...
java,android,audio,audio-recording,audiorecord
Although i did not find answer of my question, but now i am using technique for recording aspects which i want to share with all of you. Above function which i try to use is totally wrong option when you are trying to save music created by your app at...
android,audiorecord,android-audiorecord
Sadly, only one app at a time can access the microphone (just like the camera). Also, there is no standard way to inform another app that you want access to the microphone (so that they release the resources and let you access it). You could however send a broadcast to...
Your problem may be caused by not releasing the audiorecord after each use. To solve your problem, you may follow those steps: Restart you phone and do not run anything when it start Add code to release your audiorecord somewhere that you want to stop, e.g. onPause(). audiorecord.stop(); audiorecord.release(); Run...
android,multithreading,handler,audiorecord,android-handlerthread
To associate Handler with a certain thread, you should create it by passing corresponding Looper in its constructor. So, if you already have a HandlerThread it can be done in the following way: Looper looper = myHandlerThread.getLooper(); Handler handler = new Handler(looper); And that's it, just use this handler in...