There are several causes and fixed for this but this is what worked for me to get Audacity to record normally in Windows 10.
- settings
- privacy
- microphone
- enable "Allow apps to access microphone"
When that setting is off Audacity in Win10 always gives me "Error opening sound device". Soon as I change that setting to Enabled everything works fine.