Hello,

My application cannot handle the JNIE overhead, as I need to make 2
JNIE calls to the native C/C++ code for every 20msec. So I am trying
to use the native media libraries and the realted C/C++ files provided
by Android in the folder "//external/srec/audio/test" of the donut
build. Ex. AudioHardwareRecord, AudioInRecord etc.. I am implementing
all the calls in the native layer.

I am using the sampling rate as 8000 and want to read 160 samples (320
bytes) at a time.

I used the following values to create the AudioRecord..

record = new android::AudioRecord(
android::AudioRecord::MIC_INPUT, /* Input Source */
sampleRate, /* Sample Rate - 8000 */
android::AudioSystem::PCM_16_BIT, /* Format */
numChannels, /* Channel Count - 1 */
1, /* Frame Count */
android::AudioRecord::RECORD_AGC_ENABLE, /* Flags*/
NULL, /* Callback Function */
NULL, /* Context for use by the callback receiver*/
1 /* Notification Frames */ );

It says "success" after creating this interface but I am getting the
error "Bad Value" if I am doing the InitCheck.

And it is crashing once I start reading the samples or if I try to
retrieve the configured sampling rate.

Has anybody tried to access this native code? Any clue in this regard
will be very helpful.

Thanks in advance.

Vishal

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to