I am having a problem retrieving codec output and listing the bytes. Following the Breno/Sparks thread I was able to get past the errors with initializing Audio Record and my code seems to run but I get all 0's as output. I assume I am missing something in AudioRecord.read? I am trying to look at the contents of the byte array (saveBytes) after recording has stopped.
my code looks like this ************************************************************************************************* // tune class (main display) RecordTone.setOnClickListener(new OnClickListener() { public void onClick(View v) { try { // init code recorder ar_test = new AudioRecord (MediaRecorder.AudioSource.MIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, 150000); int status = ar_test.getState(); } catch (IllegalArgumentException e) { e.printStackTrace(); } ar_test.startRecording(); while(bytesRead < 40000){ bytesRead = ar_test.read(saveBytes, 0, 40000); } ar_test.stop(); } } ************************************************************************************************* //display list of codec output arTest = new tune(); String[] arResults = new String[arTest.saveBytes.length]; System.out.println("lgth+"+arTest.saveBytes.length); arResults[0] = "List"; for(int ii=1; ii<arTest.saveBytes.length-1; ii++){ arResults[ii] = Byte.toString(arTest.saveBytes [ii]); } setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, arResults)); final ListView listView = getListView(); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---