When trying to determine when an audioplayer object has finished playing a sound, the following code enters an infinite loop:
aobj = audioplayer(rand(10000,1), 48000, 16, 2);play(aobj);while isplaying(aobj)end
while this code doesn't:
aobj = audioplayer(rand(10000,1), 48000, 16, 2);play(aobj);while isplaying(aobj) pause(0.00001);end
Can somebody explain what's happening? I'm running Matlab 7.13.0.564 (R2011b) on a Mac, OS 10.7.4. Thank you!
Best Answer