[jvr-general] dx.playiottdata() problem
david at voicegenesis.com
david at voicegenesis.com
Mon Mar 7 17:15:51 EST 2005
Hi Kevin,
Thank you for the detailed explanation.
I tried the getWavFormat() method, but that fails
as well. I'm attaching an updated zip archive with
both the Test.java source code and the test.wav
where it won't play.
Incidentaly, I found that the getWavFormat() method
throws a JVRException if the WAV file is exactly
11 KHz. It actually looks for 11.025 KHz, which is
what Windows typically produces anyway. So my sample
code now uses a 11.025 KHz WAV file instead of a
11 KHz WAV.
Thank you very much for looking into this!
- David -
>-- Original Message --
>Date: Sat, 05 Mar 2005 08:55:14 -0500
>From: "Kevin O'Donnell" <kevino at jerboa.ca>
>To: General Mailing list of JVR <jvr-general at threebit.net>
>Subject: Re: [jvr-general] dx.playiottdata() problem
>Reply-To: General Mailing list of JVR <jvr-general at threebit.net>
>
>
>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.FILE_FORMAT_WAVE,
> dx.DRT_11KHZ, <------- this line breaks 6KHz
>and 8KHz files
> 8,
> dx.DATA_FORMAT_PCM
> );
>}
>
>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.
>
>Cheers!
>Kev.
>
>
>_______________________________________________
>jvr-general mailing list
>jvr-general at threebit.net
>http://threebit.net/mailman/listinfo/jvr-general
-------------- next part --------------
A non-text attachment was scrubbed...
Name: playiottdata.zip
Type: application/zip
Size: 17856 bytes
Desc: not available
Url : http://threebit.net/pipermail/jvr-general/attachments/20050307/fbb15483/playiottdata.zip
More information about the jvr-general
mailing list