Skip to content

Commit

Permalink
Mark DirectSoundOut as Windows only and add a .NET 6 target
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed Sep 10, 2022
1 parent 5449b95 commit f31e390
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion NAudio.Core/NAudio.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<Authors>Mark Heath</Authors>
<Version>2.1.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
5 changes: 4 additions & 1 deletion NAudio.Core/Wave/WaveOutputs/DirectSoundOut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ namespace NAudio.Wave
/// Contact author: Alexandre Mutel - alexandre_mutel at yahoo.fr
/// Modified by: Graham "Gee" Plumb
/// </summary>
#if NET5_0_OR_GREATER
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
#endif
public class DirectSoundOut : IWavePlayer
{
/// <summary>
Expand Down Expand Up @@ -69,7 +72,7 @@ private static bool EnumCallback(IntPtr lpGuid, IntPtr lpcstrDescription, IntPtr
device.Guid = new Guid(guidBytes);
}
device.Description = Marshal.PtrToStringAnsi(lpcstrDescription);
if (lpcstrModule != null)
if (lpcstrModule != IntPtr.Zero)
{
device.ModuleName = Marshal.PtrToStringAnsi(lpcstrModule);
}
Expand Down

0 comments on commit f31e390

Please sign in to comment.