I tried the mmreader function to read the frames of a video, at the same time I need the audio of that video. But I cant able to read the audio of the video. Please somebody help me to read the audio data simultaneously with the video frames.
I trie the code given below:
xyloObj = mmreader('xylophone.mpg');nFrames = xyloObj.NumberOfFrames;vidHeight = xyloObj.Height;vidWidth = xyloObj.Width;% Preallocate movie structure.
mov(1:nFrames) = ... struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),... 'colormap', []);% Read one frame at a time.
for k = 1 : nFrames mov(k).cdata = read(xyloObj, k);end% Size a figure based on the video's width and height.
hf = figure;set(hf, 'position', [150 150 vidWidth vidHeight])% Play back the movie once at the video's frame rate.
movie(hf, mov, 1, xyloObj.FrameRate);
Best Answer