Hello,

I'm trying to write an audio sink for my application. I am using the
AudioTrack class and it works pretty well. In other words I get the
audio to play correctly (stream mode).

I am using it in C code via the NDK, but that shouldn't matter. The
AudioTrack creation and feeding is done in a separate thread from the
UI.

However, I am having issues with the speed in which it's handling the
AudioTrack.write() call. As you can see in the following traces, it
takes between 50 ms to 70 ms to write 6144 shorts (or 3072 samples).
At 44100 Hz that's almost the duration of the buffer I'm writing ! I
assume that's because all the hardware buffers are used and it's
waiting to write. But I think it should rather exit right away, saying
no buffer was written (like during the pre-roll at the beggining).

I tried another technique, but checking the value returned by
AudioTrack.getPlaybackHeadPosition() to know when the amount I'm
trying to write as been freeed.

-- 
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