Version
menu_open
link
Wwise SDK 2022.1.12
AkTypes.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 // AkTypes.h
28 
29 /// \file
30 /// Data type definitions.
31 
32 #pragma once
33 
34 #if defined(_GAMING_XBOX_SCARLETT)
35  #if !defined(AK_XBOXSERIESX)
36  #define AK_XBOXSERIESX
37  #endif
38  #define AK_WEM_OPUS_HW_SUPPORTED
39 #elif defined(_GAMING_XBOX_XBOXONE)
40  #if !defined(AK_XBOXONEGC)
41  #define AK_XBOXONEGC
42  #endif
43 #else
44 #error "Unsupported version of Gaming.Xbox platform"
45 #endif
46 
47 
49 
50 #include <limits.h>
51 #include <winapifamily.h>
52 
53 #ifndef __cplusplus
54  #include <wchar.h> // wchar_t not a built-in type in C
55 #endif
56 
57 #if !defined(AK_XBOX)
58  #define AK_XBOX
59 #endif
60 #if !defined(AK_XBOXGC)
61  #define AK_XBOXGC
62 #endif
63 #define AK_HARDWARE_DECODING_SUPPORTED //For XMA
64 #define AK_CPU_X86_64 ///< Compiling for 64-bit x86 CPU
65 
66 #define AK_XMA_SUPPORTED ///< Supports XMA codec
67 #define AK_DVR_BYPASS_SUPPORTED ///< Supports feature which blocks DVRs from recording BGM
68 
69 #define AK_DEVICE_MEMORY_SUPPORTED ///< Supports special memory allocations shared with special hardware co-processors
70 
71 #define AK_XAUDIO2_FLAGS XAUDIO2_DO_NOT_USE_SHAPE
72 
73 #define AK_WASAPI ///< Enable WASAPI sink
74 
75 #define AK_COMM_NO_DYNAMIC_PORTS ///< Platform does not support dynamic/ephemeral ports for communication
76 #define AK_DEVICE_CACHE_SUPPORT ///< Supports output device notifications & cache
77 
78 #define AK_SUPPORT_THREADS
79 #define AK_SUPPORT_WCHAR ///< Can support wchar
80 #define AK_OS_WCHAR ///< Use wchar natively
81 
82 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
83 #define AK_EXPECT_FALSE( _x ) (_x)
84 #define AkForceInline __forceinline ///< Force inlining
85 #define AkNoInline __declspec(noinline) ///< Disable inlining
86 
87 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
88 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
89 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
90 
91 /// These flags define that a given class of SIMD extensions is available.
92 /// Note that runtime checks MUST be done before entering code that explicitly utilizes one of these classes
93 #define AKSIMD_V4F32_SUPPORTED
94 #if defined(_GAMING_XBOX_XBOXONE)
95 #define AKSIMD_AVX_SUPPORTED // AVX supported on XB1
96 #elif defined(_GAMING_XBOX_SCARLETT)
97 #define AKSIMD_AVX_SUPPORTED // AVX supported on Xbox Series X
98 #define AKSIMD_AVX2_SUPPORTED // ..and AVX2 as welll
99 #endif
100 
101 #if defined(_GAMING_XBOX_SCARLETT)
102 #define AK_THREAD_AFFINITY_ALL 16383 // from 0b0011'1111'1111'1111 -- 14 cores available
103 #define AK_THREAD_AFFINITY_DEFAULT 16383 // from 0b0011'1111'1111'1111 -- Default to 14 fully-available cores
104 #elif defined(_GAMING_XBOX_XBOXONE)
105 #define AK_THREAD_AFFINITY_ALL 127 // from 0b0111'1111 -- 7 cores available
106 #define AK_THREAD_AFFINITY_DEFAULT 63 // from 0b0011'1111 -- Default to only 6 fully-available cores. 7th core is half-available.
107 #endif
108 
109 #define AK_DLLEXPORT __declspec(dllexport)
110 #define AK_DLLIMPORT __declspec(dllimport)
111 
112 typedef wchar_t AkOSChar; ///< Generic character string
113 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
114  ///< with the authoring tool.
115 
116 typedef void * AkThread; ///< Thread handle
117 typedef unsigned long AkThreadID; ///< Thread ID
118 typedef unsigned long (__stdcall *AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
119 typedef void * AkEvent; ///< Event handle
120 typedef void * AkSemaphore; ///< Semaphore handle
121 
122 typedef void * AkFileHandle; ///< File handle
123 
124 typedef void* AkStackTrace[ 64 ];
125 
126 #define AK_UINT_MAX UINT_MAX
127 
128 // For strings.
129 #define AK_MAX_PATH 260 ///< Maximum path length.
130 
131 typedef AkUInt32 AkFourcc; ///< Riff chunk
132 
133 /// Create Riff chunk
134 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
135  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
136  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
137 
138 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (2048) ///< Required memory alignment for bank loading by memory address (see LoadBank()); equivalent to SHAPE_XMA_INPUT_BUFFER_ALIGNMENT on XboxOne.
139 
140 #define AK_VM_DEVICE_PAGE_SIZE (64*1024) ///< Page size to be used for device memory. SHAPE_XMA_INPUT_BUFFER_ALIGNMENT wants 2048, but AK_VM_PAGE_SIZE is 65536
141 
142 /// Format for printing AkOSChar string using OutputDebugMsgV
143 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
144 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
145 #define AK_OSCHAR_FMT "%ls"
146 
147 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
148 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into wchar_t strings
149 /// \remark Usage: AKTEXT( "Some Text" )
150 #define AKTEXT(x) L ## x
151 
152 /// Default open should be asyunchronous on Xbox.
153 #define AK_ASYNC_OPEN_DEFAULT (true) ///< Refers to asynchronous file opening in default low-level IO.
154 
155 #define AK_COMM_NO_DYNAMIC_PORTS ///< Debugging ports must be defined in advance in MicrosoftGame.config
156 
157 #define AK_COMM_DISABLE_ON_SUSPEND ///< Platform requires that networking resources be cleaned up on suspend
158 
159 #define AK_WWISE_XMEMALLOC_ALLOCATORID 215 ///< eXALLOCAllocatorId_MiddlewareReservedMin + 23 (...as in "W" for Wwise)
semaphore_t AkEvent
Definition: AkTypes.h:84
int AkThreadID
Definition: AkTypes.h:69
char AkOSChar
Generic character string.
Definition: AkTypes.h:60
FILE * AkFileHandle
File handle.
Definition: AkTypes.h:77
AkUInt16 AkUtf16
Definition: AkTypes.h:61
nn::os::ThreadFunction AkThreadRoutine
Thread routine.
Definition: AkTypes.h:87
int AkThread
Definition: AkTypes.h:68
uint32_t AkUInt32
Unsigned 32-bit integer.
void * AkStackTrace[64]
Definition: AkTypes.h:61
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:84
semaphore_t AkSemaphore
Definition: AkTypes.h:85

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise