playing audio from vision.VideoFileReader?

1 view (last 30 days)
karl
karl on 19 Jun 2014
Commented: Sevthia Nugraha on 15 Jul 2018
Question: how do I play audio from vision.VideoFileReader?
I'm using the video acquisition example that comes with computer vision. yet I do not know how to treat the AUDIO that I take from videoSRC. I successfully displayed the video in a gui I made but the audio is simply not cooperating. I think it's because the ShowFrameOnAxis only works with video. I also tried
load AUDIO;
player = audioplayer(y,Fs);
play(player);
That did not work since Audio is a double data stream and not a file...
My code is the following:
videoSrc = vision.VideoFileReader(get(handles.Key,'String'),...
'ImageColorSpace','Intensity',...
'AudioOutputPort', true,...
'AudioOutputDataType', 'double');
while strcmp(get(handles.End,'String'),'End') && ~isDone(videoSrc)
[frameBW, AUDIO] = step(videoSrc);%include audio frame
% step(videoPlayer,frameBW, AUDIO);
frameColor = step(videoSrcColor);
showFrameOnAxis(handles.axis1,frameBW); %axis1 is an axis on my personal gui
end

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!