Hi,
I am new to the javax.sound package. Need some help.
I am using the following code to get a Clip reference.
Clip clip = AudioSystem.getClip();
This works fine on Windows. But when I run it on our Unix (Sun OS) server, I get the following exception:
java.lang.IllegalArgumentException: No line matching interface Clip supporting format PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian is supported.
at javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:459)
at javax.sound.sampled.AudioSystem.getClip(AudioSystem.java:503)......
I went thru the Javadocs and learnt that this code would search for a Mixer implementation first and then generates the Line (Clip). I am using the same JRE version (1.6.0_12) for both the environments, meaning, the same following Sun implementation:
com.sun.media.sound package in jre/lib/rt.jar
I also tried getting the MixerInfo array explicitly using the following:
Mixer.Info[] mixerInfoArray = AudioSystem.getMixerInfo();
This should return some 9 implementations from the above mentioned package (does so on Windows).
But I get an array of length zero (0) on the Unix server.
I even tried restricting the search by providing the following in jre/lib/sound.properties:
javax.sound.sampled.Clip = com.sun.media.sound.DirectAudioDeviceProvider#DirectClip
My actual aim is to calculate the duration of .wav file. But nothing seems to be working on Unix.
Please help.
Regards,
Arnab