Thanks for your reply, I set the buffer to be exactly twice the length of the array of shorts, and ensure that it is still greater than the min buffer size, but this doesn't seem to change anything. Logcat doesn't contain any errors ...
On Dec 17, 9:35 am, niko20 <nikolatesl...@yahoo.com> wrote: > 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 <nikolatesl...@yahoo.com> 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 <mbutler...@gmail.com> 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 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