[jvr-general] dx.playiottdata() problem

Kevin O'Donnell kevino at jerboa.ca
Sat Mar 5 08:55:14 EST 2005

Hi David,

That's a great bug report - thanks for all of the detail.

I haven't run the code but having looked at your Test.java I see one
possible cause.  You are using DX_XPB.waveFormat() to get the "parameter
block".  If you look at the source code for that method you'll see that
it specifies 11Khz/8bit files.

DX_XPB.waveFormat() is just a convenience function - here's the source
code from dx.java.  Ha ha, I even have a TODO reminder for myself that
this function probably won't work for 8 or 6 KHz files.

public static DX_XPB waveFormat() throws JVRException {
    // TODO: 8bit mono mu-law
    return new DX_XPB(
        dx.DRT_11KHZ,                   <------- this line breaks 6KHz
and 8KHz files

As of JVR 0.5 there is a new function in DX_XPB:

    public static DX_XPB getWavFormat (File file)

It uses the Java Audio Framework to determine the Khz and bits of the
WAV file and return a proper DX_XPB object.  It will also throw an
exception if the WAV file is not supported (22Khz, etc).  (Thanks to
Shawn for the how-to on this one).

dx.playwav() works because the underlying Dialogic C function does the
same thing internally - it reads the WAV file to determine the format.

Let me know if that fixes your problem - If not I'll run the code here
and debug JVR at the JNI layer.


More information about the jvr-general mailing list