Version
menu_open
link
Wwise SDK 2021.1.14
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  Version: v2021.1.14 Build: 6590
25  Copyright (c) 2006-2023 Audiokinetic Inc.
26 *******************************************************************************/
27 
28 // AkTypes.h
29 
30 /// \file
31 /// Data type definitions.
32 
33 #pragma once
34 
35 #ifdef __PROSPERO__
36 
37 #include <kernel.h>
38 #include <sceconst.h>
39 #include <scetypes.h>
40 #include <sdk_version.h>
41 #include <stddef.h>
42 #include <stdint.h>
43 
44 #define AK_PS5 ///< Compiling for PS5
45 #define AK_SONY ///< Sony platform
46 
47 #define AK_SCE_AJM_SUPPORTED ///< Supports SCE AJM library
48 #define AK_ATRAC9_SUPPORTED ///< Supports ATRAC9 codec
49 #define AK_DVR_BYPASS_SUPPORTED ///< Supports feature which blocks DVRs from recording BGM
50 #define AK_HARDWARE_DECODING_SUPPORTED ///< Supports LEngine callbacks for hardware decoding
51 #define AK_WEM_OPUS_HW_SUPPORTED ///< Supports hardware decoding of WEM Opus codec
52 #define AK_VORBIS_HW_SUPPORTED ///< Supports hardware decoding of Vorbis codec
53 #define AK_DEVICE_MEMORY_SUPPORTED ///< Supports special memory allocations shared with the audio co-processor
54 
55 #define AK_SUPPORT_WCHAR ///< Can support wchar
56 #define AK_71FROM51MIXER ///< Internal use
57 #define AK_71FROMSTEREOMIXER ///< Internal use
58 //#define AK_OS_WCHAR
59 
60 //#define AK_ENABLE_RAZOR_PROFILING
61 
62 #define AK_CPU_X86_64
63 
64 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
65 #define AK_EXPECT_FALSE( _x ) ( _x )
66 #define AkRegister
67 #define AkForceInline inline __attribute__((always_inline)) ///< Force inlining
68 #define AkNoInline __attribute__((noinline))
69 
70 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
71 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
72 
73 #define AK_BUFFER_ALIGNMENT 128 ///< Equal to ACM data alignment, so that we can use any audio buffer as an input/output for ACM processing
74 
75 /// These flags define that a given class of SIMD extensions is available.
76 /// Note that runtime checks MUST be done before entering code that explicitly utilizes one of these classes
77 #define AKSIMD_V4F32_SUPPORTED
78 #define AKSIMD_AVX_SUPPORTED
79 #define AKSIMD_AVX2_SUPPORTED
80 
81 #define AK_DLLEXPORT __declspec(dllexport)
82 #define AK_DLLIMPORT __declspec(dllimport)
83 
84 typedef uint8_t AkUInt8; ///< Unsigned 8-bit integer
85 typedef uint16_t AkUInt16; ///< Unsigned 16-bit integer
86 typedef uint32_t AkUInt32; ///< Unsigned 32-bit integer
87 typedef uint64_t AkUInt64; ///< Unsigned 64-bit integer
88 
89 #ifdef AK_CPU_X86_64
90 typedef int64_t AkIntPtr;
91 typedef uint64_t AkUIntPtr;
92 #else
93 typedef int AkIntPtr;
94 typedef unsigned int AkUIntPtr;
95 #endif
96 
97 typedef int8_t AkInt8; ///< Signed 8-bit integer
98 typedef int16_t AkInt16; ///< Signed 16-bit integer
99 typedef int32_t AkInt32; ///< Signed 32-bit integer
100 typedef int64_t AkInt64; ///< Signed 64-bit integer
101 
102 typedef char AkOSChar; ///< Generic character string
103 
104 typedef float AkReal32; ///< 32-bit floating point
105 typedef double AkReal64; ///< 64-bit floating point
106 
107 typedef ScePthread AkThread; ///< Thread handle
108 typedef ScePthread AkThreadID; ///< Thread ID
109 typedef void* (*AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
110 typedef SceKernelEventFlag AkEvent; ///< Event handle
111 typedef SceKernelSema AkSemaphore; ///< Semaphore handle
112 
113 typedef int AkFileHandle; ///< File handle to be used with sceKernel file system calls
114 
115 #define AK_STACKTRACE_MAX_FRAMES 64
116 typedef uintptr_t AkStackTrace[ AK_STACKTRACE_MAX_FRAMES ];
117 
118 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
119  ///< with the authoring tool.
120 
121 #define AK_UINT_MAX UINT_MAX
122 
123 // For strings.
124 #define AK_MAX_PATH SCE_KERNEL_PATH_MAX ///< Maximum path length (each file/dir name is max 255 char)
125 
126 typedef AkUInt32 AkFourcc; ///< Riff chunk
127 
128 /// Create Riff chunk
129 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
130  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
131  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
132 
133 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (256) ///< Required memory alignment for bank loading by memory address for ATRAC9 (see LoadBank())
134 #define AK_BANK_PLATFORM_DATA_NON_ATRAC9_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address for non-ATRAC9 formats (see LoadBank())
135 
136 #define AK_BANK_PLATFORM_ALLOC_TYPE AkMalloc
137 
138 #define AK_COMM_CONSOLE_TYPE ConsolePS5
139 
140 /// Format for printing AkOSChar string using OutputDebugMsgV
141 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
142 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
143 #define AK_OSCHAR_FMT "%s"
144 
145 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
146 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into Unicode strings
147 /// \remark Usage: AKTEXT( "Some Text" )
148 #define AKTEXT(x) x
149 
150 // easy define for checking for SDK8.00 and its corresponding 12-channel-output support (Atmos)
151 #if (SCE_PROSPERO_SDK_VERSION >= 0x08000026u)
152 #define AK_PROSPERO_SDK_800_OR_LATER true
153 #endif
154 
155 #endif // __PROSPERO__
float AkReal32
32-bit floating point
Definition: AkTypes.h:70
pthread_t AkThread
Thread handle.
Definition: AkTypes.h:73
semaphore_t AkEvent
Definition: AkTypes.h:73
pthread_t AkThreadID
Thread ID.
Definition: AkTypes.h:74
intptr_t AkIntPtr
Definition: AkTypes.h:66
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkTypes.h:57
uintptr_t AkUIntPtr
Definition: AkTypes.h:61
double AkReal64
64-bit floating point
Definition: AkTypes.h:71
char AkOSChar
Generic character string.
Definition: AkTypes.h:68
FILE * AkFileHandle
File handle.
Definition: AkTypes.h:80
AkUInt16 AkUtf16
Definition: AkTypes.h:82
int16_t AkInt16
Signed 16-bit integer.
Definition: AkTypes.h:63
uint64_t AkUInt64
Unsigned 64-bit integer.
Definition: AkTypes.h:60
int8_t AkInt8
Signed 8-bit integer.
Definition: AkTypes.h:62
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition: AkTypes.h:58
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:59
void * AkStackTrace[64]
Definition: AkTypes.h:58
#define AK_STACKTRACE_MAX_FRAMES
Definition: AkTypes.h:106
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:90
int32_t AkInt32
Signed 32-bit integer.
Definition: AkTypes.h:64
semaphore_t AkSemaphore
Definition: AkTypes.h:74
int64_t AkInt64
Signed 64-bit integer.
Definition: AkTypes.h:65

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