summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util/av
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/av')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java20
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java16
2 files changed, 28 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
index b1b9c1b6c..85fab96a4 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
@@ -33,7 +33,7 @@ public class JavaSoundAudioSink implements AudioSink {
private int bufferCount;
private byte [] sampleData = new byte[BUFFER_SIZE];
private boolean initialized = false;
- private AudioDataFormat chosenFormat = null;
+ private AudioSink.AudioFormat chosenFormat = null;
private volatile boolean playRequested = false;
private float volume = 1.0f;
@@ -77,14 +77,24 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
- public AudioDataFormat getPreferredFormat() {
+ public AudioSink.AudioFormat getPreferredFormat() {
return DefaultFormat;
}
@Override
- public AudioDataFormat init(AudioDataFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
+ public final int getMaxSupportedChannels() {
+ return 2;
+ }
+
+ @Override
+ public final boolean isSupported(AudioSink.AudioFormat format) {
+ return true;
+ }
+
+ @Override
+ public boolean init(AudioSink.AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
if( !staticAvailable ) {
- return null;
+ return false;
}
// Create the audio format we wish to use
format = new javax.sound.sampled.AudioFormat(requestedFormat.sampleRate, requestedFormat.sampleSize, requestedFormat.channelCount, requestedFormat.signed, !requestedFormat.littleEndian);
@@ -105,7 +115,7 @@ public class JavaSoundAudioSink implements AudioSink {
} catch (Exception e) {
initialized=false;
}
- return chosenFormat;
+ return true;
}
@Override
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
index 83799b074..723bb9dd1 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
@@ -42,13 +42,23 @@ public class NullAudioSink implements AudioSink {
}
@Override
- public AudioDataFormat getPreferredFormat() {
+ public AudioFormat getPreferredFormat() {
return DefaultFormat;
}
@Override
- public AudioDataFormat init(AudioDataFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
- return requestedFormat;
+ public final int getMaxSupportedChannels() {
+ return 8;
+ }
+
+ @Override
+ public final boolean isSupported(AudioFormat format) {
+ return true;
+ }
+
+ @Override
+ public boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
+ return true;
}
@Override