HTK file writing parameters problem

1 visualizzazione (ultimi 30 giorni)
Peter
Peter il 29 Ott 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');
end
end
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
Thanks

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by