﹏便是晴天ヾ 发表于 2013-11-6 21:05

matlab怎么提取音频

matlab怎么提取音频

madio 发表于 2013-11-7 10:11

使用wavread
Create a WAV file from the example file handel.mat,
and read portions of the file back into MATLAB.% Create WAV file in current folder.
load handel.mat

hfile = 'handel.wav';
wavwrite(y, Fs, hfile)
clear y Fs

% Read the data back into MATLAB, and listen to audio.
= wavread(hfile);
sound(y, Fs);

% Pause before next read and playback operation.
duration = numel(y) / Fs;
pause(duration + 2)

% Read and play only the first 2 seconds.
nsamples = 2 * Fs;
= wavread(hfile, nsamples);
sound(y2, Fs);
pause(4)

% Read and play the middle third of the file.
sizeinfo = wavread(hfile, 'size');

tot_samples = sizeinfo(1);
startpos = tot_samples / 3;
endpos = 2 * startpos;

= wavread(hfile, );
sound(y3, Fs);

陌上,烟雨遥 发表于 2013-12-12 09:54

{:soso_e179:}
页: [1]
查看完整版本: matlab怎么提取音频