HTK file writing parameters problem

1 次查看(过去 30 天)
Peter
Peter 2016-10-29
% 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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Signal Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by