如何将.wav文件放在matlab 2010a的avi文件中

时间:2015-05-19 20:08:07

标签: matlab audio

我在matlab 2010a中运行以下代码:

data=wavread('audiofile.wav'); 
writerObj = video.MultimediaFileWriter(aviobj,'AudioInputPort',true,'FileFormat','WAV');

val = size(data,1)/numFrames; 
for k = 1:numFrames % % reading frames from a directory 
    Frame=(imread(strcat('Nyk',num2str(k),'.png'))); % % adding the audio variable in the step function 
    step(writerObj,Frame,data(val*(k-1)+1:valk,:)); % it is 2 channel that is why I have put (:) 
    step(writerObj,Frame,data(val(k-1)+1:val*k)); 
end

% release the video

release(writerObj)

但它给出了以下错误:

  

???使用==>时出错compSetParameters报告   video.MultimediaFileWriter:Filename属性值必须是a   非空字符串。

     

==>中的错误C:\ PROGRAM   FILES \ MATLAB \ R2010a版本\工具箱\ dspblks \ dspblks + signalblks +私人\ MultimediaFileWriterBase.p> MultimediaFileWriterBase.setParameters   在121

     

==>中的错误27岁的电脑   步骤(writerObj,帧,数据(VAL *(K-1)+1:VAL * K,:));它是2通道   这就是为什么我把(:)

问题所在的任何提示?

0 个答案:

没有答案