Results 1 to 1 of 1
Thread: HTK files from Java problem.
- 12-17-2010, 11:15 PM #1Member
- Join Date
- Dec 2010
- Rep Power
HTK files from Java problem.
I am making a Java application that uses HTK recognition.
I need Java to create feature files in HTK format from
certain data that the program handles. So, I need from
Java to create new files and add data to them. I have
a MatLab function that does this I want:
fid = fopen(file,'w','b');
[nf,nv] = size(d);
fwrite(fid,nf,'long'); % write frame count
fwrite(fid,round(fp*1.E7),'long'); % write frame period (in 100 ns units)
nby = nv * 4;
fwrite(fid,nby,'short'); % write byte count
fwrite(fid,tc,'short'); % write type code
fwrite(fid,d.','float'); % write data array
But I need to do that in Java. The function above generates
a file whose data format is IEEE754 floating-point big-endian.
Then, the function adds a header and append the features, where
every variable has its own precission.
I have tried to deploy the function above in Java defining
every variable correspondingly (short, long...) and after,
writing in an output stream the header and features using
the method "floatToIntBits" from "Float" class. This
did not work because HTk does not recognize the resulting files
(as if the file does not have the correct format).
I do not want to use MatLab Builder JA so, what can I do?
Anybody knows how can I deploy it?
Thanks a lot.
- By ron2794 in forum JDBCReplies: 7Last Post: 12-16-2010, 07:58 AM
- By vinay1497 in forum New To JavaReplies: 8Last Post: 07-30-2010, 05:47 PM
- By Questionmark in forum AWT / SwingReplies: 6Last Post: 07-30-2009, 11:23 AM
- By kotturupraveen in forum New To JavaReplies: 2Last Post: 06-09-2008, 12:58 PM
- By unhurt in forum New To JavaReplies: 3Last Post: 11-03-2007, 01:58 PM