summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-05-19 07:48:37 +0200
committerSven Gothel <[email protected]>2023-05-19 07:48:37 +0200
commitae301d0f1288b31841e91be8d63a2ab024c2158f (patch)
treec4d351e9d47ad9d42d4a383c9dd57f723ad53ddc /src/java/jogamp
parentb7e6bee3deba4d79cab7d4d82288cf632907faf8 (diff)
AudioSink: Add latency query, init(..) frameDuration in ms shall be int, fix API doc
Diffstat (limited to 'src/java/jogamp')
-rw-r--r--src/java/jogamp/common/av/JavaSoundAudioSink.java13
-rw-r--r--src/java/jogamp/common/av/NullAudioSink.java12
2 files changed, 23 insertions, 2 deletions
diff --git a/src/java/jogamp/common/av/JavaSoundAudioSink.java b/src/java/jogamp/common/av/JavaSoundAudioSink.java
index f5f9eb8..4d89c4d 100644
--- a/src/java/jogamp/common/av/JavaSoundAudioSink.java
+++ b/src/java/jogamp/common/av/JavaSoundAudioSink.java
@@ -123,6 +123,16 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
+ public float getDefaultLatency() {
+ return 20f/1000f; // fake 20ms
+ }
+
+ @Override
+ public float getLatency() {
+ return 20f/1000f; // fake 20ms
+ }
+
+ @Override
public AudioFormat getPreferredFormat() {
return DefaultFormat;
}
@@ -138,7 +148,7 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
- public boolean init(final AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
+ public boolean init(final AudioFormat requestedFormat, final int frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
if( !staticAvailable ) {
return false;
}
@@ -271,4 +281,5 @@ public class JavaSoundAudioSink implements AudioSink {
@Override
public final int getPTS() { return 0; } // FIXME
+
}
diff --git a/src/java/jogamp/common/av/NullAudioSink.java b/src/java/jogamp/common/av/NullAudioSink.java
index 36681bb..7a02af9 100644
--- a/src/java/jogamp/common/av/NullAudioSink.java
+++ b/src/java/jogamp/common/av/NullAudioSink.java
@@ -89,6 +89,16 @@ public class NullAudioSink implements AudioSink {
}
@Override
+ public float getDefaultLatency() {
+ return 0;
+ }
+
+ @Override
+ public float getLatency() {
+ return 0;
+ }
+
+ @Override
public AudioFormat getPreferredFormat() {
return DefaultFormat;
}
@@ -114,7 +124,7 @@ public class NullAudioSink implements AudioSink {
}
@Override
- public boolean init(final AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
+ public boolean init(final AudioFormat requestedFormat, final int frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
chosenFormat = requestedFormat;
return true;
}