RECORD.M
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:0k
源码类别:
语音合成与识别
开发平台:
Matlab
- fs = 8000;
- duration = 3;
- fprintf('Hit return to start %g-second recording (be sure to turn off speakers)...n', duration);
- pause;
- fprintf('Start recording ...n');
- y = wavrecord(duration*fs, fs, 'uint8');
- fprintf('Finish %g-second of recording.n', duration);
- y = (double(y)-128)/128;
- wavplay(y, fs, 'sync');
- plot((1:duration*fs)/fs, y);
- filename = 'test.wav';
- wavwrite(y, fs, 8, filename);
- fprintf('The file is save to "%s"n', filename);