From 2bf39d8e9f9bdcbe548f8bd8acb89def382b467d Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Fri, 26 Feb 2016 18:12:31 -0800 Subject: AudioTrack: docs for getUnderrunCount() Remove unnecessary warning about underruns. Bug: 27384290 Change-Id: Ia872a6580d50952195842c3251370a3dd5da5111 Signed-off-by: Phil Burk --- media/java/android/media/AudioTrack.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java index 6fc2f87ee640..1c669496e070 100644 --- a/media/java/android/media/AudioTrack.java +++ b/media/java/android/media/AudioTrack.java @@ -1190,13 +1190,12 @@ public class AudioTrack implements AudioRouting * An underrun occurs if the application does not write audio * data quickly enough, causing the buffer to underflow * and a potential audio glitch or pop. + *

* Underruns are less likely when buffer sizes are large. - *

Though the "int" type is signed 32-bits, the value should be reinterpreted - * as if it is unsigned 32-bits. - * That is, the next position after 0x7FFFFFFF is (int) 0x80000000. - * This is a continuously advancing counter. It can wrap around to zero - * if there are too many underruns. If there were, for example, 68 underruns per - * second then the counter would wrap in 2 years. + * It may be possible to eliminate underruns by recreating the AudioTrack with + * a larger buffer. + * Or by using {@link #setBufferSizeInFrames(int)} to dynamically increase the + * effective size of the buffer. */ public int getUnderrunCount() { return native_get_underrun_count(); -- cgit v1.2.3-59-g8ed1b