Hi,
I have a problem with JavaObject. I construct a new info object out of two existing objects. In Java the equivalent code is working, but my B4J code is not.
In Java the line is:
In B4J I have:
The last line throws the error. Part of the log is here:
### AFInfo: (WaveFileFormat) WAVE (.wav) file, byte length: 176624, data format: PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian, frame length: 44100
### TLClass: interface javax.sound.sampled.SourceDataLine
Error occurred on line: 50 (Main)
java.lang.RuntimeException: Constructor not found.
But on JavaSE8 one valid constructor for DataLine.Info is:
public DataLine.Info(Class<?> lineClass,
AudioFormat format)
Parameters:lineClass - the class of the data line described by the info object , format - desired format
What is wrong????
Thanks for help
Peter
I have a problem with JavaObject. I construct a new info object out of two existing objects. In Java the equivalent code is working, but my B4J code is not.
In Java the line is:
audioFormat is an object with the audio format of my file, and SourceDataLine.class is the object describing lines for playback audio.DataLine.Info info = new DataLine.Info(SourceDataLine.class,
audioFormat);
In B4J I have:
Dim AFInfo As JavaObject
AFInfo = Asys.RunMethod("getAudioFileFormat",Array(F))
Log("### AFInfo: " & AFInfo)
Dim Class1 As JavaObject
Class1.InitializeStatic("java.lang.Class")
Dim TLClass As Object = Class1.RunMethod("forName",Array("javax.sound.sampled.SourceDataLine"))
Log("### TLClass: " & TLClass)
Dim DLInfo As JavaObject
(50:)-> DLInfo.InitializeNewInstance("javax.sound.sampled.DataLine.Info",Array(TLClass,AFInfo))
The last line throws the error. Part of the log is here:
### AFInfo: (WaveFileFormat) WAVE (.wav) file, byte length: 176624, data format: PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian, frame length: 44100
### TLClass: interface javax.sound.sampled.SourceDataLine
Error occurred on line: 50 (Main)
java.lang.RuntimeException: Constructor not found.
But on JavaSE8 one valid constructor for DataLine.Info is:
public DataLine.Info(Class<?> lineClass,
AudioFormat format)
Parameters:lineClass - the class of the data line described by the info object , format - desired format
What is wrong????
Thanks for help
Peter