MATLAB: Error in analoginput/getdata

analoginputerrorgetdatatimeouttriggervarargoutwinsound

I am receiving input from a USB microphone. A loop in my code repeatedly calls
lvl = SLM(AI, Fs, N);
in which there is a line
x = getdata(AI);
that is called.
Everything works fine for the first few iterations of the loop but then I get the following error and warning:
Error using daq.analoginput_winsound_1_127/getdata A timeout occurred during GETDATA.
Error in analoginput/getdata (line 196) varargout{1}=getdata(uddobj,samples,dataformat);
Error in SLM (line 37) x = getdata(AI);
Error event occurred at 12:33:21 for the object: winsound0-AI. A timeout occurred during GETDATA. Warning: Manual trigger with pretrigger before sufficient samples were acquired. Trigger time delayed by 1.#INF seconds.
I'm not sure what is going on here. I would greatly appreciate any help!