Hello all,
A quick newbie question about getting hold of an object implementing
interface from the Java sound API.
The static method AudioSystem/getSourceDataLine returns an object
implementing the SourceDataLine interface.
But the returned object in clojure doesn't seem to fully implement the
interface.
(ns sample.main
(:import (javax.sound.sampled AudioFormat AudioSystem
LineUnavailableException SourceDataLine)
))
(try
(def sourceDataLine (AudioSystem/getSourceDataLine
audioFormat)) ;audioFormat is defined above
(println "sourceDataLine :" sourceDataLine)
(.open sourceDataLine audioFormat)
(catch LineUnavailableException ex
(. ex printStackTrace))
)
outputs: sourceDataLine : #<DirectSDL
com.sun.media.sound.directaudiodevice$direct...@9cb0f4>
sourceDataLine resolve to a DirectSDL object, but apparently does not
fully implement the interface SourceDataLine.
-stack trace:
java.lang.IllegalArgumentException: No matching method found: open
for class com.sun.media.sound.DirectAudioDevice$DirectSDL
-here's interface SourceDataLine:
package javax.sound.sampled;
public abstract interface SourceDataLine extends DataLine
{
public abstract void open(AudioFormat paramAudioFormat, int
paramInt)
throws LineUnavailableException;
public abstract void open(AudioFormat paramAudioFormat)
throws LineUnavailableException;
public abstract int write(byte[] paramArrayOfByte, int paramInt1,
int paramInt2);
}
+ calling the open method without argument works fine
+ a java version of this code works fine
+ a write method isn't implemented either
Is this the expected clojure behavior? or what I am doing wrong?
-Julien
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---