我在录制演讲5秒时遇到了问题。我成功地使用play()函数进行了回放,但是一旦我播放了我在桌面上保存的wav文件,它就是沉默。这是密码
clc,clear;
% Record your voice for 5 seconds.
%recObj = audiorecorder;
recObj = audiorecorder(96000, 16, 1);
disp('Start speaking.')
recordblocking(recObj,5);
disp('End of Recording.');`enter code here`
% Play back the recording.
play(recObj);
myspeech = getaudiodata(recObj,'double');
wavwrite(double(myspeech),'C://Users//naveen//Desktop//unprocessed')
% Store data in double-precision array.
myRecording = getaudiodata(recObj);
% Plot the samples.
figure,plot(myRecording),title('Original Sound');发布于 2014-04-05 18:59:08
使用指定的采样率调用wavwrite,默认为8000 is。
但是,在调用audiorecorder时,录音设置为96000 is。
audiorecorder(96000, 16, 1);将这两项更改为匹配应该解决问题,因此请更改对以下任一项的调用
recObj = audiorecorder(8000, 16, 1)
wavwrite(double(myspeech),96000,'C:/...snip... 另外,我认为myspeech已经是双倍的(如getaudiodata中所指定的),所以wavwrite(myspeech,96000,'C:/...snip...也应该工作得很好!
https://stackoverflow.com/questions/22884592
复制相似问题