我想在电影剪辑中做扬声器和人脸识别,人物的声音和面部也是如此。我无法在MATLAB 7.10 R2010a的.avi文件中读取音频文件。有谁可以帮助我?
答案 0 :(得分:1)
试试这个(来自here):
file = 'filename.avi'
file1 = 'audiofile.wav'
hmfr=video.MultimediaFileReader(file,'AudioOutputPort',true,'VideoOutputPort',false);
hmfw = video.MultimediaFileWriter(file1,'AudioInputPort',true,'VideoInputPort',false,'FileFormat','WAV');
while ~isDone(hmfr)
audioFrame = step(hmfr);
step(hmfw,audioFrame);
end
close(hmfw);
close(hmfr);
audio_samples = wavread(file1);