Dear Bytes and all experts,

  I port one voip app(C code) on android platform and using beagle
board. Now, i also have audio problem in play and record
at the same time using AudioTrack.cpp and AudioRecord.cpp.

  I create two threads for audio track and audio record separately.
But record path got pretty bad voice quality. I can not recognize what
i said.
If i play audio track or audio record independently not both, i can
get good voice.

  I create thread with empty while loop and my encode and decode
things will implement in callback function.


android_rec_cb/android_play_cb()
{
   read()/write()
   encode()/decode()
}

thread( )
{
   strm_rec->ar = new android::AudioRecord
(android::AudioRecord::MIC_INPUT,
                                            8000,
 
android::AudioSystem::PCM_16_BIT,
                                            1,
                                            0,
                                            ANDROID_FLAGS,
                                            &android_rec_cb,
                                            (void *) strm_rec,
                            0);
strm_rec->ar->start();
while(condition)
strm_rec->ar->stop();

}

I get this trouble for two weeks.....please help to give me suggestion
on this problem!!!
If you need more info, please let me know!!!!
Thanks and sorry for my bad english

BR,
Duncan

On 11月12日, 下午9時48分, Bytes <[email protected]> wrote:
> Hi PJ,
>
> Thanks for your response.
>
> Now my requirements got changed, even little bit inconsistency in
> voice seems to be OK.
>
> But I've few questions:
>
> 1. Lot of my code is developed in C, and I'm porting it on Android
> using NDK. So I wanna to avaid JNI for every read/write (to process
> the data). For this what I did earlier is,
>
> a. Pulled libmedia.so and its dependent libraries from the device
> (G1),
> b. Used Android source code header files "frameworks/base/libs"
> c. Used AudioRecord.cpp and AudioTrack.cpp present in media/
> libmedia... instead of
>
> android.media.AudioRecord/AudioTrack packages.
>
> Compile and run on the device and voice is acceptable.
>
> As this is out of NDK, is it leagal ? Does Android Market allows this
> approach ?
>
> Thank you very much for your time.
>
> regards
> -Bytes

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to