diff options
Diffstat (limited to 'src/java/jogamp')
-rw-r--r-- | src/java/jogamp/common/av/JavaSoundAudioSink.java | 14 | ||||
-rw-r--r-- | src/java/jogamp/common/av/NullAudioSink.java | 8 |
2 files changed, 9 insertions, 13 deletions
diff --git a/src/java/jogamp/common/av/JavaSoundAudioSink.java b/src/java/jogamp/common/av/JavaSoundAudioSink.java index bdf4e22..7cd4310 100644 --- a/src/java/jogamp/common/av/JavaSoundAudioSink.java +++ b/src/java/jogamp/common/av/JavaSoundAudioSink.java @@ -262,7 +262,7 @@ public class JavaSoundAudioSink implements AudioSink { written += len; } playImpl(); - return new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), byteBuffer, byteCount); + return new AudioDataFrame(pts, Math.round(1000f*chosenFormat.getBytesDuration(byteCount)), byteBuffer, byteCount); } @Override @@ -276,17 +276,13 @@ public class JavaSoundAudioSink implements AudioSink { } @Override - public int getQueuedTime() { - return getQueuedTimeImpl( getQueuedByteCount() ); - } - private final int getQueuedTimeImpl(final int byteCount) { - final int bytesPerSample = chosenFormat.sampleSize >>> 3; // /8 - return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) ); + public float getQueuedTime() { + return chosenFormat.getBytesDuration( getQueuedByteCount() ); } @Override - public int getAvgFrameDuration() { - return 0; + public float getAvgFrameDuration() { + return 0f; } @Override diff --git a/src/java/jogamp/common/av/NullAudioSink.java b/src/java/jogamp/common/av/NullAudioSink.java index 58f4b0d..ca5e2f4 100644 --- a/src/java/jogamp/common/av/NullAudioSink.java +++ b/src/java/jogamp/common/av/NullAudioSink.java @@ -185,13 +185,13 @@ public class NullAudioSink implements AudioSink { } @Override - public int getQueuedTime() { - return 0; + public float getQueuedTime() { + return 0f; } @Override - public int getAvgFrameDuration() { - return 0; + public float getAvgFrameDuration() { + return 0f; } @Override |