我正在致力于说话人识别系统,并试图记录一个声音,并保存在数据库中,以便稍后识别。
disp('Recording stopped.');
y1 = getaudiodata(micrecorder);
y = getaudiodata(micrecorder, 'uint8');
if size(y,2)==2
y=y(:,1);
end
y = double(y);
sound_number = sound_number+1;
data{sound_number,1} = y;
data{sound_number,2} = classe;
data{sound_number,3} = 'Microphone';
data{sound_number,4} = 'Microphone';
st=strcat('u',num2str(sound_number)); %error here
wavwrite(st,y1,samplingfrequency,samplingbits)%error here
save('sound_database.dat','data','sound_number','-append');
msgbox('Sound added to database','Database result','help');
disp('Sound added to database');但是我收到了这个错误:
未定义函数或变量'
wavwrite‘。voicerecognition中的错误(第66行)wavwrite(y1,samplingfrequency,samplingbits,st)
我试图更改为audioread,但我不知道如何改变它的价值。
注意:st用于表示文件名。
发布于 2017-08-11 19:10:00
在MATLAB R2015b中删除wavwrite。您使用的是较晚的版本,因此出现了错误。相当于wavwrite的是audiowrite,而不是audioread。
audiowrite(st,y1,samplingfrequency,'BitsPerSample',samplingbits);https://stackoverflow.com/questions/45638994
复制相似问题