Error with AudioRecord[]: An internal error occurred

I am new to Mathematica and have just started to use its Audio features. When I evaluate

recording = AudioRecord[]  

I get this error message “AudioRecord: An internal error occurred: the file could not be opened.”

What do I need to do to keep from getting this error?

After digging through the Mathematica documention I was able to solve my problem using the following code:

NBDIR = NotebookDirectory[];
SetDirectory[NBDIR];
FILENAME = "rec2.wav";
FE = FileExistsQ[FILENAME];
if[FE, , DeleteFile[FILENAME]];
REC = AudioRecord[$DefaultAudioInputDevice, 
   GeneratedAssetLocation -> FILENAME];
AudioStop[REC];
AudioRecord[REC, MaxDuration -> 5.0]

This

if[FE, , DeleteFile[FILENAME]];

should be

If[FE, DeleteFile[FILENAME]];

WL built-in symbols start with an uppercase letter. Better to avoid using symbol names that start with an uppercase letter to avoid potential conflicts.

I didn’t realize WL built-in symbols always start with an uppercase. So I agree with your suggestion.
Also, thanks for correcting my “If statement”.