android - Cannot access AudioRecorder -
i trying take small recordings find sound pressure level service android wont give me access hardware. following errors in logcat:

the error comes following code:
audiorecord recordinstance = null; // we're important... android.os.process .setthreadpriority(android.os.process.thread_priority_urgent_audio); short buffersize = 4096;// 2048; recordinstance = new audiorecord(mediarecorder.audiosource.mic, //line 167 .getfrequency(), this.getchannelconfiguration(), .getaudioencoding(), buffersize); //object not created tempbuffer = new short[buffersize]; recordinstance.startrecording(); what happens recordinstance never created , when gets end , calls recordinstance.startrecording(), recordinstance still null. android rejects programs request @ definition. know errno's indicate? couldn't find list online.
thanks
check 3 things:
your permissions (you need give permission record_audio)
have run once , not called recordinstance.release()? if may have tied audio resources , not work until restart phone. have found in experience anyway.
3.the buffer size. there static method audiorecord.getminbuffersize()
Comments
Post a Comment