MATLAB Answers

HTK file writing parameters problem

3 views (last 30 days)
Peter on 29 Oct 2016
% Open file for writing:
fid = fopen(filename, 'w', 'ieee-be');
% Write the header information%
fwrite(fid, nSamples, 'int32'); % number of vectors in file (4 byteint)
fwrite(fid, sampPeriod, 'int32'); % sample period in 100ns units (4 byte int)
fwrite(fid, sampSize, 'int16'); % number of bytes per sample (2 byte int)
fwrite(fid, parmKind, 'int16'); % code for the sample kind (2 byte int)
% Write the data: one coefficient at a time:
for i = 1:nSamples
for j = 1:numVecHead
fwrite(fid, data(j, i), 'float32');
I have some given code about writing a HTK file, but I am not sure what is the parameter of it. Let's say I am using audiorecorder to record a sound.
r = audiorecorder(16000,16,1);
After I got a audio data (x) from r, what do I need to fill into the parameter of the code?
nSamples, sampPeriod, sampSize, parmKind, numVecHead


Sign in to comment.

Answers (0)

Sign in to answer this question.