record.m
资源名称:wavedata.rar [点击查看]
上传用户:ggyh88
上传日期:2013-08-22
资源大小:4174k
文件大小:1k
源码类别:
Audio
开发平台:
Matlab
- %录音程序
- duration = 2;
- fs = 16000;
- nbits = 16;
- format = 'int16';
- waveFile='D:Program FilesMATLAB704workBb'; %录好之后的文件放置的路径
- y = wavrecord(duration*fs, fs, format); % MATLAB中toolbox的audiovideo,如果没有需额外下载
- y = double(y); % Convert from a uint8 to double array
- y = (y-mean(y))/(2^nbits/2); % Make y zero mean and unity maximum
- plot((1:length(y))/fs, y); grid on
- axis([-inf inf -1 1]);
- title(['Wave form of "', waveFile, '"']);
- wavwrite(y, fs, nbits, waveFile); % MATLAB中toolbox的voicebox 如果没有需额外下载
- fprintf('路径是