📄 make.asv
字号:
function make(s)
parad = 4;
threshold = 5000;
inputf1 = [s '.txt'];
inputf2 = [s '.lab'];
name = [s '.wav'];
num = csvread(inputf1);
fid = fopen(inputf2, 'r');
str = fgetl(fid);
count = 0;
tot = 0;
while not(str == -1)
v = findstr(str, 'end_sample');
if (length(v) > 0)
count = count + 1;
y = str2num(str(v(1) + 12 : length(str) - 2));
if (mod(count, 2) == 0)
right(tot) = y;
v = findstr(str, 'ch_char');
sound(tot) = str2num(str(v(1) + 9));
else
tot = tot + 1;
left(tot) = y;f
end
end
str = fgetl(fid);
end
fclose(fid);
tot = tot - 1;
for j = 1 : parad
fid = fopen(['list' num2str(j) '.txt'], 'a');
for k = 1 : tot - j + 1
mark = 1;
result = 0;
if (j > 1)
for r = 0 : j - 2
result = result * 10 + sound(k + r);
if (left(k+r+1) - right(k+r) > threshold)
mark = 0;
break;
end
end
end
result = result * 10 + sound(k + j - 1);
if (mark == 1)
fprintf(fid, '%s %s %s %s \r\n', num2str(result), name, num2str(left(k)), num2str(right(k+j-1)));
end
end
fclose(fid);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -