Also, be aware that in STREAM mode that sounds won't play until the
buffer is full. If your buffer is bigger than your sound then you have
to write out zero's to finish filling it. In Stream mode you can
certainly write before calling play(), but nothing will play until
that buffer is full. I believe STATIC may operate the same way, and
expects you to allocate a buffer that is the "exact" size (but has to
be over a certain minimum) before it will play correctly.

-niko

On Dec 16, 2:33 pm, niko20 <[email protected]> wrote:
> Hi,
>
> Have you seen any error messages in logcat?
>
> Did you make sure to call getMinBufferSize() before you load the
> Audiotrack, to make sure you are allocating the correct amount of
> buffer?
>
> -niko
>
> On Dec 15, 7:36 pm, MarkNZ <[email protected]> wrote:
>
>
>
> > Hi, I am trying to play a 0.1s tone using audio track. I have done
> > this succesfully in stream mode by calling play() then writing the
> > array of short containing the data. However when I use STATIC mode and
> > also in stream mode if I write the data before i call play() only
> > about 0.06s of the audio is played. I have tried changing the buffer
> > size but this has not effect.
>
> > My understanding is that I have to write the data before I call play
> > for static mode to work. Does anyone know what could be going wrong
> > here?
>
> > Thanks

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