mirror of
https://github.com/amerkoleci/Vortice.Win32.git
synced 2026-01-14 08:06:02 +08:00
Improve XAudio2 bindings and add X3DAudio support.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||
<RestoreConfigFile>$(MSBuildThisFileDirectory)NuGet.config</RestoreConfigFile>
|
||||
|
||||
<VersionPrefix>1.9.21</VersionPrefix>
|
||||
<VersionPrefix>1.9.22</VersionPrefix>
|
||||
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
|
||||
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
@@ -2527,6 +2527,11 @@ public static class Program
|
||||
}
|
||||
}
|
||||
|
||||
if (parameterName == "pReserved")
|
||||
{
|
||||
argumentBuilder.Append(" = null");
|
||||
}
|
||||
|
||||
argumentsTypesBuilder.Append(parameterType);
|
||||
argumentsNameBuilder.Append(parameterName);
|
||||
|
||||
@@ -3385,8 +3390,15 @@ public static class Program
|
||||
|
||||
private static bool IsEnum(string typeName)
|
||||
{
|
||||
switch (typeName)
|
||||
{
|
||||
case "Media.Audio.AUDIO_STREAM_CATEGORY":
|
||||
return true;
|
||||
|
||||
default:
|
||||
return s_visitedEnums.Contains(typeName);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsStruct(string typeName)
|
||||
{
|
||||
|
||||
@@ -137,12 +137,12 @@ public unsafe partial struct IXAudio2 : IXAudio2.Interface, INativeGuid
|
||||
/// <include file='../XAudio2.xml' path='doc/member[@name="IXAudio2::CreateMasteringVoice"]/*' />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(7)]
|
||||
public HResult CreateMasteringVoice(IXAudio2MasteringVoice** ppMasteringVoice, uint InputChannels, uint InputSampleRate, uint Flags, ushort* szDeviceId, EffectChain* pEffectChain, Media.Audio.AudioStreamCategory* StreamCategory)
|
||||
public HResult CreateMasteringVoice(IXAudio2MasteringVoice** ppMasteringVoice, uint InputChannels, uint InputSampleRate, uint Flags, ushort* szDeviceId, EffectChain* pEffectChain, Media.Audio.AudioStreamCategory StreamCategory)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return ((delegate* unmanaged<IXAudio2*, IXAudio2MasteringVoice**, uint, uint, uint, ushort*, EffectChain*, Media.Audio.AudioStreamCategory*, int>)(lpVtbl[7]))((IXAudio2*)Unsafe.AsPointer(ref this), ppMasteringVoice, InputChannels, InputSampleRate, Flags, szDeviceId, pEffectChain, StreamCategory);
|
||||
return ((delegate* unmanaged<IXAudio2*, IXAudio2MasteringVoice**, uint, uint, uint, ushort*, EffectChain*, Media.Audio.AudioStreamCategory, int>)(lpVtbl[7]))((IXAudio2*)Unsafe.AsPointer(ref this), ppMasteringVoice, InputChannels, InputSampleRate, Flags, szDeviceId, pEffectChain, StreamCategory);
|
||||
#else
|
||||
return ((delegate* unmanaged[Stdcall]<IXAudio2*, IXAudio2MasteringVoice**, uint, uint, uint, ushort*, EffectChain*, Media.Audio.AudioStreamCategory*, int>)(lpVtbl[7]))((IXAudio2*)Unsafe.AsPointer(ref this), ppMasteringVoice, InputChannels, InputSampleRate, Flags, szDeviceId, pEffectChain, StreamCategory);
|
||||
return ((delegate* unmanaged[Stdcall]<IXAudio2*, IXAudio2MasteringVoice**, uint, uint, uint, ushort*, EffectChain*, Media.Audio.AudioStreamCategory, int>)(lpVtbl[7]))((IXAudio2*)Unsafe.AsPointer(ref this), ppMasteringVoice, InputChannels, InputSampleRate, Flags, szDeviceId, pEffectChain, StreamCategory);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public unsafe partial struct IXAudio2 : IXAudio2.Interface, INativeGuid
|
||||
/// <include file='../XAudio2.xml' path='doc/member[@name="IXAudio2::SetDebugConfiguration"]/*' />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(12)]
|
||||
public void SetDebugConfiguration(DebugConfiguration* pDebugConfiguration, void* pReserved)
|
||||
public void SetDebugConfiguration(DebugConfiguration* pDebugConfiguration, void* pReserved = null)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
((delegate* unmanaged<IXAudio2*, DebugConfiguration*, void*, void>)(lpVtbl[12]))((IXAudio2*)Unsafe.AsPointer(ref this), pDebugConfiguration, pReserved);
|
||||
@@ -221,7 +221,7 @@ public unsafe partial struct IXAudio2 : IXAudio2.Interface, INativeGuid
|
||||
HResult CreateSubmixVoice(IXAudio2SubmixVoice** ppSubmixVoice, uint InputChannels, uint InputSampleRate, uint Flags, uint ProcessingStage, VoiceSends* pSendList, EffectChain* pEffectChain);
|
||||
|
||||
[VtblIndex(7)]
|
||||
HResult CreateMasteringVoice(IXAudio2MasteringVoice** ppMasteringVoice, uint InputChannels, uint InputSampleRate, uint Flags, ushort* szDeviceId, EffectChain* pEffectChain, Media.Audio.AudioStreamCategory* StreamCategory);
|
||||
HResult CreateMasteringVoice(IXAudio2MasteringVoice** ppMasteringVoice, uint InputChannels, uint InputSampleRate, uint Flags, ushort* szDeviceId, EffectChain* pEffectChain, Media.Audio.AudioStreamCategory StreamCategory);
|
||||
|
||||
[VtblIndex(8)]
|
||||
HResult StartEngine();
|
||||
@@ -236,7 +236,7 @@ public unsafe partial struct IXAudio2 : IXAudio2.Interface, INativeGuid
|
||||
void GetPerformanceData(PerformanceData* pPerfData);
|
||||
|
||||
[VtblIndex(12)]
|
||||
void SetDebugConfiguration(DebugConfiguration* pDebugConfiguration, void* pReserved);
|
||||
void SetDebugConfiguration(DebugConfiguration* pDebugConfiguration, void* pReserved = null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
23
src/Vortice.Win32.Media.Audio.XAudio2/X3DAudio/Apis.cs
Normal file
23
src/Vortice.Win32.Media.Audio.XAudio2/X3DAudio/Apis.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
public static unsafe partial class Apis
|
||||
{
|
||||
public static HResult X3DAudioInitialize(uint SpeakerChannelMask, out X3DAudioHandle Instance)
|
||||
{
|
||||
return X3DAudioInitialize(SpeakerChannelMask, X3DAUDIO_SPEED_OF_SOUND, out Instance);
|
||||
}
|
||||
|
||||
public static void X3DAudioCalculate(in X3DAudioHandle Instance, X3DAudioListener* pListener, X3DAudioEmitter* pEmitter, X3DCalculateFlags Flags, X3DAudioDSPSettings* pDSPSettings)
|
||||
{
|
||||
X3DAudioCalculate(Instance, pListener, pEmitter, (uint)Flags, pDSPSettings);
|
||||
}
|
||||
|
||||
[DllImport("xaudio2_9", ExactSpelling = true)]
|
||||
public static extern HResult X3DAudioInitialize(uint SpeakerChannelMask, float SpeedOfSound, out X3DAudioHandle Instance);
|
||||
|
||||
[DllImport("xaudio2_9", ExactSpelling = true)]
|
||||
public static extern void X3DAudioCalculate(in X3DAudioHandle Instance, X3DAudioListener* pListener, X3DAudioEmitter* pEmitter, uint Flags, X3DAudioDSPSettings* pDSPSettings);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
/// <unmanaged>X3DAUDIO_CONE</unmanaged>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public partial struct X3DAudioCone
|
||||
{
|
||||
[NativeTypeName("FLOAT32")]
|
||||
public float InnerAngle;
|
||||
|
||||
[NativeTypeName("FLOAT32")]
|
||||
public float OuterAngle;
|
||||
|
||||
[NativeTypeName("FLOAT32")]
|
||||
public float InnerVolume;
|
||||
|
||||
[NativeTypeName("FLOAT32")]
|
||||
public float OuterVolume;
|
||||
|
||||
[NativeTypeName("FLOAT32")]
|
||||
public float InnerLPF;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
/// <unmanaged>X3DAUDIO_DSP_SETTINGS</unmanaged>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public unsafe partial struct X3DAudioDSPSettings
|
||||
{
|
||||
public float* pMatrixCoefficients;
|
||||
|
||||
public float* pDelayTimes;
|
||||
|
||||
public uint SrcChannelCount;
|
||||
|
||||
public uint DstChannelCount;
|
||||
|
||||
public float LPFDirectCoefficient;
|
||||
|
||||
public float LPFReverbCoefficient;
|
||||
|
||||
public float ReverbLevel;
|
||||
|
||||
public float DopplerFactor;
|
||||
|
||||
public float EmitterToListenerAngle;
|
||||
|
||||
public float EmitterToListenerDistance;
|
||||
|
||||
public float EmitterVelocityComponent;
|
||||
|
||||
public float ListenerVelocityComponent;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
/// <unmanaged>X3DAUDIO_DISTANCE_CURVE</unmanaged>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public unsafe partial struct X3DAudioDistanceCurve
|
||||
{
|
||||
public X3DAudioDistanceCurvePoint* pPoints;
|
||||
|
||||
public uint PointCount;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
/// <unmanaged>X3DAUDIO_DISTANCE_CURVE_POINT</unmanaged>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public unsafe partial struct X3DAudioDistanceCurvePoint
|
||||
{
|
||||
public float Distance;
|
||||
|
||||
public float DSPSetting;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
/// <unmanaged>X3DAUDIO_EMITTER</unmanaged>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public unsafe partial struct X3DAudioEmitter
|
||||
{
|
||||
public X3DAudioCone* pCone;
|
||||
|
||||
public Vector3 OrientFront;
|
||||
|
||||
public Vector3 OrientTop;
|
||||
|
||||
public Vector3 Position;
|
||||
|
||||
public Vector3 Velocity;
|
||||
|
||||
public float InnerRadius;
|
||||
|
||||
public float InnerRadiusAngle;
|
||||
|
||||
public uint ChannelCount;
|
||||
|
||||
public float ChannelRadius;
|
||||
|
||||
public float* pChannelAzimuths;
|
||||
|
||||
public X3DAudioDistanceCurve* pVolumeCurve;
|
||||
|
||||
public X3DAudioDistanceCurve* pLFECurve;
|
||||
|
||||
public X3DAudioDistanceCurve* pLPFDirectCurve;
|
||||
|
||||
public X3DAudioDistanceCurve* pLPFReverbCurve;
|
||||
|
||||
public X3DAudioDistanceCurve* pReverbCurve;
|
||||
|
||||
public float CurveDistanceScaler;
|
||||
|
||||
public float DopplerScaler;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
using static Win32.Media.Audio.XAudio2.Apis;
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = (int)X3DAUDIO_HANDLE_BYTESIZE)]
|
||||
public readonly struct X3DAudioHandle
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
/// <unmanaged>X3DAUDIO_LISTENER</unmanaged>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct X3DAudioListener
|
||||
{
|
||||
public Vector3 OrientFront;
|
||||
|
||||
public Vector3 OrientTop;
|
||||
|
||||
public Vector3 Position;
|
||||
|
||||
public Vector3 Velocity;
|
||||
|
||||
public unsafe X3DAudioCone* pCone;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
using static Win32.Media.Audio.XAudio2.Apis;
|
||||
|
||||
namespace Win32.Media.Audio.XAudio2;
|
||||
|
||||
[Flags]
|
||||
public enum X3DCalculateFlags : uint
|
||||
{
|
||||
None = 0,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_MATRIX</unmanaged>
|
||||
Matrix = X3DAUDIO_CALCULATE_MATRIX,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_DELAY</unmanaged>
|
||||
Delay = X3DAUDIO_CALCULATE_DELAY,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_LPF_DIRECT</unmanaged>
|
||||
LpfDirect = X3DAUDIO_CALCULATE_LPF_DIRECT,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_LPF_REVERB</unmanaged>
|
||||
LpfReverb = X3DAUDIO_CALCULATE_LPF_REVERB,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_REVERB</unmanaged>
|
||||
Reverb = X3DAUDIO_CALCULATE_REVERB,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_DOPPLER</unmanaged>
|
||||
Doppler = X3DAUDIO_CALCULATE_DOPPLER,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_EMITTER_ANGLE</unmanaged>
|
||||
EmitterAngle = X3DAUDIO_CALCULATE_EMITTER_ANGLE,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_ZEROCENTER</unmanaged>
|
||||
ZeroCenter = X3DAUDIO_CALCULATE_ZEROCENTER,
|
||||
/// <unmanaged>X3DAUDIO_CALCULATE_REDIRECT_TO_LFE</unmanaged>
|
||||
RedirectToLfe = X3DAUDIO_CALCULATE_REDIRECT_TO_LFE,
|
||||
}
|
||||
|
||||
|
||||
@@ -418,7 +418,6 @@ See Remarks for more information on volume levels.</param>
|
||||
<para>Changes global debug logging options for XAudio2.</para>
|
||||
<para>Microsoft Docs: <see href="https://docs.microsoft.com/windows/win32/api//xaudio2/nf-xaudio2-ixaudio2-setdebugconfiguration" /></para>
|
||||
<param name="pDebugConfiguration">Pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/xaudio2/ns-xaudio2-xaudio2_debug_configuration">XAUDIO2_DEBUG_CONFIGURATION</a> structure that contains the new debug configuration.</param>
|
||||
<param name="X2DEFAULT">This parameter is reserved and must be NULL.</param>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="IXAudio2::CreateSourceVoice">
|
||||
|
||||
85
src/Vortice.Win32/Media/Audio/Speakers.cs
Normal file
85
src/Vortice.Win32/Media/Audio/Speakers.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32.Media.Audio;
|
||||
|
||||
/// <unmanaged>SPEAKER_FLAGS</unmanaged>
|
||||
/// <unmanaged-short>SPEAKER_FLAGS</unmanaged-short>
|
||||
[Flags]
|
||||
public enum Speakers : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// None value.
|
||||
/// </summary>
|
||||
None = 0,
|
||||
/// <unmanaged>SPEAKER_FRONT_LEFT</unmanaged>
|
||||
FrontLeft = 0x1,
|
||||
/// <unmanaged>SPEAKER_FRONT_RIGHT</unmanaged>
|
||||
FrontRight = 0x2,
|
||||
/// <unmanaged>SPEAKER_FRONT_CENTER</unmanaged>
|
||||
FrontCenter = 0x4,
|
||||
/// <unmanaged>SPEAKER_LOW_FREQUENCY</unmanaged>
|
||||
LowFrequency = 0x4,
|
||||
/// <unmanaged>SPEAKER_BACK_LEFT</unmanaged>
|
||||
BackLeft = 0x10,
|
||||
/// <unmanaged>SPEAKER_BACK_RIGHT</unmanaged>
|
||||
BackRight = 0x20,
|
||||
/// <unmanaged>SPEAKER_FRONT_LEFT_OF_CENTER</unmanaged>
|
||||
FrontLeftOfCenter = 0x40,
|
||||
/// <unmanaged>SPEAKER_FRONT_RIGHT_OF_CENTER</unmanaged>
|
||||
FrontRightOfCenter = 0x80,
|
||||
/// <unmanaged>SPEAKER_BACK_CENTER</unmanaged>
|
||||
BackCenter = 0x100,
|
||||
/// <unmanaged>SPEAKER_SIDE_LEFT</unmanaged>
|
||||
SideLeft = 0x200,
|
||||
/// <unmanaged>SPEAKER_SIDE_RIGHT</unmanaged>
|
||||
SideRight = 0x400,
|
||||
/// <unmanaged>SPEAKER_TOP_CENTER</unmanaged>
|
||||
TopCenter = 0x800,
|
||||
/// <unmanaged>SPEAKER_TOP_FRONT_LEFT</unmanaged>
|
||||
TopFrontLeft = 0x1000,
|
||||
/// <unmanaged>SPEAKER_TOP_FRONT_CENTER</unmanaged>
|
||||
TopFrontCenter = 0x2000,
|
||||
/// <unmanaged>SPEAKER_TOP_FRONT_RIGHT</unmanaged>
|
||||
TopFrontRight = 0x4000,
|
||||
/// <unmanaged>SPEAKER_TOP_BACK_LEFT</unmanaged>
|
||||
TopBackLeft = 0x8000,
|
||||
/// <unmanaged>SPEAKER_TOP_BACK_CENTER</unmanaged>
|
||||
TopBackCenter = 0x10000,
|
||||
/// <unmanaged>SPEAKER_TOP_BACK_RIGHT</unmanaged>
|
||||
TopBackRight = 0x20000,
|
||||
/// <unmanaged>SPEAKER_RESERVED</unmanaged>
|
||||
Reserved = 0x7FFC0000,
|
||||
/// <unmanaged>SPEAKER_ALL</unmanaged>
|
||||
All = 0x80000000,
|
||||
|
||||
[NativeTypeName("#define SPEAKER_MONO SPEAKER_FRONT_CENTER")]
|
||||
Mono = FrontCenter,
|
||||
|
||||
[NativeTypeName("#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)")]
|
||||
Stereo = (FrontLeft | FrontRight),
|
||||
|
||||
[NativeTypeName("#define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY)")]
|
||||
TwoPointOne = (0x00000001 | 0x00000002 | 0x00000008),
|
||||
|
||||
[NativeTypeName("#define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)")]
|
||||
Surround = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000100),
|
||||
|
||||
[NativeTypeName("#define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)")]
|
||||
Quad = (0x00000001 | 0x00000002 | 0x00000010 | 0x00000020),
|
||||
|
||||
[NativeTypeName("#define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)")]
|
||||
FourPointOne = (0x00000001 | 0x00000002 | 0x00000008 | 0x00000010 | 0x00000020),
|
||||
|
||||
[NativeTypeName("#define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)")]
|
||||
FivePointOne = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008 | 0x00000010 | 0x00000020),
|
||||
|
||||
[NativeTypeName("#define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)")]
|
||||
SevenPointOne = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008 | 0x00000010 | 0x00000020 | 0x00000040 | 0x00000080),
|
||||
|
||||
[NativeTypeName("#define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)")]
|
||||
FivePointOneSurround = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008 | 0x00000200 | 0x00000400),
|
||||
|
||||
[NativeTypeName("#define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)")]
|
||||
SevenPointOneSurround = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008 | 0x00000010 | 0x00000020 | 0x00000200 | 0x00000400),
|
||||
}
|
||||
@@ -12,6 +12,7 @@ using Win32.Graphics.Dxgi;
|
||||
using Win32.Graphics.Dxgi.Common;
|
||||
using Win32.Graphics.Imaging;
|
||||
using Win32.Graphics.Imaging.D2D;
|
||||
using Win32.Media.Audio.XAudio2;
|
||||
using static Win32.Apis;
|
||||
using static Win32.Graphics.Direct2D.Apis;
|
||||
using static Win32.Graphics.Direct3D.Dxc.Apis;
|
||||
@@ -19,6 +20,8 @@ using static Win32.Graphics.Direct3D11.Apis;
|
||||
using static Win32.Graphics.DirectWrite.Apis;
|
||||
using static Win32.Graphics.Dxgi.Apis;
|
||||
using static Win32.Graphics.Imaging.D2D.Apis;
|
||||
using static Win32.Media.Audio.XAudio2.Apis;
|
||||
|
||||
using DWriteFactoryType = Win32.Graphics.DirectWrite.FactoryType;
|
||||
using FactoryType = Win32.Graphics.Direct2D.FactoryType;
|
||||
using FeatureLevel = Win32.Graphics.Direct3D.FeatureLevel;
|
||||
@@ -110,6 +113,8 @@ public static unsafe class Program
|
||||
|
||||
public static void Main()
|
||||
{
|
||||
ThrowIfFailed(X3DAudioInitialize(0u, X3DAUDIO_SPEED_OF_SOUND, out X3DAudioHandle handle));
|
||||
|
||||
TestDxc();
|
||||
TestWic();
|
||||
TestD2D1AndDWrite();
|
||||
|
||||
Reference in New Issue
Block a user