MP3 playing improved: block read

This commit is contained in:
honfika@gmail.com
2016-12-19 15:00:44 +01:00
parent 080862b91f
commit 13db993f13

View File

@@ -88,6 +88,18 @@ public class MP3Decoder extends SoundDecoder {
return -1;
}
@Override
public int read(byte[] b, int off, int len) throws IOException {
len = Math.min(len, remaining);
if (len > 0) {
System.arraycopy(buf, pos, b, off, len);
remaining -= len;
pos += len;
}
return len;
}
}
public MP3Decoder(SoundFormat soundFormat) {