How to fix 'Element Not Found' exception C#

0

I was using NAudio and a timer to get some audio values, and it was working previously but it's now throwing a

'Element not found' exception (Exception from HRESULT: 0x80070490)

from the second line of this code:

NAudio.CoreAudioApi.MMDeviceEnumerator enumerator = new NAudio.CoreAudioApi.MMDeviceEnumerator();
NAudio.CoreAudioApi.MMDevice device = enumerator.GetDefaultAudioEndpoint(NAudio.CoreAudioApi.DataFlow.Render, NAudio.CoreAudioApi.Role.Console);

I can't think of anything I changed in the code. All the references to NAudio are, to my knowledge, present.
What does this exception mean and how can I fix it?

c#
exception
element
asked on Stack Overflow May 22, 2019 by Alice OB • edited May 22, 2019 by Alice OB

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0