Actually, flush() is for discarding unplayed data. It's not clear at
all from the documentation but if you read the source it becomes
clearer.

Anyway, I found a workaround - a call to Thread.sleep() after flushing
forces the flush to take effect. play() directly after flush() seems
to cancel the flush().

On Aug 26, 11:22 pm, niko20 <nikolatesl...@yahoo.com> wrote:
> You'll have to create a new instance of the AudioTrack I think. Flush
> doesn't erase data, it simply finishes writing out any data that was
> in the internal buffers.
>
> -B
>
> On Aug 26, 4:08 pm, sasq <jonas.minnb...@gmail.com> wrote:
>
>
>
> > I am calling stop(), flush(), start() on my audiotrack when changning
> > songs.
>
> > This seems to only work the first time. After that, playbackposition
> > does not become 0, and in fact all the data queued up from the old
> > song plays until the buffer is drained. This is pretty bad, since I
> > need a large buffer to avoid skipping under heavy CPU load.
>
> > Is this a known problem? Any way around it?
>
> > -- Jonas Minnberg

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

Reply via email to