w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android MediaCodec flush after MediaExtractor seekTo and AudioTrack flush behaviour unexpectedly bad

AudioTrack.flush() is no-op if not paused or stopped.

No-op if not stopped or paused, or if the track's creation mode is not MODE_STREAM.

One solution would be to lower the buffer of the AudioTrack, so the playing of the previously submitted bytes is not perceptible. In my app, I use a rather large size of 32K and it isn't bothersome.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.