The following is the exception stack: ===============================================================================
12-09 09:29:03.370: ERROR/MaxMobile(1408): [76:Thread-76] null 12-09 09:29:03.370: ERROR/MaxMobile(1408): java.lang.IllegalStateException: Unable to retrieve AudioRecord pointer for setPositionUpdatePeriod() 12-09 09:29:03.370: ERROR/MaxMobile(1408): at android.media.AudioRecord.native_set_pos_update_period(Native Method) 12-09 09:29:03.370: ERROR/MaxMobile(1408): at android.media.AudioRecord.setPositionNotificationPeriod(AudioRecord.java: 663) 12-09 09:29:03.370: ERROR/MaxMobile(1408): at com.adaptivedigital.voip.VoiceEngineService.initialize(VoiceEngineService.java: 280) 12-09 09:29:03.370: ERROR/MaxMobile(1408): at com.adaptivedigital.voip.VoiceEngineService.run(VoiceEngineService.java: 395) 12-09 09:29:03.370: ERROR/MaxMobile(1408): at java.lang.Thread.run(Thread.java:1096) 12-09 09:29:06.300: WARN/System.err(1408): java.lang.IllegalStateException: Unable to retrieve AudioRecord pointer for setPositionUpdatePeriod() 12-09 09:29:06.300: WARN/System.err(1408): at android.media.AudioRecord.native_set_pos_update_period(Native Method) 12-09 09:29:06.320: WARN/System.err(1408): at android.media.AudioRecord.setPositionNotificationPeriod(AudioRecord.java: 663) 12-09 09:29:06.330: WARN/System.err(1408): at com.adaptivedigital.voip.VoiceEngineService.initialize(VoiceEngineService.java: 280) 12-09 09:29:06.340: WARN/System.err(1408): at com.adaptivedigital.voip.VoiceEngineService.run(VoiceEngineService.java: 395) 12-09 09:29:06.350: WARN/System.err(1408): at java.lang.Thread.run(Thread.java:1096) ============================================================================== Next is the code =============================================================================== audioRecord = new AudioRecord(recordSource,sampleRate,recordFormat,audioEncoding,recordBufferSize); OnRecordPositionUpdateListener positionListener = new OnRecordPositionUpdateListener() { public void onMarkerReached(AudioRecord audioRecord) { // do nothing } public void onPeriodicNotification(AudioRecord audioRecord) { passToStats(FRAME_SIZE); } }; audioRecord.setRecordPositionUpdateListener(positionListener); try{ if (audioRecord.setPositionNotificationPeriod(FRAME_SIZE) != AudioRecord.SUCCESS) Log.e(TAG,"setPositionNotificationPeriod() failure"); }catch (Exception e){ SIPLog.e(e.getCause(), e); e.printStackTrace(); } ================================================================================= When I used the getState method before setPositionNotificationPeriod to judge the state(not mention above), it always returns 0(STATE_UNINITIALIZED ) and continue the judge loop. What is the problem? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en