Skip to content

Commit

Permalink
updating how to interpret return from IAudioClient.IsFormatSupported …
Browse files Browse the repository at this point in the history
…- see naudio#284
  • Loading branch information
markheath committed Jan 21, 2019
1 parent 5c8183c commit b0c96cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions NAudio/CoreAudioApi/AudioClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,10 @@ public bool IsFormatSupported(AudioClientShareMode shareMode, WaveFormat desired
}
if (hresult == (int)AudioClientErrors.UnsupportedFormat)
{
// Succeeded but the specified format is not supported in exclusive mode.
return shareMode != AudioClientShareMode.Exclusive;
// documentation is confusing as to what this flag means
// https://docs.microsoft.com/en-us/windows/desktop/api/audioclient/nf-audioclient-iaudioclient-isformatsupported
// "Succeeded but the specified format is not supported in exclusive mode."
return false; // shareMode != AudioClientShareMode.Exclusive;
}
Marshal.ThrowExceptionForHR(hresult);
// shouldn't get here
Expand Down

0 comments on commit b0c96cd

Please sign in to comment.