Hi,
I cannot play an audio within a function. for example, if I run the following code in the command window, it works (plays the audio):
DtFl=load(DspFl);x=DtFl.x; Fs=DtFl.Fs;Ply = audioplayer(50*x, Fs);play(Ply)
but if I put the "play" function within another function, nothing happens (no audio play)
function TstAudioPlayclc; clearDspFl='E:\WorkrelatedData\VAGSound\Cntrl1Chn2Dt.mat';DtFl=load(DspFl);x=DtFl.x; Fs=DtFl.Fs;runaudio(x,Fs)function runaudio(x,Fs)Ply = audioplayer(50*x, Fs);play(Ply)
the peculiar thing is that if I put a break point before the "play" function and debud the code, the audio plays well.
Any suggestion?
B
Best Answer