| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#ifndef miniaudio_h |
| 12 |
#define miniaudio_h |
| 13 |
|
| 14 |
#ifdef __cplusplus |
| 15 |
extern "C" { |
| 16 |
#endif |
| 17 |
|
| 18 |
#define MA_STRINGIFY(x) #x |
| 19 |
#define MA_XSTRINGIFY(x) MA_STRINGIFY(x) |
| 20 |
|
| 21 |
#define MA_VERSION_MAJOR 0 |
| 22 |
#define MA_VERSION_MINOR 11 |
| 23 |
#define MA_VERSION_REVISION 25 |
| 24 |
#define MA_VERSION_STRING MA_XSTRINGIFY(MA_VERSION_MAJOR) "." MA_XSTRINGIFY(MA_VERSION_MINOR) "." MA_XSTRINGIFY(MA_VERSION_REVISION) |
| 25 |
|
| 26 |
#if defined(_MSC_VER) && !defined(__clang__) |
| 27 |
#pragma warning(push) |
| 28 |
#pragma warning(disable:4201) |
| 29 |
#pragma warning(disable:4214) |
| 30 |
#pragma warning(disable:4324) |
| 31 |
#elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) |
| 32 |
#pragma GCC diagnostic push |
| 33 |
#pragma GCC diagnostic ignored "-Wpedantic" |
| 34 |
#if defined(__clang__) |
| 35 |
#pragma GCC diagnostic ignored "-Wc11-extensions" |
| 36 |
#endif |
| 37 |
#endif |
| 38 |
|
| 39 |
|
| 40 |
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(_M_ARM64) || defined(__powerpc64__) || defined(__ppc64__) |
| 41 |
#define MA_SIZEOF_PTR 8 |
| 42 |
#else |
| 43 |
#define MA_SIZEOF_PTR 4 |
| 44 |
#endif |
| 45 |
|
| 46 |
#include <stddef.h> |
| 47 |
|
| 48 |
|
| 49 |
#if defined(MA_USE_STDINT) |
| 50 |
#include <stdint.h> |
| 51 |
typedef int8_t ma_int8; |
| 52 |
typedef uint8_t ma_uint8; |
| 53 |
typedef int16_t ma_int16; |
| 54 |
typedef uint16_t ma_uint16; |
| 55 |
typedef int32_t ma_int32; |
| 56 |
typedef uint32_t ma_uint32; |
| 57 |
typedef int64_t ma_int64; |
| 58 |
typedef uint64_t ma_uint64; |
| 59 |
#else |
| 60 |
typedef signed char ma_int8; |
| 61 |
typedef unsigned char ma_uint8; |
| 62 |
typedef signed short ma_int16; |
| 63 |
typedef unsigned short ma_uint16; |
| 64 |
typedef signed int ma_int32; |
| 65 |
typedef unsigned int ma_uint32; |
| 66 |
#if defined(_MSC_VER) && !defined(__clang__) |
| 67 |
typedef signed __int64 ma_int64; |
| 68 |
typedef unsigned __int64 ma_uint64; |
| 69 |
#else |
| 70 |
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) |
| 71 |
#pragma GCC diagnostic push |
| 72 |
#pragma GCC diagnostic ignored "-Wlong-long" |
| 73 |
#if defined(__clang__) |
| 74 |
#pragma GCC diagnostic ignored "-Wc++11-long-long" |
| 75 |
#endif |
| 76 |
#endif |
| 77 |
typedef signed long long ma_int64; |
| 78 |
typedef unsigned long long ma_uint64; |
| 79 |
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) |
| 80 |
#pragma GCC diagnostic pop |
| 81 |
#endif |
| 82 |
#endif |
| 83 |
#endif |
| 84 |
|
| 85 |
#if MA_SIZEOF_PTR == 8 |
| 86 |
typedef ma_uint64 ma_uintptr; |
| 87 |
#else |
| 88 |
typedef ma_uint32 ma_uintptr; |
| 89 |
#endif |
| 90 |
|
| 91 |
typedef ma_uint8 ma_bool8; |
| 92 |
typedef ma_uint32 ma_bool32; |
| 93 |
#define MA_TRUE 1 |
| 94 |
#define MA_FALSE 0 |
| 95 |
|
| 96 |
|
| 97 |
typedef float ma_float; |
| 98 |
typedef double ma_double; |
| 99 |
|
| 100 |
typedef void* ma_handle; |
| 101 |
typedef void* ma_ptr; |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
#if defined(__GNUC__) |
| 110 |
typedef void (*ma_proc)(void); |
| 111 |
#else |
| 112 |
typedef void* ma_proc; |
| 113 |
#endif |
| 114 |
|
| 115 |
#if defined(_MSC_VER) && !defined(_WCHAR_T_DEFINED) |
| 116 |
typedef ma_uint16 wchar_t; |
| 117 |
#endif |
| 118 |
|
| 119 |
|
| 120 |
#ifndef NULL |
| 121 |
#define NULL 0 |
| 122 |
#endif |
| 123 |
|
| 124 |
#if defined(SIZE_MAX) |
| 125 |
#define MA_SIZE_MAX SIZE_MAX |
| 126 |
#else |
| 127 |
#define MA_SIZE_MAX 0xFFFFFFFF |
| 128 |
#endif |
| 129 |
|
| 130 |
#define MA_UINT64_MAX (((ma_uint64)0xFFFFFFFF << 32) | (ma_uint64)0xFFFFFFFF) |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
#if defined(_WIN32) |
| 135 |
#define MA_WIN32 |
| 136 |
#if defined(MA_FORCE_UWP) || (defined(WINAPI_FAMILY) && ((defined(WINAPI_FAMILY_PC_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) || (defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP))) |
| 137 |
#define MA_WIN32_UWP |
| 138 |
#elif defined(WINAPI_FAMILY) && (defined(WINAPI_FAMILY_GAMES) && WINAPI_FAMILY == WINAPI_FAMILY_GAMES) |
| 139 |
#define MA_WIN32_GDK |
| 140 |
#elif defined(NXDK) |
| 141 |
#define MA_WIN32_NXDK |
| 142 |
#else |
| 143 |
#define MA_WIN32_DESKTOP |
| 144 |
#endif |
| 145 |
|
| 146 |
|
| 147 |
#if defined(NXDK) |
| 148 |
#define MA_XBOX |
| 149 |
|
| 150 |
#if defined(NXDK) |
| 151 |
#define MA_XBOX_NXDK |
| 152 |
#endif |
| 153 |
#endif |
| 154 |
#endif |
| 155 |
#if defined(__MSDOS__) || defined(MSDOS) || defined(_MSDOS) || defined(__DOS__) |
| 156 |
#define MA_DOS |
| 157 |
|
| 158 |
|
| 159 |
#ifndef MA_NO_THREADING |
| 160 |
#define MA_NO_THREADING |
| 161 |
#endif |
| 162 |
|
| 163 |
|
| 164 |
#ifndef MA_NO_RUNTIME_LINKING |
| 165 |
#define MA_NO_RUNTIME_LINKING |
| 166 |
#endif |
| 167 |
#endif |
| 168 |
#if !defined(MA_WIN32) && !defined(MA_DOS) |
| 169 |
#define MA_POSIX |
| 170 |
|
| 171 |
#if !defined(MA_NO_THREADING) |
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
#ifndef MA_NO_PTHREAD_IN_HEADER |
| 180 |
#include <pthread.h> |
| 181 |
typedef pthread_t ma_pthread_t; |
| 182 |
typedef pthread_mutex_t ma_pthread_mutex_t; |
| 183 |
typedef pthread_cond_t ma_pthread_cond_t; |
| 184 |
#else |
| 185 |
typedef ma_uintptr ma_pthread_t; |
| 186 |
typedef union ma_pthread_mutex_t { char __data[40]; ma_uint64 __alignment; } ma_pthread_mutex_t; |
| 187 |
typedef union ma_pthread_cond_t { char __data[48]; ma_uint64 __alignment; } ma_pthread_cond_t; |
| 188 |
#endif |
| 189 |
#endif |
| 190 |
|
| 191 |
#if defined(__unix__) |
| 192 |
#define MA_UNIX |
| 193 |
#endif |
| 194 |
#if defined(__linux__) |
| 195 |
#define MA_LINUX |
| 196 |
#endif |
| 197 |
#if defined(__APPLE__) |
| 198 |
#define MA_APPLE |
| 199 |
#endif |
| 200 |
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) |
| 201 |
#define MA_BSD |
| 202 |
#endif |
| 203 |
#if defined(__ANDROID__) |
| 204 |
#define MA_ANDROID |
| 205 |
#endif |
| 206 |
#if defined(__EMSCRIPTEN__) |
| 207 |
#define MA_EMSCRIPTEN |
| 208 |
#endif |
| 209 |
#if defined(__ORBIS__) |
| 210 |
#define MA_ORBIS |
| 211 |
#endif |
| 212 |
#if defined(__PROSPERO__) |
| 213 |
#define MA_PROSPERO |
| 214 |
#endif |
| 215 |
#if defined(__3DS__) |
| 216 |
#define MA_3DS |
| 217 |
#endif |
| 218 |
#if defined(__SWITCH__) || defined(__NX__) |
| 219 |
#define MA_SWITCH |
| 220 |
#endif |
| 221 |
#if defined(__BEOS__) || defined(__HAIKU__) |
| 222 |
#define MA_BEOS |
| 223 |
#endif |
| 224 |
#if defined(__HAIKU__) |
| 225 |
#define MA_HAIKU |
| 226 |
#endif |
| 227 |
#endif |
| 228 |
|
| 229 |
#if !defined(MA_FALLTHROUGH) && defined(__cplusplus) && __cplusplus >= 201703L |
| 230 |
#define MA_FALLTHROUGH [[fallthrough]] |
| 231 |
#endif |
| 232 |
#if !defined(MA_FALLTHROUGH) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L |
| 233 |
#define MA_FALLTHROUGH [[fallthrough]] |
| 234 |
#endif |
| 235 |
#if !defined(MA_FALLTHROUGH) && defined(__has_attribute) |
| 236 |
#if __has_attribute(fallthrough) |
| 237 |
#define MA_FALLTHROUGH __attribute__((fallthrough)) |
| 238 |
#endif |
| 239 |
#endif |
| 240 |
#if !defined(MA_FALLTHROUGH) |
| 241 |
#define MA_FALLTHROUGH ((void)0) |
| 242 |
#endif |
| 243 |
|
| 244 |
#ifdef _MSC_VER |
| 245 |
#define MA_INLINE __forceinline |
| 246 |
|
| 247 |
|
| 248 |
#if _MSC_VER >= 1400 |
| 249 |
#define MA_NO_INLINE __declspec(noinline) |
| 250 |
#else |
| 251 |
#define MA_NO_INLINE |
| 252 |
#endif |
| 253 |
#elif defined(__GNUC__) |
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
#if defined(__STRICT_ANSI__) |
| 262 |
#define MA_GNUC_INLINE_HINT __inline__ |
| 263 |
#else |
| 264 |
#define MA_GNUC_INLINE_HINT inline |
| 265 |
#endif |
| 266 |
|
| 267 |
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) || defined(__clang__) |
| 268 |
#define MA_INLINE MA_GNUC_INLINE_HINT __attribute__((always_inline)) |
| 269 |
#define MA_NO_INLINE __attribute__((noinline)) |
| 270 |
#else |
| 271 |
#define MA_INLINE MA_GNUC_INLINE_HINT |
| 272 |
#define MA_NO_INLINE |
| 273 |
#endif |
| 274 |
#elif defined(__WATCOMC__) |
| 275 |
#define MA_INLINE __inline |
| 276 |
#define MA_NO_INLINE |
| 277 |
#else |
| 278 |
#define MA_INLINE |
| 279 |
#define MA_NO_INLINE |
| 280 |
#endif |
| 281 |
|
| 282 |
|
| 283 |
#if defined(MA_DLL) |
| 284 |
#if defined(_WIN32) |
| 285 |
#define MA_DLL_IMPORT __declspec(dllimport) |
| 286 |
#define MA_DLL_EXPORT __declspec(dllexport) |
| 287 |
#define MA_DLL_PRIVATE static |
| 288 |
#else |
| 289 |
#if defined(__GNUC__) && __GNUC__ >= 4 |
| 290 |
#define MA_DLL_IMPORT __attribute__((visibility("default"))) |
| 291 |
#define MA_DLL_EXPORT __attribute__((visibility("default"))) |
| 292 |
#define MA_DLL_PRIVATE __attribute__((visibility("hidden"))) |
| 293 |
#else |
| 294 |
#define MA_DLL_IMPORT |
| 295 |
#define MA_DLL_EXPORT |
| 296 |
#define MA_DLL_PRIVATE static |
| 297 |
#endif |
| 298 |
#endif |
| 299 |
#endif |
| 300 |
|
| 301 |
#if !defined(MA_API) |
| 302 |
#if defined(MA_DLL) |
| 303 |
#if defined(MINIAUDIO_IMPLEMENTATION) || defined(MA_IMPLEMENTATION) |
| 304 |
#define MA_API MA_DLL_EXPORT |
| 305 |
#else |
| 306 |
#define MA_API MA_DLL_IMPORT |
| 307 |
#endif |
| 308 |
#else |
| 309 |
#define MA_API extern |
| 310 |
#endif |
| 311 |
#endif |
| 312 |
|
| 313 |
#if !defined(MA_STATIC) |
| 314 |
#if defined(MA_DLL) |
| 315 |
#define MA_PRIVATE MA_DLL_PRIVATE |
| 316 |
#else |
| 317 |
#define MA_PRIVATE static |
| 318 |
#endif |
| 319 |
#endif |
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
#define MA_SIMD_ALIGNMENT 32 |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
#if !defined(MA_POSIX) && defined(MA_WIN32) |
| 334 |
typedef wchar_t ma_wchar_win32; |
| 335 |
#else |
| 336 |
typedef ma_uint16 ma_wchar_win32; |
| 337 |
#endif |
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
typedef enum |
| 366 |
{ |
| 367 |
MA_LOG_LEVEL_DEBUG = 4, |
| 368 |
MA_LOG_LEVEL_INFO = 3, |
| 369 |
MA_LOG_LEVEL_WARNING = 2, |
| 370 |
MA_LOG_LEVEL_ERROR = 1 |
| 371 |
} ma_log_level; |
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
#if !defined(_MSC_VER) && defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) |
| 385 |
#include <stdalign.h> |
| 386 |
#define MA_ATOMIC(alignment, type) _Alignas(alignment) type |
| 387 |
#else |
| 388 |
#if defined(__GNUC__) |
| 389 |
|
| 390 |
#define MA_ATOMIC(alignment, type) type __attribute__((aligned(alignment))) |
| 391 |
#elif defined(_MSC_VER) && _MSC_VER > 1200 |
| 392 |
|
| 393 |
#define MA_ATOMIC(alignment, type) __declspec(align(alignment)) type |
| 394 |
#else |
| 395 |
|
| 396 |
#define MA_ATOMIC(alignment, type) type |
| 397 |
#endif |
| 398 |
#endif |
| 399 |
|
| 400 |
typedef struct ma_context ma_context; |
| 401 |
typedef struct ma_device ma_device; |
| 402 |
|
| 403 |
typedef ma_uint8 ma_channel; |
| 404 |
typedef enum |
| 405 |
{ |
| 406 |
MA_CHANNEL_NONE = 0, |
| 407 |
MA_CHANNEL_MONO = 1, |
| 408 |
MA_CHANNEL_FRONT_LEFT = 2, |
| 409 |
MA_CHANNEL_FRONT_RIGHT = 3, |
| 410 |
MA_CHANNEL_FRONT_CENTER = 4, |
| 411 |
MA_CHANNEL_LFE = 5, |
| 412 |
MA_CHANNEL_BACK_LEFT = 6, |
| 413 |
MA_CHANNEL_BACK_RIGHT = 7, |
| 414 |
MA_CHANNEL_FRONT_LEFT_CENTER = 8, |
| 415 |
MA_CHANNEL_FRONT_RIGHT_CENTER = 9, |
| 416 |
MA_CHANNEL_BACK_CENTER = 10, |
| 417 |
MA_CHANNEL_SIDE_LEFT = 11, |
| 418 |
MA_CHANNEL_SIDE_RIGHT = 12, |
| 419 |
MA_CHANNEL_TOP_CENTER = 13, |
| 420 |
MA_CHANNEL_TOP_FRONT_LEFT = 14, |
| 421 |
MA_CHANNEL_TOP_FRONT_CENTER = 15, |
| 422 |
MA_CHANNEL_TOP_FRONT_RIGHT = 16, |
| 423 |
MA_CHANNEL_TOP_BACK_LEFT = 17, |
| 424 |
MA_CHANNEL_TOP_BACK_CENTER = 18, |
| 425 |
MA_CHANNEL_TOP_BACK_RIGHT = 19, |
| 426 |
MA_CHANNEL_AUX_0 = 20, |
| 427 |
MA_CHANNEL_AUX_1 = 21, |
| 428 |
MA_CHANNEL_AUX_2 = 22, |
| 429 |
MA_CHANNEL_AUX_3 = 23, |
| 430 |
MA_CHANNEL_AUX_4 = 24, |
| 431 |
MA_CHANNEL_AUX_5 = 25, |
| 432 |
MA_CHANNEL_AUX_6 = 26, |
| 433 |
MA_CHANNEL_AUX_7 = 27, |
| 434 |
MA_CHANNEL_AUX_8 = 28, |
| 435 |
MA_CHANNEL_AUX_9 = 29, |
| 436 |
MA_CHANNEL_AUX_10 = 30, |
| 437 |
MA_CHANNEL_AUX_11 = 31, |
| 438 |
MA_CHANNEL_AUX_12 = 32, |
| 439 |
MA_CHANNEL_AUX_13 = 33, |
| 440 |
MA_CHANNEL_AUX_14 = 34, |
| 441 |
MA_CHANNEL_AUX_15 = 35, |
| 442 |
MA_CHANNEL_AUX_16 = 36, |
| 443 |
MA_CHANNEL_AUX_17 = 37, |
| 444 |
MA_CHANNEL_AUX_18 = 38, |
| 445 |
MA_CHANNEL_AUX_19 = 39, |
| 446 |
MA_CHANNEL_AUX_20 = 40, |
| 447 |
MA_CHANNEL_AUX_21 = 41, |
| 448 |
MA_CHANNEL_AUX_22 = 42, |
| 449 |
MA_CHANNEL_AUX_23 = 43, |
| 450 |
MA_CHANNEL_AUX_24 = 44, |
| 451 |
MA_CHANNEL_AUX_25 = 45, |
| 452 |
MA_CHANNEL_AUX_26 = 46, |
| 453 |
MA_CHANNEL_AUX_27 = 47, |
| 454 |
MA_CHANNEL_AUX_28 = 48, |
| 455 |
MA_CHANNEL_AUX_29 = 49, |
| 456 |
MA_CHANNEL_AUX_30 = 50, |
| 457 |
MA_CHANNEL_AUX_31 = 51, |
| 458 |
|
| 459 |
|
| 460 |
MA_CHANNEL_POSITION_COUNT, |
| 461 |
|
| 462 |
|
| 463 |
MA_CHANNEL_LEFT = MA_CHANNEL_FRONT_LEFT, |
| 464 |
MA_CHANNEL_RIGHT = MA_CHANNEL_FRONT_RIGHT, |
| 465 |
} _ma_channel_position; |
| 466 |
|
| 467 |
typedef enum |
| 468 |
{ |
| 469 |
MA_SUCCESS = 0, |
| 470 |
MA_ERROR = -1, |
| 471 |
MA_INVALID_ARGS = -2, |
| 472 |
MA_INVALID_OPERATION = -3, |
| 473 |
MA_OUT_OF_MEMORY = -4, |
| 474 |
MA_OUT_OF_RANGE = -5, |
| 475 |
MA_ACCESS_DENIED = -6, |
| 476 |
MA_DOES_NOT_EXIST = -7, |
| 477 |
MA_ALREADY_EXISTS = -8, |
| 478 |
MA_TOO_MANY_OPEN_FILES = -9, |
| 479 |
MA_INVALID_FILE = -10, |
| 480 |
MA_TOO_BIG = -11, |
| 481 |
MA_PATH_TOO_LONG = -12, |
| 482 |
MA_NAME_TOO_LONG = -13, |
| 483 |
MA_NOT_DIRECTORY = -14, |
| 484 |
MA_IS_DIRECTORY = -15, |
| 485 |
MA_DIRECTORY_NOT_EMPTY = -16, |
| 486 |
MA_AT_END = -17, |
| 487 |
MA_NO_SPACE = -18, |
| 488 |
MA_BUSY = -19, |
| 489 |
MA_IO_ERROR = -20, |
| 490 |
MA_INTERRUPT = -21, |
| 491 |
MA_UNAVAILABLE = -22, |
| 492 |
MA_ALREADY_IN_USE = -23, |
| 493 |
MA_BAD_ADDRESS = -24, |
| 494 |
MA_BAD_SEEK = -25, |
| 495 |
MA_BAD_PIPE = -26, |
| 496 |
MA_DEADLOCK = -27, |
| 497 |
MA_TOO_MANY_LINKS = -28, |
| 498 |
MA_NOT_IMPLEMENTED = -29, |
| 499 |
MA_NO_MESSAGE = -30, |
| 500 |
MA_BAD_MESSAGE = -31, |
| 501 |
MA_NO_DATA_AVAILABLE = -32, |
| 502 |
MA_INVALID_DATA = -33, |
| 503 |
MA_TIMEOUT = -34, |
| 504 |
MA_NO_NETWORK = -35, |
| 505 |
MA_NOT_UNIQUE = -36, |
| 506 |
MA_NOT_SOCKET = -37, |
| 507 |
MA_NO_ADDRESS = -38, |
| 508 |
MA_BAD_PROTOCOL = -39, |
| 509 |
MA_PROTOCOL_UNAVAILABLE = -40, |
| 510 |
MA_PROTOCOL_NOT_SUPPORTED = -41, |
| 511 |
MA_PROTOCOL_FAMILY_NOT_SUPPORTED = -42, |
| 512 |
MA_ADDRESS_FAMILY_NOT_SUPPORTED = -43, |
| 513 |
MA_SOCKET_NOT_SUPPORTED = -44, |
| 514 |
MA_CONNECTION_RESET = -45, |
| 515 |
MA_ALREADY_CONNECTED = -46, |
| 516 |
MA_NOT_CONNECTED = -47, |
| 517 |
MA_CONNECTION_REFUSED = -48, |
| 518 |
MA_NO_HOST = -49, |
| 519 |
MA_IN_PROGRESS = -50, |
| 520 |
MA_CANCELLED = -51, |
| 521 |
MA_MEMORY_ALREADY_MAPPED = -52, |
| 522 |
|
| 523 |
|
| 524 |
MA_CRC_MISMATCH = -100, |
| 525 |
|
| 526 |
|
| 527 |
MA_FORMAT_NOT_SUPPORTED = -200, |
| 528 |
MA_DEVICE_TYPE_NOT_SUPPORTED = -201, |
| 529 |
MA_SHARE_MODE_NOT_SUPPORTED = -202, |
| 530 |
MA_NO_BACKEND = -203, |
| 531 |
MA_NO_DEVICE = -204, |
| 532 |
MA_API_NOT_FOUND = -205, |
| 533 |
MA_INVALID_DEVICE_CONFIG = -206, |
| 534 |
MA_LOOP = -207, |
| 535 |
MA_BACKEND_NOT_ENABLED = -208, |
| 536 |
|
| 537 |
|
| 538 |
MA_DEVICE_NOT_INITIALIZED = -300, |
| 539 |
MA_DEVICE_ALREADY_INITIALIZED = -301, |
| 540 |
MA_DEVICE_NOT_STARTED = -302, |
| 541 |
MA_DEVICE_NOT_STOPPED = -303, |
| 542 |
|
| 543 |
|
| 544 |
MA_FAILED_TO_INIT_BACKEND = -400, |
| 545 |
MA_FAILED_TO_OPEN_BACKEND_DEVICE = -401, |
| 546 |
MA_FAILED_TO_START_BACKEND_DEVICE = -402, |
| 547 |
MA_FAILED_TO_STOP_BACKEND_DEVICE = -403 |
| 548 |
} ma_result; |
| 549 |
|
| 550 |
|
| 551 |
#define MA_MIN_CHANNELS 1 |
| 552 |
#ifndef MA_MAX_CHANNELS |
| 553 |
#define MA_MAX_CHANNELS 254 |
| 554 |
#endif |
| 555 |
|
| 556 |
#ifndef MA_MAX_FILTER_ORDER |
| 557 |
#define MA_MAX_FILTER_ORDER 8 |
| 558 |
#endif |
| 559 |
|
| 560 |
typedef enum |
| 561 |
{ |
| 562 |
ma_stream_format_pcm = 0 |
| 563 |
} ma_stream_format; |
| 564 |
|
| 565 |
typedef enum |
| 566 |
{ |
| 567 |
ma_stream_layout_interleaved = 0, |
| 568 |
ma_stream_layout_deinterleaved |
| 569 |
} ma_stream_layout; |
| 570 |
|
| 571 |
typedef enum |
| 572 |
{ |
| 573 |
ma_dither_mode_none = 0, |
| 574 |
ma_dither_mode_rectangle, |
| 575 |
ma_dither_mode_triangle |
| 576 |
} ma_dither_mode; |
| 577 |
|
| 578 |
typedef enum |
| 579 |
{ |
| 580 |
|
| 581 |
|
| 582 |
|
| 583 |
|
| 584 |
ma_format_unknown = 0, |
| 585 |
ma_format_u8 = 1, |
| 586 |
ma_format_s16 = 2, |
| 587 |
ma_format_s24 = 3, |
| 588 |
ma_format_s32 = 4, |
| 589 |
ma_format_f32 = 5, |
| 590 |
ma_format_count |
| 591 |
} ma_format; |
| 592 |
|
| 593 |
typedef enum |
| 594 |
{ |
| 595 |
|
| 596 |
ma_standard_sample_rate_48000 = 48000, |
| 597 |
ma_standard_sample_rate_44100 = 44100, |
| 598 |
|
| 599 |
ma_standard_sample_rate_32000 = 32000, |
| 600 |
ma_standard_sample_rate_24000 = 24000, |
| 601 |
ma_standard_sample_rate_22050 = 22050, |
| 602 |
|
| 603 |
ma_standard_sample_rate_88200 = 88200, |
| 604 |
ma_standard_sample_rate_96000 = 96000, |
| 605 |
ma_standard_sample_rate_176400 = 176400, |
| 606 |
ma_standard_sample_rate_192000 = 192000, |
| 607 |
|
| 608 |
ma_standard_sample_rate_16000 = 16000, |
| 609 |
ma_standard_sample_rate_11025 = 11025, |
| 610 |
ma_standard_sample_rate_8000 = 8000, |
| 611 |
|
| 612 |
ma_standard_sample_rate_352800 = 352800, |
| 613 |
ma_standard_sample_rate_384000 = 384000, |
| 614 |
|
| 615 |
ma_standard_sample_rate_min = ma_standard_sample_rate_8000, |
| 616 |
ma_standard_sample_rate_max = ma_standard_sample_rate_384000, |
| 617 |
ma_standard_sample_rate_count = 14 |
| 618 |
} ma_standard_sample_rate; |
| 619 |
|
| 620 |
|
| 621 |
typedef enum |
| 622 |
{ |
| 623 |
ma_channel_mix_mode_rectangular = 0, |
| 624 |
ma_channel_mix_mode_simple, |
| 625 |
ma_channel_mix_mode_custom_weights, |
| 626 |
ma_channel_mix_mode_default = ma_channel_mix_mode_rectangular |
| 627 |
} ma_channel_mix_mode; |
| 628 |
|
| 629 |
typedef enum |
| 630 |
{ |
| 631 |
ma_standard_channel_map_microsoft, |
| 632 |
ma_standard_channel_map_alsa, |
| 633 |
ma_standard_channel_map_rfc3551, |
| 634 |
ma_standard_channel_map_flac, |
| 635 |
ma_standard_channel_map_vorbis, |
| 636 |
ma_standard_channel_map_sound4, |
| 637 |
ma_standard_channel_map_sndio, |
| 638 |
ma_standard_channel_map_webaudio = ma_standard_channel_map_flac, |
| 639 |
ma_standard_channel_map_default = ma_standard_channel_map_microsoft |
| 640 |
} ma_standard_channel_map; |
| 641 |
|
| 642 |
typedef enum |
| 643 |
{ |
| 644 |
ma_performance_profile_low_latency = 0, |
| 645 |
ma_performance_profile_conservative |
| 646 |
} ma_performance_profile; |
| 647 |
|
| 648 |
|
| 649 |
typedef struct |
| 650 |
{ |
| 651 |
void* pUserData; |
| 652 |
void* (* onMalloc)(size_t sz, void* pUserData); |
| 653 |
void* (* onRealloc)(void* p, size_t sz, void* pUserData); |
| 654 |
void (* onFree)(void* p, void* pUserData); |
| 655 |
} ma_allocation_callbacks; |
| 656 |
|
| 657 |
typedef struct |
| 658 |
{ |
| 659 |
ma_uint32 state; |
| 660 |
} ma_lcg; |
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
|
| 676 |
|
| 677 |
|
| 678 |
|
| 679 |
|
| 680 |
|
| 681 |
|
| 682 |
|
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
|
| 695 |
|
| 696 |
|
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
|
| 701 |
#define MA_ATOMIC_SAFE_TYPE_DECL(c89TypeExtension, typeSize, type) \ |
| 702 |
typedef struct \ |
| 703 |
{ \ |
| 704 |
MA_ATOMIC(typeSize, ma_##type) value; \ |
| 705 |
} ma_atomic_##type; \ |
| 706 |
|
| 707 |
#define MA_ATOMIC_SAFE_TYPE_DECL_PTR(type) \ |
| 708 |
typedef struct \ |
| 709 |
{ \ |
| 710 |
MA_ATOMIC(MA_SIZEOF_PTR, ma_##type*) value; \ |
| 711 |
} ma_atomic_ptr_##type; \ |
| 712 |
|
| 713 |
MA_ATOMIC_SAFE_TYPE_DECL(32, 4, uint32) |
| 714 |
MA_ATOMIC_SAFE_TYPE_DECL(i32, 4, int32) |
| 715 |
MA_ATOMIC_SAFE_TYPE_DECL(64, 8, uint64) |
| 716 |
MA_ATOMIC_SAFE_TYPE_DECL(f32, 4, float) |
| 717 |
MA_ATOMIC_SAFE_TYPE_DECL(32, 4, bool32) |
| 718 |
|
| 719 |
|
| 720 |
|
| 721 |
typedef ma_uint32 ma_spinlock; |
| 722 |
|
| 723 |
#ifndef MA_NO_THREADING |
| 724 |
|
| 725 |
typedef enum |
| 726 |
{ |
| 727 |
ma_thread_priority_idle = -5, |
| 728 |
ma_thread_priority_lowest = -4, |
| 729 |
ma_thread_priority_low = -3, |
| 730 |
ma_thread_priority_normal = -2, |
| 731 |
ma_thread_priority_high = -1, |
| 732 |
ma_thread_priority_highest = 0, |
| 733 |
ma_thread_priority_realtime = 1, |
| 734 |
ma_thread_priority_default = 0 |
| 735 |
} ma_thread_priority; |
| 736 |
|
| 737 |
#if defined(MA_POSIX) |
| 738 |
typedef ma_pthread_t ma_thread; |
| 739 |
#elif defined(MA_WIN32) |
| 740 |
typedef ma_handle ma_thread; |
| 741 |
#endif |
| 742 |
|
| 743 |
#if defined(MA_POSIX) |
| 744 |
typedef ma_pthread_mutex_t ma_mutex; |
| 745 |
#elif defined(MA_WIN32) |
| 746 |
typedef ma_handle ma_mutex; |
| 747 |
#endif |
| 748 |
|
| 749 |
#if defined(MA_POSIX) |
| 750 |
typedef struct |
| 751 |
{ |
| 752 |
ma_uint32 value; |
| 753 |
ma_pthread_mutex_t lock; |
| 754 |
ma_pthread_cond_t cond; |
| 755 |
} ma_event; |
| 756 |
#elif defined(MA_WIN32) |
| 757 |
typedef ma_handle ma_event; |
| 758 |
#endif |
| 759 |
|
| 760 |
#if defined(MA_POSIX) |
| 761 |
typedef struct |
| 762 |
{ |
| 763 |
int value; |
| 764 |
ma_pthread_mutex_t lock; |
| 765 |
ma_pthread_cond_t cond; |
| 766 |
} ma_semaphore; |
| 767 |
#elif defined(MA_WIN32) |
| 768 |
typedef ma_handle ma_semaphore; |
| 769 |
#endif |
| 770 |
#else |
| 771 |
|
| 772 |
#ifndef MA_NO_DEVICE_IO |
| 773 |
#error "MA_NO_THREADING cannot be used without MA_NO_DEVICE_IO"; |
| 774 |
#endif |
| 775 |
#endif |
| 776 |
|
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
|
| 781 |
MA_API void ma_version(ma_uint32* pMajor, ma_uint32* pMinor, ma_uint32* pRevision); |
| 782 |
|
| 783 |
|
| 784 |
|
| 785 |
|
| 786 |
MA_API const char* ma_version_string(void); |
| 787 |
|
| 788 |
|
| 789 |
|
| 790 |
|
| 791 |
|
| 792 |
|
| 793 |
|
| 794 |
#include <stdarg.h> |
| 795 |
|
| 796 |
#if defined(__has_attribute) |
| 797 |
#if __has_attribute(format) |
| 798 |
#define MA_ATTRIBUTE_FORMAT(fmt, va) __attribute__((format(printf, fmt, va))) |
| 799 |
#endif |
| 800 |
#endif |
| 801 |
#ifndef MA_ATTRIBUTE_FORMAT |
| 802 |
#define MA_ATTRIBUTE_FORMAT(fmt, va) |
| 803 |
#endif |
| 804 |
|
| 805 |
#ifndef MA_MAX_LOG_CALLBACKS |
| 806 |
#define MA_MAX_LOG_CALLBACKS 4 |
| 807 |
#endif |
| 808 |
|
| 809 |
|
| 810 |
|
| 811 |
|
| 812 |
|
| 813 |
|
| 814 |
|
| 815 |
|
| 816 |
|
| 817 |
|
| 818 |
|
| 819 |
|
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
|
| 824 |
|
| 825 |
|
| 826 |
|
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
|
| 833 |
|
| 834 |
typedef void (* ma_log_callback_proc)(void* pUserData, ma_uint32 level, const char* pMessage); |
| 835 |
|
| 836 |
typedef struct |
| 837 |
{ |
| 838 |
ma_log_callback_proc onLog; |
| 839 |
void* pUserData; |
| 840 |
} ma_log_callback; |
| 841 |
|
| 842 |
MA_API ma_log_callback ma_log_callback_init(ma_log_callback_proc onLog, void* pUserData); |
| 843 |
|
| 844 |
|
| 845 |
typedef struct |
| 846 |
{ |
| 847 |
ma_log_callback callbacks[MA_MAX_LOG_CALLBACKS]; |
| 848 |
ma_uint32 callbackCount; |
| 849 |
ma_allocation_callbacks allocationCallbacks; |
| 850 |
#ifndef MA_NO_THREADING |
| 851 |
ma_mutex lock; |
| 852 |
#endif |
| 853 |
} ma_log; |
| 854 |
|
| 855 |
MA_API ma_result ma_log_init(const ma_allocation_callbacks* pAllocationCallbacks, ma_log* pLog); |
| 856 |
MA_API void ma_log_uninit(ma_log* pLog); |
| 857 |
MA_API ma_result ma_log_register_callback(ma_log* pLog, ma_log_callback callback); |
| 858 |
MA_API ma_result ma_log_unregister_callback(ma_log* pLog, ma_log_callback callback); |
| 859 |
MA_API ma_result ma_log_post(ma_log* pLog, ma_uint32 level, const char* pMessage); |
| 860 |
MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat, va_list args); |
| 861 |
MA_API ma_result ma_log_postf(ma_log* pLog, ma_uint32 level, const char* pFormat, ...) MA_ATTRIBUTE_FORMAT(3, 4); |
| 862 |
|
| 863 |
|
| 864 |
|
| 865 |
|
| 866 |
|
| 867 |
|
| 868 |
|
| 869 |
typedef union |
| 870 |
{ |
| 871 |
float f32; |
| 872 |
ma_int32 s32; |
| 873 |
} ma_biquad_coefficient; |
| 874 |
|
| 875 |
typedef struct |
| 876 |
{ |
| 877 |
ma_format format; |
| 878 |
ma_uint32 channels; |
| 879 |
double b0; |
| 880 |
double b1; |
| 881 |
double b2; |
| 882 |
double a0; |
| 883 |
double a1; |
| 884 |
double a2; |
| 885 |
} ma_biquad_config; |
| 886 |
|
| 887 |
MA_API ma_biquad_config ma_biquad_config_init(ma_format format, ma_uint32 channels, double b0, double b1, double b2, double a0, double a1, double a2); |
| 888 |
|
| 889 |
typedef struct |
| 890 |
{ |
| 891 |
ma_format format; |
| 892 |
ma_uint32 channels; |
| 893 |
ma_biquad_coefficient b0; |
| 894 |
ma_biquad_coefficient b1; |
| 895 |
ma_biquad_coefficient b2; |
| 896 |
ma_biquad_coefficient a1; |
| 897 |
ma_biquad_coefficient a2; |
| 898 |
ma_biquad_coefficient* pR1; |
| 899 |
ma_biquad_coefficient* pR2; |
| 900 |
|
| 901 |
|
| 902 |
void* _pHeap; |
| 903 |
ma_bool32 _ownsHeap; |
| 904 |
} ma_biquad; |
| 905 |
|
| 906 |
MA_API ma_result ma_biquad_get_heap_size(const ma_biquad_config* pConfig, size_t* pHeapSizeInBytes); |
| 907 |
MA_API ma_result ma_biquad_init_preallocated(const ma_biquad_config* pConfig, void* pHeap, ma_biquad* pBQ); |
| 908 |
MA_API ma_result ma_biquad_init(const ma_biquad_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_biquad* pBQ); |
| 909 |
MA_API void ma_biquad_uninit(ma_biquad* pBQ, const ma_allocation_callbacks* pAllocationCallbacks); |
| 910 |
MA_API ma_result ma_biquad_reinit(const ma_biquad_config* pConfig, ma_biquad* pBQ); |
| 911 |
MA_API ma_result ma_biquad_clear_cache(ma_biquad* pBQ); |
| 912 |
MA_API ma_result ma_biquad_process_pcm_frames(ma_biquad* pBQ, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 913 |
MA_API ma_uint32 ma_biquad_get_latency(const ma_biquad* pBQ); |
| 914 |
|
| 915 |
|
| 916 |
|
| 917 |
|
| 918 |
|
| 919 |
|
| 920 |
|
| 921 |
typedef struct |
| 922 |
{ |
| 923 |
ma_format format; |
| 924 |
ma_uint32 channels; |
| 925 |
ma_uint32 sampleRate; |
| 926 |
double cutoffFrequency; |
| 927 |
double q; |
| 928 |
} ma_lpf1_config, ma_lpf2_config; |
| 929 |
|
| 930 |
MA_API ma_lpf1_config ma_lpf1_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency); |
| 931 |
MA_API ma_lpf2_config ma_lpf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, double q); |
| 932 |
|
| 933 |
typedef struct |
| 934 |
{ |
| 935 |
ma_format format; |
| 936 |
ma_uint32 channels; |
| 937 |
ma_biquad_coefficient a; |
| 938 |
ma_biquad_coefficient* pR1; |
| 939 |
|
| 940 |
|
| 941 |
void* _pHeap; |
| 942 |
ma_bool32 _ownsHeap; |
| 943 |
} ma_lpf1; |
| 944 |
|
| 945 |
MA_API ma_result ma_lpf1_get_heap_size(const ma_lpf1_config* pConfig, size_t* pHeapSizeInBytes); |
| 946 |
MA_API ma_result ma_lpf1_init_preallocated(const ma_lpf1_config* pConfig, void* pHeap, ma_lpf1* pLPF); |
| 947 |
MA_API ma_result ma_lpf1_init(const ma_lpf1_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf1* pLPF); |
| 948 |
MA_API void ma_lpf1_uninit(ma_lpf1* pLPF, const ma_allocation_callbacks* pAllocationCallbacks); |
| 949 |
MA_API ma_result ma_lpf1_reinit(const ma_lpf1_config* pConfig, ma_lpf1* pLPF); |
| 950 |
MA_API ma_result ma_lpf1_clear_cache(ma_lpf1* pLPF); |
| 951 |
MA_API ma_result ma_lpf1_process_pcm_frames(ma_lpf1* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 952 |
MA_API ma_uint32 ma_lpf1_get_latency(const ma_lpf1* pLPF); |
| 953 |
|
| 954 |
typedef struct |
| 955 |
{ |
| 956 |
ma_biquad bq; |
| 957 |
} ma_lpf2; |
| 958 |
|
| 959 |
MA_API ma_result ma_lpf2_get_heap_size(const ma_lpf2_config* pConfig, size_t* pHeapSizeInBytes); |
| 960 |
MA_API ma_result ma_lpf2_init_preallocated(const ma_lpf2_config* pConfig, void* pHeap, ma_lpf2* pHPF); |
| 961 |
MA_API ma_result ma_lpf2_init(const ma_lpf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf2* pLPF); |
| 962 |
MA_API void ma_lpf2_uninit(ma_lpf2* pLPF, const ma_allocation_callbacks* pAllocationCallbacks); |
| 963 |
MA_API ma_result ma_lpf2_reinit(const ma_lpf2_config* pConfig, ma_lpf2* pLPF); |
| 964 |
MA_API ma_result ma_lpf2_clear_cache(ma_lpf2* pLPF); |
| 965 |
MA_API ma_result ma_lpf2_process_pcm_frames(ma_lpf2* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 966 |
MA_API ma_uint32 ma_lpf2_get_latency(const ma_lpf2* pLPF); |
| 967 |
|
| 968 |
|
| 969 |
typedef struct |
| 970 |
{ |
| 971 |
ma_format format; |
| 972 |
ma_uint32 channels; |
| 973 |
ma_uint32 sampleRate; |
| 974 |
double cutoffFrequency; |
| 975 |
ma_uint32 order; |
| 976 |
} ma_lpf_config; |
| 977 |
|
| 978 |
MA_API ma_lpf_config ma_lpf_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order); |
| 979 |
|
| 980 |
typedef struct |
| 981 |
{ |
| 982 |
ma_format format; |
| 983 |
ma_uint32 channels; |
| 984 |
ma_uint32 sampleRate; |
| 985 |
ma_uint32 lpf1Count; |
| 986 |
ma_uint32 lpf2Count; |
| 987 |
ma_lpf1* pLPF1; |
| 988 |
ma_lpf2* pLPF2; |
| 989 |
|
| 990 |
|
| 991 |
void* _pHeap; |
| 992 |
ma_bool32 _ownsHeap; |
| 993 |
} ma_lpf; |
| 994 |
|
| 995 |
MA_API ma_result ma_lpf_get_heap_size(const ma_lpf_config* pConfig, size_t* pHeapSizeInBytes); |
| 996 |
MA_API ma_result ma_lpf_init_preallocated(const ma_lpf_config* pConfig, void* pHeap, ma_lpf* pLPF); |
| 997 |
MA_API ma_result ma_lpf_init(const ma_lpf_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf* pLPF); |
| 998 |
MA_API void ma_lpf_uninit(ma_lpf* pLPF, const ma_allocation_callbacks* pAllocationCallbacks); |
| 999 |
MA_API ma_result ma_lpf_reinit(const ma_lpf_config* pConfig, ma_lpf* pLPF); |
| 1000 |
MA_API ma_result ma_lpf_clear_cache(ma_lpf* pLPF); |
| 1001 |
MA_API ma_result ma_lpf_process_pcm_frames(ma_lpf* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1002 |
MA_API ma_uint32 ma_lpf_get_latency(const ma_lpf* pLPF); |
| 1003 |
|
| 1004 |
|
| 1005 |
|
| 1006 |
|
| 1007 |
|
| 1008 |
|
| 1009 |
|
| 1010 |
typedef struct |
| 1011 |
{ |
| 1012 |
ma_format format; |
| 1013 |
ma_uint32 channels; |
| 1014 |
ma_uint32 sampleRate; |
| 1015 |
double cutoffFrequency; |
| 1016 |
double q; |
| 1017 |
} ma_hpf1_config, ma_hpf2_config; |
| 1018 |
|
| 1019 |
MA_API ma_hpf1_config ma_hpf1_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency); |
| 1020 |
MA_API ma_hpf2_config ma_hpf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, double q); |
| 1021 |
|
| 1022 |
typedef struct |
| 1023 |
{ |
| 1024 |
ma_format format; |
| 1025 |
ma_uint32 channels; |
| 1026 |
ma_biquad_coefficient a; |
| 1027 |
ma_biquad_coefficient* pR1; |
| 1028 |
|
| 1029 |
|
| 1030 |
void* _pHeap; |
| 1031 |
ma_bool32 _ownsHeap; |
| 1032 |
} ma_hpf1; |
| 1033 |
|
| 1034 |
MA_API ma_result ma_hpf1_get_heap_size(const ma_hpf1_config* pConfig, size_t* pHeapSizeInBytes); |
| 1035 |
MA_API ma_result ma_hpf1_init_preallocated(const ma_hpf1_config* pConfig, void* pHeap, ma_hpf1* pLPF); |
| 1036 |
MA_API ma_result ma_hpf1_init(const ma_hpf1_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hpf1* pHPF); |
| 1037 |
MA_API void ma_hpf1_uninit(ma_hpf1* pHPF, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1038 |
MA_API ma_result ma_hpf1_reinit(const ma_hpf1_config* pConfig, ma_hpf1* pHPF); |
| 1039 |
MA_API ma_result ma_hpf1_process_pcm_frames(ma_hpf1* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1040 |
MA_API ma_uint32 ma_hpf1_get_latency(const ma_hpf1* pHPF); |
| 1041 |
|
| 1042 |
typedef struct |
| 1043 |
{ |
| 1044 |
ma_biquad bq; |
| 1045 |
} ma_hpf2; |
| 1046 |
|
| 1047 |
MA_API ma_result ma_hpf2_get_heap_size(const ma_hpf2_config* pConfig, size_t* pHeapSizeInBytes); |
| 1048 |
MA_API ma_result ma_hpf2_init_preallocated(const ma_hpf2_config* pConfig, void* pHeap, ma_hpf2* pHPF); |
| 1049 |
MA_API ma_result ma_hpf2_init(const ma_hpf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hpf2* pHPF); |
| 1050 |
MA_API void ma_hpf2_uninit(ma_hpf2* pHPF, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1051 |
MA_API ma_result ma_hpf2_reinit(const ma_hpf2_config* pConfig, ma_hpf2* pHPF); |
| 1052 |
MA_API ma_result ma_hpf2_process_pcm_frames(ma_hpf2* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1053 |
MA_API ma_uint32 ma_hpf2_get_latency(const ma_hpf2* pHPF); |
| 1054 |
|
| 1055 |
|
| 1056 |
typedef struct |
| 1057 |
{ |
| 1058 |
ma_format format; |
| 1059 |
ma_uint32 channels; |
| 1060 |
ma_uint32 sampleRate; |
| 1061 |
double cutoffFrequency; |
| 1062 |
ma_uint32 order; |
| 1063 |
} ma_hpf_config; |
| 1064 |
|
| 1065 |
MA_API ma_hpf_config ma_hpf_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order); |
| 1066 |
|
| 1067 |
typedef struct |
| 1068 |
{ |
| 1069 |
ma_format format; |
| 1070 |
ma_uint32 channels; |
| 1071 |
ma_uint32 sampleRate; |
| 1072 |
ma_uint32 hpf1Count; |
| 1073 |
ma_uint32 hpf2Count; |
| 1074 |
ma_hpf1* pHPF1; |
| 1075 |
ma_hpf2* pHPF2; |
| 1076 |
|
| 1077 |
|
| 1078 |
void* _pHeap; |
| 1079 |
ma_bool32 _ownsHeap; |
| 1080 |
} ma_hpf; |
| 1081 |
|
| 1082 |
MA_API ma_result ma_hpf_get_heap_size(const ma_hpf_config* pConfig, size_t* pHeapSizeInBytes); |
| 1083 |
MA_API ma_result ma_hpf_init_preallocated(const ma_hpf_config* pConfig, void* pHeap, ma_hpf* pLPF); |
| 1084 |
MA_API ma_result ma_hpf_init(const ma_hpf_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hpf* pHPF); |
| 1085 |
MA_API void ma_hpf_uninit(ma_hpf* pHPF, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1086 |
MA_API ma_result ma_hpf_reinit(const ma_hpf_config* pConfig, ma_hpf* pHPF); |
| 1087 |
MA_API ma_result ma_hpf_process_pcm_frames(ma_hpf* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1088 |
MA_API ma_uint32 ma_hpf_get_latency(const ma_hpf* pHPF); |
| 1089 |
|
| 1090 |
|
| 1091 |
|
| 1092 |
|
| 1093 |
|
| 1094 |
|
| 1095 |
|
| 1096 |
typedef struct |
| 1097 |
{ |
| 1098 |
ma_format format; |
| 1099 |
ma_uint32 channels; |
| 1100 |
ma_uint32 sampleRate; |
| 1101 |
double cutoffFrequency; |
| 1102 |
double q; |
| 1103 |
} ma_bpf2_config; |
| 1104 |
|
| 1105 |
MA_API ma_bpf2_config ma_bpf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, double q); |
| 1106 |
|
| 1107 |
typedef struct |
| 1108 |
{ |
| 1109 |
ma_biquad bq; |
| 1110 |
} ma_bpf2; |
| 1111 |
|
| 1112 |
MA_API ma_result ma_bpf2_get_heap_size(const ma_bpf2_config* pConfig, size_t* pHeapSizeInBytes); |
| 1113 |
MA_API ma_result ma_bpf2_init_preallocated(const ma_bpf2_config* pConfig, void* pHeap, ma_bpf2* pBPF); |
| 1114 |
MA_API ma_result ma_bpf2_init(const ma_bpf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_bpf2* pBPF); |
| 1115 |
MA_API void ma_bpf2_uninit(ma_bpf2* pBPF, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1116 |
MA_API ma_result ma_bpf2_reinit(const ma_bpf2_config* pConfig, ma_bpf2* pBPF); |
| 1117 |
MA_API ma_result ma_bpf2_process_pcm_frames(ma_bpf2* pBPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1118 |
MA_API ma_uint32 ma_bpf2_get_latency(const ma_bpf2* pBPF); |
| 1119 |
|
| 1120 |
|
| 1121 |
typedef struct |
| 1122 |
{ |
| 1123 |
ma_format format; |
| 1124 |
ma_uint32 channels; |
| 1125 |
ma_uint32 sampleRate; |
| 1126 |
double cutoffFrequency; |
| 1127 |
ma_uint32 order; |
| 1128 |
} ma_bpf_config; |
| 1129 |
|
| 1130 |
MA_API ma_bpf_config ma_bpf_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order); |
| 1131 |
|
| 1132 |
typedef struct |
| 1133 |
{ |
| 1134 |
ma_format format; |
| 1135 |
ma_uint32 channels; |
| 1136 |
ma_uint32 bpf2Count; |
| 1137 |
ma_bpf2* pBPF2; |
| 1138 |
|
| 1139 |
|
| 1140 |
void* _pHeap; |
| 1141 |
ma_bool32 _ownsHeap; |
| 1142 |
} ma_bpf; |
| 1143 |
|
| 1144 |
MA_API ma_result ma_bpf_get_heap_size(const ma_bpf_config* pConfig, size_t* pHeapSizeInBytes); |
| 1145 |
MA_API ma_result ma_bpf_init_preallocated(const ma_bpf_config* pConfig, void* pHeap, ma_bpf* pBPF); |
| 1146 |
MA_API ma_result ma_bpf_init(const ma_bpf_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_bpf* pBPF); |
| 1147 |
MA_API void ma_bpf_uninit(ma_bpf* pBPF, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1148 |
MA_API ma_result ma_bpf_reinit(const ma_bpf_config* pConfig, ma_bpf* pBPF); |
| 1149 |
MA_API ma_result ma_bpf_process_pcm_frames(ma_bpf* pBPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1150 |
MA_API ma_uint32 ma_bpf_get_latency(const ma_bpf* pBPF); |
| 1151 |
|
| 1152 |
|
| 1153 |
|
| 1154 |
|
| 1155 |
|
| 1156 |
|
| 1157 |
|
| 1158 |
typedef struct |
| 1159 |
{ |
| 1160 |
ma_format format; |
| 1161 |
ma_uint32 channels; |
| 1162 |
ma_uint32 sampleRate; |
| 1163 |
double q; |
| 1164 |
double frequency; |
| 1165 |
} ma_notch2_config, ma_notch_config; |
| 1166 |
|
| 1167 |
MA_API ma_notch2_config ma_notch2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double q, double frequency); |
| 1168 |
|
| 1169 |
typedef struct |
| 1170 |
{ |
| 1171 |
ma_biquad bq; |
| 1172 |
} ma_notch2; |
| 1173 |
|
| 1174 |
MA_API ma_result ma_notch2_get_heap_size(const ma_notch2_config* pConfig, size_t* pHeapSizeInBytes); |
| 1175 |
MA_API ma_result ma_notch2_init_preallocated(const ma_notch2_config* pConfig, void* pHeap, ma_notch2* pFilter); |
| 1176 |
MA_API ma_result ma_notch2_init(const ma_notch2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_notch2* pFilter); |
| 1177 |
MA_API void ma_notch2_uninit(ma_notch2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1178 |
MA_API ma_result ma_notch2_reinit(const ma_notch2_config* pConfig, ma_notch2* pFilter); |
| 1179 |
MA_API ma_result ma_notch2_process_pcm_frames(ma_notch2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1180 |
MA_API ma_uint32 ma_notch2_get_latency(const ma_notch2* pFilter); |
| 1181 |
|
| 1182 |
|
| 1183 |
|
| 1184 |
|
| 1185 |
|
| 1186 |
|
| 1187 |
|
| 1188 |
typedef struct |
| 1189 |
{ |
| 1190 |
ma_format format; |
| 1191 |
ma_uint32 channels; |
| 1192 |
ma_uint32 sampleRate; |
| 1193 |
double gainDB; |
| 1194 |
double q; |
| 1195 |
double frequency; |
| 1196 |
} ma_peak2_config, ma_peak_config; |
| 1197 |
|
| 1198 |
MA_API ma_peak2_config ma_peak2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double q, double frequency); |
| 1199 |
|
| 1200 |
typedef struct |
| 1201 |
{ |
| 1202 |
ma_biquad bq; |
| 1203 |
} ma_peak2; |
| 1204 |
|
| 1205 |
MA_API ma_result ma_peak2_get_heap_size(const ma_peak2_config* pConfig, size_t* pHeapSizeInBytes); |
| 1206 |
MA_API ma_result ma_peak2_init_preallocated(const ma_peak2_config* pConfig, void* pHeap, ma_peak2* pFilter); |
| 1207 |
MA_API ma_result ma_peak2_init(const ma_peak2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_peak2* pFilter); |
| 1208 |
MA_API void ma_peak2_uninit(ma_peak2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1209 |
MA_API ma_result ma_peak2_reinit(const ma_peak2_config* pConfig, ma_peak2* pFilter); |
| 1210 |
MA_API ma_result ma_peak2_process_pcm_frames(ma_peak2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1211 |
MA_API ma_uint32 ma_peak2_get_latency(const ma_peak2* pFilter); |
| 1212 |
|
| 1213 |
|
| 1214 |
|
| 1215 |
|
| 1216 |
|
| 1217 |
|
| 1218 |
|
| 1219 |
typedef struct |
| 1220 |
{ |
| 1221 |
ma_format format; |
| 1222 |
ma_uint32 channels; |
| 1223 |
ma_uint32 sampleRate; |
| 1224 |
double gainDB; |
| 1225 |
double shelfSlope; |
| 1226 |
double frequency; |
| 1227 |
} ma_loshelf2_config, ma_loshelf_config; |
| 1228 |
|
| 1229 |
MA_API ma_loshelf2_config ma_loshelf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double shelfSlope, double frequency); |
| 1230 |
|
| 1231 |
typedef struct |
| 1232 |
{ |
| 1233 |
ma_biquad bq; |
| 1234 |
} ma_loshelf2; |
| 1235 |
|
| 1236 |
MA_API ma_result ma_loshelf2_get_heap_size(const ma_loshelf2_config* pConfig, size_t* pHeapSizeInBytes); |
| 1237 |
MA_API ma_result ma_loshelf2_init_preallocated(const ma_loshelf2_config* pConfig, void* pHeap, ma_loshelf2* pFilter); |
| 1238 |
MA_API ma_result ma_loshelf2_init(const ma_loshelf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_loshelf2* pFilter); |
| 1239 |
MA_API void ma_loshelf2_uninit(ma_loshelf2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1240 |
MA_API ma_result ma_loshelf2_reinit(const ma_loshelf2_config* pConfig, ma_loshelf2* pFilter); |
| 1241 |
MA_API ma_result ma_loshelf2_process_pcm_frames(ma_loshelf2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1242 |
MA_API ma_uint32 ma_loshelf2_get_latency(const ma_loshelf2* pFilter); |
| 1243 |
|
| 1244 |
|
| 1245 |
|
| 1246 |
|
| 1247 |
|
| 1248 |
|
| 1249 |
|
| 1250 |
typedef struct |
| 1251 |
{ |
| 1252 |
ma_format format; |
| 1253 |
ma_uint32 channels; |
| 1254 |
ma_uint32 sampleRate; |
| 1255 |
double gainDB; |
| 1256 |
double shelfSlope; |
| 1257 |
double frequency; |
| 1258 |
} ma_hishelf2_config, ma_hishelf_config; |
| 1259 |
|
| 1260 |
MA_API ma_hishelf2_config ma_hishelf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double shelfSlope, double frequency); |
| 1261 |
|
| 1262 |
typedef struct |
| 1263 |
{ |
| 1264 |
ma_biquad bq; |
| 1265 |
} ma_hishelf2; |
| 1266 |
|
| 1267 |
MA_API ma_result ma_hishelf2_get_heap_size(const ma_hishelf2_config* pConfig, size_t* pHeapSizeInBytes); |
| 1268 |
MA_API ma_result ma_hishelf2_init_preallocated(const ma_hishelf2_config* pConfig, void* pHeap, ma_hishelf2* pFilter); |
| 1269 |
MA_API ma_result ma_hishelf2_init(const ma_hishelf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hishelf2* pFilter); |
| 1270 |
MA_API void ma_hishelf2_uninit(ma_hishelf2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1271 |
MA_API ma_result ma_hishelf2_reinit(const ma_hishelf2_config* pConfig, ma_hishelf2* pFilter); |
| 1272 |
MA_API ma_result ma_hishelf2_process_pcm_frames(ma_hishelf2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1273 |
MA_API ma_uint32 ma_hishelf2_get_latency(const ma_hishelf2* pFilter); |
| 1274 |
|
| 1275 |
|
| 1276 |
|
| 1277 |
|
| 1278 |
|
| 1279 |
|
| 1280 |
typedef struct |
| 1281 |
{ |
| 1282 |
ma_uint32 channels; |
| 1283 |
ma_uint32 sampleRate; |
| 1284 |
ma_uint32 delayInFrames; |
| 1285 |
ma_bool32 delayStart; |
| 1286 |
float wet; |
| 1287 |
float dry; |
| 1288 |
float decay; |
| 1289 |
} ma_delay_config; |
| 1290 |
|
| 1291 |
MA_API ma_delay_config ma_delay_config_init(ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 delayInFrames, float decay); |
| 1292 |
|
| 1293 |
|
| 1294 |
typedef struct |
| 1295 |
{ |
| 1296 |
ma_delay_config config; |
| 1297 |
ma_uint32 cursor; |
| 1298 |
ma_uint32 bufferSizeInFrames; |
| 1299 |
float* pBuffer; |
| 1300 |
} ma_delay; |
| 1301 |
|
| 1302 |
MA_API ma_result ma_delay_init(const ma_delay_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_delay* pDelay); |
| 1303 |
MA_API void ma_delay_uninit(ma_delay* pDelay, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1304 |
MA_API ma_result ma_delay_process_pcm_frames(ma_delay* pDelay, void* pFramesOut, const void* pFramesIn, ma_uint32 frameCount); |
| 1305 |
MA_API void ma_delay_set_wet(ma_delay* pDelay, float value); |
| 1306 |
MA_API float ma_delay_get_wet(const ma_delay* pDelay); |
| 1307 |
MA_API void ma_delay_set_dry(ma_delay* pDelay, float value); |
| 1308 |
MA_API float ma_delay_get_dry(const ma_delay* pDelay); |
| 1309 |
MA_API void ma_delay_set_decay(ma_delay* pDelay, float value); |
| 1310 |
MA_API float ma_delay_get_decay(const ma_delay* pDelay); |
| 1311 |
|
| 1312 |
|
| 1313 |
|
| 1314 |
typedef struct |
| 1315 |
{ |
| 1316 |
ma_uint32 channels; |
| 1317 |
ma_uint32 smoothTimeInFrames; |
| 1318 |
} ma_gainer_config; |
| 1319 |
|
| 1320 |
MA_API ma_gainer_config ma_gainer_config_init(ma_uint32 channels, ma_uint32 smoothTimeInFrames); |
| 1321 |
|
| 1322 |
|
| 1323 |
typedef struct |
| 1324 |
{ |
| 1325 |
ma_gainer_config config; |
| 1326 |
ma_uint32 t; |
| 1327 |
float masterVolume; |
| 1328 |
float* pOldGains; |
| 1329 |
float* pNewGains; |
| 1330 |
|
| 1331 |
|
| 1332 |
void* _pHeap; |
| 1333 |
ma_bool32 _ownsHeap; |
| 1334 |
} ma_gainer; |
| 1335 |
|
| 1336 |
MA_API ma_result ma_gainer_get_heap_size(const ma_gainer_config* pConfig, size_t* pHeapSizeInBytes); |
| 1337 |
MA_API ma_result ma_gainer_init_preallocated(const ma_gainer_config* pConfig, void* pHeap, ma_gainer* pGainer); |
| 1338 |
MA_API ma_result ma_gainer_init(const ma_gainer_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_gainer* pGainer); |
| 1339 |
MA_API void ma_gainer_uninit(ma_gainer* pGainer, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1340 |
MA_API ma_result ma_gainer_process_pcm_frames(ma_gainer* pGainer, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1341 |
MA_API ma_result ma_gainer_set_gain(ma_gainer* pGainer, float newGain); |
| 1342 |
MA_API ma_result ma_gainer_set_gains(ma_gainer* pGainer, float* pNewGains); |
| 1343 |
MA_API ma_result ma_gainer_set_master_volume(ma_gainer* pGainer, float volume); |
| 1344 |
MA_API ma_result ma_gainer_get_master_volume(const ma_gainer* pGainer, float* pVolume); |
| 1345 |
|
| 1346 |
|
| 1347 |
|
| 1348 |
|
| 1349 |
typedef enum |
| 1350 |
{ |
| 1351 |
ma_pan_mode_balance = 0, |
| 1352 |
ma_pan_mode_pan |
| 1353 |
} ma_pan_mode; |
| 1354 |
|
| 1355 |
typedef struct |
| 1356 |
{ |
| 1357 |
ma_format format; |
| 1358 |
ma_uint32 channels; |
| 1359 |
ma_pan_mode mode; |
| 1360 |
float pan; |
| 1361 |
} ma_panner_config; |
| 1362 |
|
| 1363 |
MA_API ma_panner_config ma_panner_config_init(ma_format format, ma_uint32 channels); |
| 1364 |
|
| 1365 |
|
| 1366 |
typedef struct |
| 1367 |
{ |
| 1368 |
ma_format format; |
| 1369 |
ma_uint32 channels; |
| 1370 |
ma_pan_mode mode; |
| 1371 |
float pan; |
| 1372 |
} ma_panner; |
| 1373 |
|
| 1374 |
MA_API ma_result ma_panner_init(const ma_panner_config* pConfig, ma_panner* pPanner); |
| 1375 |
MA_API ma_result ma_panner_process_pcm_frames(ma_panner* pPanner, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1376 |
MA_API void ma_panner_set_mode(ma_panner* pPanner, ma_pan_mode mode); |
| 1377 |
MA_API ma_pan_mode ma_panner_get_mode(const ma_panner* pPanner); |
| 1378 |
MA_API void ma_panner_set_pan(ma_panner* pPanner, float pan); |
| 1379 |
MA_API float ma_panner_get_pan(const ma_panner* pPanner); |
| 1380 |
|
| 1381 |
|
| 1382 |
|
| 1383 |
|
| 1384 |
typedef struct |
| 1385 |
{ |
| 1386 |
ma_format format; |
| 1387 |
ma_uint32 channels; |
| 1388 |
ma_uint32 sampleRate; |
| 1389 |
} ma_fader_config; |
| 1390 |
|
| 1391 |
MA_API ma_fader_config ma_fader_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate); |
| 1392 |
|
| 1393 |
typedef struct |
| 1394 |
{ |
| 1395 |
ma_fader_config config; |
| 1396 |
float volumeBeg; |
| 1397 |
float volumeEnd; |
| 1398 |
ma_uint64 lengthInFrames; |
| 1399 |
ma_int64 cursorInFrames; |
| 1400 |
} ma_fader; |
| 1401 |
|
| 1402 |
MA_API ma_result ma_fader_init(const ma_fader_config* pConfig, ma_fader* pFader); |
| 1403 |
MA_API ma_result ma_fader_process_pcm_frames(ma_fader* pFader, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1404 |
MA_API void ma_fader_get_data_format(const ma_fader* pFader, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate); |
| 1405 |
MA_API void ma_fader_set_fade(ma_fader* pFader, float volumeBeg, float volumeEnd, ma_uint64 lengthInFrames); |
| 1406 |
MA_API void ma_fader_set_fade_ex(ma_fader* pFader, float volumeBeg, float volumeEnd, ma_uint64 lengthInFrames, ma_int64 startOffsetInFrames); |
| 1407 |
MA_API float ma_fader_get_current_volume(const ma_fader* pFader); |
| 1408 |
|
| 1409 |
|
| 1410 |
|
| 1411 |
|
| 1412 |
typedef struct |
| 1413 |
{ |
| 1414 |
float x; |
| 1415 |
float y; |
| 1416 |
float z; |
| 1417 |
} ma_vec3f; |
| 1418 |
|
| 1419 |
typedef struct |
| 1420 |
{ |
| 1421 |
ma_vec3f v; |
| 1422 |
ma_spinlock lock; |
| 1423 |
} ma_atomic_vec3f; |
| 1424 |
|
| 1425 |
typedef enum |
| 1426 |
{ |
| 1427 |
ma_attenuation_model_none, |
| 1428 |
ma_attenuation_model_inverse, |
| 1429 |
ma_attenuation_model_linear, |
| 1430 |
ma_attenuation_model_exponential |
| 1431 |
} ma_attenuation_model; |
| 1432 |
|
| 1433 |
typedef enum |
| 1434 |
{ |
| 1435 |
ma_positioning_absolute, |
| 1436 |
ma_positioning_relative |
| 1437 |
} ma_positioning; |
| 1438 |
|
| 1439 |
typedef enum |
| 1440 |
{ |
| 1441 |
ma_handedness_right, |
| 1442 |
ma_handedness_left |
| 1443 |
} ma_handedness; |
| 1444 |
|
| 1445 |
|
| 1446 |
typedef struct |
| 1447 |
{ |
| 1448 |
ma_uint32 channelsOut; |
| 1449 |
ma_channel* pChannelMapOut; |
| 1450 |
ma_handedness handedness; |
| 1451 |
float coneInnerAngleInRadians; |
| 1452 |
float coneOuterAngleInRadians; |
| 1453 |
float coneOuterGain; |
| 1454 |
float speedOfSound; |
| 1455 |
ma_vec3f worldUp; |
| 1456 |
} ma_spatializer_listener_config; |
| 1457 |
|
| 1458 |
MA_API ma_spatializer_listener_config ma_spatializer_listener_config_init(ma_uint32 channelsOut); |
| 1459 |
|
| 1460 |
|
| 1461 |
typedef struct |
| 1462 |
{ |
| 1463 |
ma_spatializer_listener_config config; |
| 1464 |
ma_atomic_vec3f position; |
| 1465 |
ma_atomic_vec3f direction; |
| 1466 |
ma_atomic_vec3f velocity; |
| 1467 |
ma_bool32 isEnabled; |
| 1468 |
|
| 1469 |
|
| 1470 |
ma_bool32 _ownsHeap; |
| 1471 |
void* _pHeap; |
| 1472 |
} ma_spatializer_listener; |
| 1473 |
|
| 1474 |
MA_API ma_result ma_spatializer_listener_get_heap_size(const ma_spatializer_listener_config* pConfig, size_t* pHeapSizeInBytes); |
| 1475 |
MA_API ma_result ma_spatializer_listener_init_preallocated(const ma_spatializer_listener_config* pConfig, void* pHeap, ma_spatializer_listener* pListener); |
| 1476 |
MA_API ma_result ma_spatializer_listener_init(const ma_spatializer_listener_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_spatializer_listener* pListener); |
| 1477 |
MA_API void ma_spatializer_listener_uninit(ma_spatializer_listener* pListener, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1478 |
MA_API ma_channel* ma_spatializer_listener_get_channel_map(ma_spatializer_listener* pListener); |
| 1479 |
MA_API void ma_spatializer_listener_set_cone(ma_spatializer_listener* pListener, float innerAngleInRadians, float outerAngleInRadians, float outerGain); |
| 1480 |
MA_API void ma_spatializer_listener_get_cone(const ma_spatializer_listener* pListener, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain); |
| 1481 |
MA_API void ma_spatializer_listener_set_position(ma_spatializer_listener* pListener, float x, float y, float z); |
| 1482 |
MA_API ma_vec3f ma_spatializer_listener_get_position(const ma_spatializer_listener* pListener); |
| 1483 |
MA_API void ma_spatializer_listener_set_direction(ma_spatializer_listener* pListener, float x, float y, float z); |
| 1484 |
MA_API ma_vec3f ma_spatializer_listener_get_direction(const ma_spatializer_listener* pListener); |
| 1485 |
MA_API void ma_spatializer_listener_set_velocity(ma_spatializer_listener* pListener, float x, float y, float z); |
| 1486 |
MA_API ma_vec3f ma_spatializer_listener_get_velocity(const ma_spatializer_listener* pListener); |
| 1487 |
MA_API void ma_spatializer_listener_set_speed_of_sound(ma_spatializer_listener* pListener, float speedOfSound); |
| 1488 |
MA_API float ma_spatializer_listener_get_speed_of_sound(const ma_spatializer_listener* pListener); |
| 1489 |
MA_API void ma_spatializer_listener_set_world_up(ma_spatializer_listener* pListener, float x, float y, float z); |
| 1490 |
MA_API ma_vec3f ma_spatializer_listener_get_world_up(const ma_spatializer_listener* pListener); |
| 1491 |
MA_API void ma_spatializer_listener_set_enabled(ma_spatializer_listener* pListener, ma_bool32 isEnabled); |
| 1492 |
MA_API ma_bool32 ma_spatializer_listener_is_enabled(const ma_spatializer_listener* pListener); |
| 1493 |
|
| 1494 |
|
| 1495 |
typedef struct |
| 1496 |
{ |
| 1497 |
ma_uint32 channelsIn; |
| 1498 |
ma_uint32 channelsOut; |
| 1499 |
ma_channel* pChannelMapIn; |
| 1500 |
ma_attenuation_model attenuationModel; |
| 1501 |
ma_positioning positioning; |
| 1502 |
ma_handedness handedness; |
| 1503 |
float minGain; |
| 1504 |
float maxGain; |
| 1505 |
float minDistance; |
| 1506 |
float maxDistance; |
| 1507 |
float rolloff; |
| 1508 |
float coneInnerAngleInRadians; |
| 1509 |
float coneOuterAngleInRadians; |
| 1510 |
float coneOuterGain; |
| 1511 |
float dopplerFactor; |
| 1512 |
float directionalAttenuationFactor; |
| 1513 |
float minSpatializationChannelGain; |
| 1514 |
ma_uint32 gainSmoothTimeInFrames; |
| 1515 |
} ma_spatializer_config; |
| 1516 |
|
| 1517 |
MA_API ma_spatializer_config ma_spatializer_config_init(ma_uint32 channelsIn, ma_uint32 channelsOut); |
| 1518 |
|
| 1519 |
|
| 1520 |
typedef struct |
| 1521 |
{ |
| 1522 |
ma_uint32 channelsIn; |
| 1523 |
ma_uint32 channelsOut; |
| 1524 |
ma_channel* pChannelMapIn; |
| 1525 |
ma_attenuation_model attenuationModel; |
| 1526 |
ma_positioning positioning; |
| 1527 |
ma_handedness handedness; |
| 1528 |
float minGain; |
| 1529 |
float maxGain; |
| 1530 |
float minDistance; |
| 1531 |
float maxDistance; |
| 1532 |
float rolloff; |
| 1533 |
float coneInnerAngleInRadians; |
| 1534 |
float coneOuterAngleInRadians; |
| 1535 |
float coneOuterGain; |
| 1536 |
float dopplerFactor; |
| 1537 |
float directionalAttenuationFactor; |
| 1538 |
ma_uint32 gainSmoothTimeInFrames; |
| 1539 |
ma_atomic_vec3f position; |
| 1540 |
ma_atomic_vec3f direction; |
| 1541 |
ma_atomic_vec3f velocity; |
| 1542 |
float dopplerPitch; |
| 1543 |
float minSpatializationChannelGain; |
| 1544 |
ma_gainer gainer; |
| 1545 |
float* pNewChannelGainsOut; |
| 1546 |
|
| 1547 |
|
| 1548 |
void* _pHeap; |
| 1549 |
ma_bool32 _ownsHeap; |
| 1550 |
} ma_spatializer; |
| 1551 |
|
| 1552 |
MA_API ma_result ma_spatializer_get_heap_size(const ma_spatializer_config* pConfig, size_t* pHeapSizeInBytes); |
| 1553 |
MA_API ma_result ma_spatializer_init_preallocated(const ma_spatializer_config* pConfig, void* pHeap, ma_spatializer* pSpatializer); |
| 1554 |
MA_API ma_result ma_spatializer_init(const ma_spatializer_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_spatializer* pSpatializer); |
| 1555 |
MA_API void ma_spatializer_uninit(ma_spatializer* pSpatializer, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1556 |
MA_API ma_result ma_spatializer_process_pcm_frames(ma_spatializer* pSpatializer, ma_spatializer_listener* pListener, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1557 |
MA_API ma_result ma_spatializer_set_master_volume(ma_spatializer* pSpatializer, float volume); |
| 1558 |
MA_API ma_result ma_spatializer_get_master_volume(const ma_spatializer* pSpatializer, float* pVolume); |
| 1559 |
MA_API ma_uint32 ma_spatializer_get_input_channels(const ma_spatializer* pSpatializer); |
| 1560 |
MA_API ma_uint32 ma_spatializer_get_output_channels(const ma_spatializer* pSpatializer); |
| 1561 |
MA_API void ma_spatializer_set_attenuation_model(ma_spatializer* pSpatializer, ma_attenuation_model attenuationModel); |
| 1562 |
MA_API ma_attenuation_model ma_spatializer_get_attenuation_model(const ma_spatializer* pSpatializer); |
| 1563 |
MA_API void ma_spatializer_set_positioning(ma_spatializer* pSpatializer, ma_positioning positioning); |
| 1564 |
MA_API ma_positioning ma_spatializer_get_positioning(const ma_spatializer* pSpatializer); |
| 1565 |
MA_API void ma_spatializer_set_rolloff(ma_spatializer* pSpatializer, float rolloff); |
| 1566 |
MA_API float ma_spatializer_get_rolloff(const ma_spatializer* pSpatializer); |
| 1567 |
MA_API void ma_spatializer_set_min_gain(ma_spatializer* pSpatializer, float minGain); |
| 1568 |
MA_API float ma_spatializer_get_min_gain(const ma_spatializer* pSpatializer); |
| 1569 |
MA_API void ma_spatializer_set_max_gain(ma_spatializer* pSpatializer, float maxGain); |
| 1570 |
MA_API float ma_spatializer_get_max_gain(const ma_spatializer* pSpatializer); |
| 1571 |
MA_API void ma_spatializer_set_min_distance(ma_spatializer* pSpatializer, float minDistance); |
| 1572 |
MA_API float ma_spatializer_get_min_distance(const ma_spatializer* pSpatializer); |
| 1573 |
MA_API void ma_spatializer_set_max_distance(ma_spatializer* pSpatializer, float maxDistance); |
| 1574 |
MA_API float ma_spatializer_get_max_distance(const ma_spatializer* pSpatializer); |
| 1575 |
MA_API void ma_spatializer_set_cone(ma_spatializer* pSpatializer, float innerAngleInRadians, float outerAngleInRadians, float outerGain); |
| 1576 |
MA_API void ma_spatializer_get_cone(const ma_spatializer* pSpatializer, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain); |
| 1577 |
MA_API void ma_spatializer_set_doppler_factor(ma_spatializer* pSpatializer, float dopplerFactor); |
| 1578 |
MA_API float ma_spatializer_get_doppler_factor(const ma_spatializer* pSpatializer); |
| 1579 |
MA_API void ma_spatializer_set_directional_attenuation_factor(ma_spatializer* pSpatializer, float directionalAttenuationFactor); |
| 1580 |
MA_API float ma_spatializer_get_directional_attenuation_factor(const ma_spatializer* pSpatializer); |
| 1581 |
MA_API void ma_spatializer_set_position(ma_spatializer* pSpatializer, float x, float y, float z); |
| 1582 |
MA_API ma_vec3f ma_spatializer_get_position(const ma_spatializer* pSpatializer); |
| 1583 |
MA_API void ma_spatializer_set_direction(ma_spatializer* pSpatializer, float x, float y, float z); |
| 1584 |
MA_API ma_vec3f ma_spatializer_get_direction(const ma_spatializer* pSpatializer); |
| 1585 |
MA_API void ma_spatializer_set_velocity(ma_spatializer* pSpatializer, float x, float y, float z); |
| 1586 |
MA_API ma_vec3f ma_spatializer_get_velocity(const ma_spatializer* pSpatializer); |
| 1587 |
MA_API void ma_spatializer_get_relative_position_and_direction(const ma_spatializer* pSpatializer, const ma_spatializer_listener* pListener, ma_vec3f* pRelativePos, ma_vec3f* pRelativeDir); |
| 1588 |
|
| 1589 |
|
| 1590 |
|
| 1591 |
|
| 1592 |
|
| 1593 |
|
| 1594 |
|
| 1595 |
|
| 1596 |
|
| 1597 |
|
| 1598 |
|
| 1599 |
|
| 1600 |
|
| 1601 |
|
| 1602 |
|
| 1603 |
|
| 1604 |
|
| 1605 |
|
| 1606 |
|
| 1607 |
typedef struct |
| 1608 |
{ |
| 1609 |
ma_format format; |
| 1610 |
ma_uint32 channels; |
| 1611 |
ma_uint32 sampleRateIn; |
| 1612 |
ma_uint32 sampleRateOut; |
| 1613 |
ma_uint32 lpfOrder; |
| 1614 |
double lpfNyquistFactor; |
| 1615 |
} ma_linear_resampler_config; |
| 1616 |
|
| 1617 |
MA_API ma_linear_resampler_config ma_linear_resampler_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut); |
| 1618 |
|
| 1619 |
typedef struct |
| 1620 |
{ |
| 1621 |
ma_linear_resampler_config config; |
| 1622 |
ma_uint32 inAdvanceInt; |
| 1623 |
ma_uint32 inAdvanceFrac; |
| 1624 |
ma_uint32 inTimeInt; |
| 1625 |
ma_uint32 inTimeFrac; |
| 1626 |
union |
| 1627 |
{ |
| 1628 |
float* f32; |
| 1629 |
ma_int16* s16; |
| 1630 |
} x0; |
| 1631 |
union |
| 1632 |
{ |
| 1633 |
float* f32; |
| 1634 |
ma_int16* s16; |
| 1635 |
} x1; |
| 1636 |
ma_lpf lpf; |
| 1637 |
|
| 1638 |
|
| 1639 |
void* _pHeap; |
| 1640 |
ma_bool32 _ownsHeap; |
| 1641 |
} ma_linear_resampler; |
| 1642 |
|
| 1643 |
MA_API ma_result ma_linear_resampler_get_heap_size(const ma_linear_resampler_config* pConfig, size_t* pHeapSizeInBytes); |
| 1644 |
MA_API ma_result ma_linear_resampler_init_preallocated(const ma_linear_resampler_config* pConfig, void* pHeap, ma_linear_resampler* pResampler); |
| 1645 |
MA_API ma_result ma_linear_resampler_init(const ma_linear_resampler_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_linear_resampler* pResampler); |
| 1646 |
MA_API void ma_linear_resampler_uninit(ma_linear_resampler* pResampler, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1647 |
MA_API ma_result ma_linear_resampler_process_pcm_frames(ma_linear_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut); |
| 1648 |
MA_API ma_result ma_linear_resampler_set_rate(ma_linear_resampler* pResampler, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut); |
| 1649 |
MA_API ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResampler, float ratioInOut); |
| 1650 |
MA_API ma_uint64 ma_linear_resampler_get_input_latency(const ma_linear_resampler* pResampler); |
| 1651 |
MA_API ma_uint64 ma_linear_resampler_get_output_latency(const ma_linear_resampler* pResampler); |
| 1652 |
MA_API ma_result ma_linear_resampler_get_required_input_frame_count(const ma_linear_resampler* pResampler, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount); |
| 1653 |
MA_API ma_result ma_linear_resampler_get_expected_output_frame_count(const ma_linear_resampler* pResampler, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount); |
| 1654 |
MA_API ma_result ma_linear_resampler_reset(ma_linear_resampler* pResampler); |
| 1655 |
|
| 1656 |
|
| 1657 |
typedef struct ma_resampler_config ma_resampler_config; |
| 1658 |
|
| 1659 |
typedef void ma_resampling_backend; |
| 1660 |
typedef struct |
| 1661 |
{ |
| 1662 |
ma_result (* onGetHeapSize )(void* pUserData, const ma_resampler_config* pConfig, size_t* pHeapSizeInBytes); |
| 1663 |
ma_result (* onInit )(void* pUserData, const ma_resampler_config* pConfig, void* pHeap, ma_resampling_backend** ppBackend); |
| 1664 |
void (* onUninit )(void* pUserData, ma_resampling_backend* pBackend, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1665 |
ma_result (* onProcess )(void* pUserData, ma_resampling_backend* pBackend, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut); |
| 1666 |
ma_result (* onSetRate )(void* pUserData, ma_resampling_backend* pBackend, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut); |
| 1667 |
ma_uint64 (* onGetInputLatency )(void* pUserData, const ma_resampling_backend* pBackend); |
| 1668 |
ma_uint64 (* onGetOutputLatency )(void* pUserData, const ma_resampling_backend* pBackend); |
| 1669 |
ma_result (* onGetRequiredInputFrameCount )(void* pUserData, const ma_resampling_backend* pBackend, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount); |
| 1670 |
ma_result (* onGetExpectedOutputFrameCount)(void* pUserData, const ma_resampling_backend* pBackend, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount); |
| 1671 |
ma_result (* onReset )(void* pUserData, ma_resampling_backend* pBackend); |
| 1672 |
} ma_resampling_backend_vtable; |
| 1673 |
|
| 1674 |
typedef enum |
| 1675 |
{ |
| 1676 |
ma_resample_algorithm_linear = 0, |
| 1677 |
ma_resample_algorithm_custom, |
| 1678 |
} ma_resample_algorithm; |
| 1679 |
|
| 1680 |
struct ma_resampler_config |
| 1681 |
{ |
| 1682 |
ma_format format; |
| 1683 |
ma_uint32 channels; |
| 1684 |
ma_uint32 sampleRateIn; |
| 1685 |
ma_uint32 sampleRateOut; |
| 1686 |
ma_resample_algorithm algorithm; |
| 1687 |
ma_resampling_backend_vtable* pBackendVTable; |
| 1688 |
void* pBackendUserData; |
| 1689 |
struct |
| 1690 |
{ |
| 1691 |
ma_uint32 lpfOrder; |
| 1692 |
} linear; |
| 1693 |
}; |
| 1694 |
|
| 1695 |
MA_API ma_resampler_config ma_resampler_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut, ma_resample_algorithm algorithm); |
| 1696 |
|
| 1697 |
typedef struct |
| 1698 |
{ |
| 1699 |
ma_resampling_backend* pBackend; |
| 1700 |
ma_resampling_backend_vtable* pBackendVTable; |
| 1701 |
void* pBackendUserData; |
| 1702 |
ma_format format; |
| 1703 |
ma_uint32 channels; |
| 1704 |
ma_uint32 sampleRateIn; |
| 1705 |
ma_uint32 sampleRateOut; |
| 1706 |
union |
| 1707 |
{ |
| 1708 |
ma_linear_resampler linear; |
| 1709 |
} state; |
| 1710 |
|
| 1711 |
|
| 1712 |
void* _pHeap; |
| 1713 |
ma_bool32 _ownsHeap; |
| 1714 |
} ma_resampler; |
| 1715 |
|
| 1716 |
MA_API ma_result ma_resampler_get_heap_size(const ma_resampler_config* pConfig, size_t* pHeapSizeInBytes); |
| 1717 |
MA_API ma_result ma_resampler_init_preallocated(const ma_resampler_config* pConfig, void* pHeap, ma_resampler* pResampler); |
| 1718 |
|
| 1719 |
|
| 1720 |
|
| 1721 |
|
| 1722 |
MA_API ma_result ma_resampler_init(const ma_resampler_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_resampler* pResampler); |
| 1723 |
|
| 1724 |
|
| 1725 |
|
| 1726 |
|
| 1727 |
MA_API void ma_resampler_uninit(ma_resampler* pResampler, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1728 |
|
| 1729 |
|
| 1730 |
|
| 1731 |
|
| 1732 |
|
| 1733 |
|
| 1734 |
|
| 1735 |
|
| 1736 |
|
| 1737 |
|
| 1738 |
|
| 1739 |
|
| 1740 |
|
| 1741 |
|
| 1742 |
|
| 1743 |
|
| 1744 |
|
| 1745 |
|
| 1746 |
|
| 1747 |
|
| 1748 |
|
| 1749 |
|
| 1750 |
|
| 1751 |
MA_API ma_result ma_resampler_process_pcm_frames(ma_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut); |
| 1752 |
|
| 1753 |
|
| 1754 |
|
| 1755 |
|
| 1756 |
|
| 1757 |
MA_API ma_result ma_resampler_set_rate(ma_resampler* pResampler, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut); |
| 1758 |
|
| 1759 |
|
| 1760 |
|
| 1761 |
|
| 1762 |
|
| 1763 |
|
| 1764 |
MA_API ma_result ma_resampler_set_rate_ratio(ma_resampler* pResampler, float ratio); |
| 1765 |
|
| 1766 |
|
| 1767 |
|
| 1768 |
|
| 1769 |
MA_API ma_uint64 ma_resampler_get_input_latency(const ma_resampler* pResampler); |
| 1770 |
|
| 1771 |
|
| 1772 |
|
| 1773 |
|
| 1774 |
MA_API ma_uint64 ma_resampler_get_output_latency(const ma_resampler* pResampler); |
| 1775 |
|
| 1776 |
|
| 1777 |
|
| 1778 |
|
| 1779 |
|
| 1780 |
|
| 1781 |
|
| 1782 |
|
| 1783 |
MA_API ma_result ma_resampler_get_required_input_frame_count(const ma_resampler* pResampler, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount); |
| 1784 |
|
| 1785 |
|
| 1786 |
|
| 1787 |
|
| 1788 |
|
| 1789 |
MA_API ma_result ma_resampler_get_expected_output_frame_count(const ma_resampler* pResampler, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount); |
| 1790 |
|
| 1791 |
|
| 1792 |
|
| 1793 |
|
| 1794 |
MA_API ma_result ma_resampler_reset(ma_resampler* pResampler); |
| 1795 |
|
| 1796 |
|
| 1797 |
|
| 1798 |
|
| 1799 |
|
| 1800 |
|
| 1801 |
|
| 1802 |
typedef enum |
| 1803 |
{ |
| 1804 |
ma_channel_conversion_path_unknown, |
| 1805 |
ma_channel_conversion_path_passthrough, |
| 1806 |
ma_channel_conversion_path_mono_out, |
| 1807 |
ma_channel_conversion_path_mono_in, |
| 1808 |
ma_channel_conversion_path_shuffle, |
| 1809 |
ma_channel_conversion_path_weights |
| 1810 |
} ma_channel_conversion_path; |
| 1811 |
|
| 1812 |
typedef enum |
| 1813 |
{ |
| 1814 |
ma_mono_expansion_mode_duplicate = 0, |
| 1815 |
ma_mono_expansion_mode_average, |
| 1816 |
ma_mono_expansion_mode_stereo_only, |
| 1817 |
ma_mono_expansion_mode_default = ma_mono_expansion_mode_duplicate |
| 1818 |
} ma_mono_expansion_mode; |
| 1819 |
|
| 1820 |
typedef struct |
| 1821 |
{ |
| 1822 |
ma_format format; |
| 1823 |
ma_uint32 channelsIn; |
| 1824 |
ma_uint32 channelsOut; |
| 1825 |
const ma_channel* pChannelMapIn; |
| 1826 |
const ma_channel* pChannelMapOut; |
| 1827 |
ma_channel_mix_mode mixingMode; |
| 1828 |
ma_bool32 calculateLFEFromSpatialChannels; |
| 1829 |
float** ppWeights; |
| 1830 |
} ma_channel_converter_config; |
| 1831 |
|
| 1832 |
MA_API ma_channel_converter_config ma_channel_converter_config_init(ma_format format, ma_uint32 channelsIn, const ma_channel* pChannelMapIn, ma_uint32 channelsOut, const ma_channel* pChannelMapOut, ma_channel_mix_mode mixingMode); |
| 1833 |
|
| 1834 |
typedef struct |
| 1835 |
{ |
| 1836 |
ma_format format; |
| 1837 |
ma_uint32 channelsIn; |
| 1838 |
ma_uint32 channelsOut; |
| 1839 |
ma_channel_mix_mode mixingMode; |
| 1840 |
ma_channel_conversion_path conversionPath; |
| 1841 |
ma_channel* pChannelMapIn; |
| 1842 |
ma_channel* pChannelMapOut; |
| 1843 |
ma_uint8* pShuffleTable; |
| 1844 |
union |
| 1845 |
{ |
| 1846 |
float** f32; |
| 1847 |
ma_int32** s16; |
| 1848 |
} weights; |
| 1849 |
|
| 1850 |
|
| 1851 |
void* _pHeap; |
| 1852 |
ma_bool32 _ownsHeap; |
| 1853 |
} ma_channel_converter; |
| 1854 |
|
| 1855 |
MA_API ma_result ma_channel_converter_get_heap_size(const ma_channel_converter_config* pConfig, size_t* pHeapSizeInBytes); |
| 1856 |
MA_API ma_result ma_channel_converter_init_preallocated(const ma_channel_converter_config* pConfig, void* pHeap, ma_channel_converter* pConverter); |
| 1857 |
MA_API ma_result ma_channel_converter_init(const ma_channel_converter_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_channel_converter* pConverter); |
| 1858 |
MA_API void ma_channel_converter_uninit(ma_channel_converter* pConverter, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1859 |
MA_API ma_result ma_channel_converter_process_pcm_frames(ma_channel_converter* pConverter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount); |
| 1860 |
MA_API ma_result ma_channel_converter_get_input_channel_map(const ma_channel_converter* pConverter, ma_channel* pChannelMap, size_t channelMapCap); |
| 1861 |
MA_API ma_result ma_channel_converter_get_output_channel_map(const ma_channel_converter* pConverter, ma_channel* pChannelMap, size_t channelMapCap); |
| 1862 |
|
| 1863 |
|
| 1864 |
|
| 1865 |
|
| 1866 |
|
| 1867 |
|
| 1868 |
|
| 1869 |
typedef struct |
| 1870 |
{ |
| 1871 |
ma_format formatIn; |
| 1872 |
ma_format formatOut; |
| 1873 |
ma_uint32 channelsIn; |
| 1874 |
ma_uint32 channelsOut; |
| 1875 |
ma_uint32 sampleRateIn; |
| 1876 |
ma_uint32 sampleRateOut; |
| 1877 |
ma_channel* pChannelMapIn; |
| 1878 |
ma_channel* pChannelMapOut; |
| 1879 |
ma_dither_mode ditherMode; |
| 1880 |
ma_channel_mix_mode channelMixMode; |
| 1881 |
ma_bool32 calculateLFEFromSpatialChannels; |
| 1882 |
float** ppChannelWeights; |
| 1883 |
ma_bool32 allowDynamicSampleRate; |
| 1884 |
ma_resampler_config resampling; |
| 1885 |
} ma_data_converter_config; |
| 1886 |
|
| 1887 |
MA_API ma_data_converter_config ma_data_converter_config_init_default(void); |
| 1888 |
MA_API ma_data_converter_config ma_data_converter_config_init(ma_format formatIn, ma_format formatOut, ma_uint32 channelsIn, ma_uint32 channelsOut, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut); |
| 1889 |
|
| 1890 |
|
| 1891 |
typedef enum |
| 1892 |
{ |
| 1893 |
ma_data_converter_execution_path_passthrough, |
| 1894 |
ma_data_converter_execution_path_format_only, |
| 1895 |
ma_data_converter_execution_path_channels_only, |
| 1896 |
ma_data_converter_execution_path_resample_only, |
| 1897 |
ma_data_converter_execution_path_resample_first, |
| 1898 |
ma_data_converter_execution_path_channels_first |
| 1899 |
} ma_data_converter_execution_path; |
| 1900 |
|
| 1901 |
typedef struct |
| 1902 |
{ |
| 1903 |
ma_format formatIn; |
| 1904 |
ma_format formatOut; |
| 1905 |
ma_uint32 channelsIn; |
| 1906 |
ma_uint32 channelsOut; |
| 1907 |
ma_uint32 sampleRateIn; |
| 1908 |
ma_uint32 sampleRateOut; |
| 1909 |
ma_dither_mode ditherMode; |
| 1910 |
ma_data_converter_execution_path executionPath; |
| 1911 |
ma_channel_converter channelConverter; |
| 1912 |
ma_resampler resampler; |
| 1913 |
ma_bool8 hasPreFormatConversion; |
| 1914 |
ma_bool8 hasPostFormatConversion; |
| 1915 |
ma_bool8 hasChannelConverter; |
| 1916 |
ma_bool8 hasResampler; |
| 1917 |
ma_bool8 isPassthrough; |
| 1918 |
|
| 1919 |
|
| 1920 |
ma_bool8 _ownsHeap; |
| 1921 |
void* _pHeap; |
| 1922 |
} ma_data_converter; |
| 1923 |
|
| 1924 |
MA_API ma_result ma_data_converter_get_heap_size(const ma_data_converter_config* pConfig, size_t* pHeapSizeInBytes); |
| 1925 |
MA_API ma_result ma_data_converter_init_preallocated(const ma_data_converter_config* pConfig, void* pHeap, ma_data_converter* pConverter); |
| 1926 |
MA_API ma_result ma_data_converter_init(const ma_data_converter_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_converter* pConverter); |
| 1927 |
MA_API void ma_data_converter_uninit(ma_data_converter* pConverter, const ma_allocation_callbacks* pAllocationCallbacks); |
| 1928 |
MA_API ma_result ma_data_converter_process_pcm_frames(ma_data_converter* pConverter, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut); |
| 1929 |
MA_API ma_result ma_data_converter_set_rate(ma_data_converter* pConverter, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut); |
| 1930 |
MA_API ma_result ma_data_converter_set_rate_ratio(ma_data_converter* pConverter, float ratioInOut); |
| 1931 |
MA_API ma_uint64 ma_data_converter_get_input_latency(const ma_data_converter* pConverter); |
| 1932 |
MA_API ma_uint64 ma_data_converter_get_output_latency(const ma_data_converter* pConverter); |
| 1933 |
MA_API ma_result ma_data_converter_get_required_input_frame_count(const ma_data_converter* pConverter, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount); |
| 1934 |
MA_API ma_result ma_data_converter_get_expected_output_frame_count(const ma_data_converter* pConverter, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount); |
| 1935 |
MA_API ma_result ma_data_converter_get_input_channel_map(const ma_data_converter* pConverter, ma_channel* pChannelMap, size_t channelMapCap); |
| 1936 |
MA_API ma_result ma_data_converter_get_output_channel_map(const ma_data_converter* pConverter, ma_channel* pChannelMap, size_t channelMapCap); |
| 1937 |
MA_API ma_result ma_data_converter_reset(ma_data_converter* pConverter); |
| 1938 |
|
| 1939 |
|
| 1940 |
|
| 1941 |
|
| 1942 |
|
| 1943 |
|
| 1944 |
|
| 1945 |
MA_API void ma_pcm_u8_to_s16(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1946 |
MA_API void ma_pcm_u8_to_s24(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1947 |
MA_API void ma_pcm_u8_to_s32(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1948 |
MA_API void ma_pcm_u8_to_f32(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1949 |
MA_API void ma_pcm_s16_to_u8(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1950 |
MA_API void ma_pcm_s16_to_s24(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1951 |
MA_API void ma_pcm_s16_to_s32(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1952 |
MA_API void ma_pcm_s16_to_f32(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1953 |
MA_API void ma_pcm_s24_to_u8(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1954 |
MA_API void ma_pcm_s24_to_s16(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1955 |
MA_API void ma_pcm_s24_to_s32(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1956 |
MA_API void ma_pcm_s24_to_f32(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1957 |
MA_API void ma_pcm_s32_to_u8(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1958 |
MA_API void ma_pcm_s32_to_s16(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1959 |
MA_API void ma_pcm_s32_to_s24(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1960 |
MA_API void ma_pcm_s32_to_f32(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1961 |
MA_API void ma_pcm_f32_to_u8(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1962 |
MA_API void ma_pcm_f32_to_s16(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1963 |
MA_API void ma_pcm_f32_to_s24(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1964 |
MA_API void ma_pcm_f32_to_s32(void* pOut, const void* pIn, ma_uint64 count, ma_dither_mode ditherMode); |
| 1965 |
MA_API void ma_pcm_convert(void* pOut, ma_format formatOut, const void* pIn, ma_format formatIn, ma_uint64 sampleCount, ma_dither_mode ditherMode); |
| 1966 |
MA_API void ma_convert_pcm_frames_format(void* pOut, ma_format formatOut, const void* pIn, ma_format formatIn, ma_uint64 frameCount, ma_uint32 channels, ma_dither_mode ditherMode); |
| 1967 |
|
| 1968 |
|
| 1969 |
|
| 1970 |
|
| 1971 |
MA_API void ma_deinterleave_pcm_frames(ma_format format, ma_uint32 channels, ma_uint64 frameCount, const void* pInterleavedPCMFrames, void** ppDeinterleavedPCMFrames); |
| 1972 |
|
| 1973 |
|
| 1974 |
|
| 1975 |
|
| 1976 |
MA_API void ma_interleave_pcm_frames(ma_format format, ma_uint32 channels, ma_uint64 frameCount, const void** ppDeinterleavedPCMFrames, void* pInterleavedPCMFrames); |
| 1977 |
|
| 1978 |
|
| 1979 |
|
| 1980 |
|
| 1981 |
|
| 1982 |
|
| 1983 |
|
| 1984 |
|
| 1985 |
|
| 1986 |
|
| 1987 |
#define MA_CHANNEL_INDEX_NULL 255 |
| 1988 |
|
| 1989 |
|
| 1990 |
|
| 1991 |
|
| 1992 |
|
| 1993 |
|
| 1994 |
MA_API ma_channel ma_channel_map_get_channel(const ma_channel* pChannelMap, ma_uint32 channelCount, ma_uint32 channelIndex); |
| 1995 |
|
| 1996 |
|
| 1997 |
|
| 1998 |
|
| 1999 |
|
| 2000 |
|
| 2001 |
MA_API void ma_channel_map_init_blank(ma_channel* pChannelMap, ma_uint32 channels); |
| 2002 |
|
| 2003 |
|
| 2004 |
|
| 2005 |
|
| 2006 |
|
| 2007 |
|
| 2008 |
MA_API void ma_channel_map_init_standard(ma_standard_channel_map standardChannelMap, ma_channel* pChannelMap, size_t channelMapCap, ma_uint32 channels); |
| 2009 |
|
| 2010 |
|
| 2011 |
|
| 2012 |
|
| 2013 |
|
| 2014 |
|
| 2015 |
MA_API void ma_channel_map_copy(ma_channel* pOut, const ma_channel* pIn, ma_uint32 channels); |
| 2016 |
|
| 2017 |
|
| 2018 |
|
| 2019 |
|
| 2020 |
|
| 2021 |
|
| 2022 |
MA_API void ma_channel_map_copy_or_default(ma_channel* pOut, size_t channelMapCapOut, const ma_channel* pIn, ma_uint32 channels); |
| 2023 |
|
| 2024 |
|
| 2025 |
|
| 2026 |
|
| 2027 |
|
| 2028 |
|
| 2029 |
|
| 2030 |
|
| 2031 |
|
| 2032 |
|
| 2033 |
|
| 2034 |
|
| 2035 |
|
| 2036 |
|
| 2037 |
MA_API ma_bool32 ma_channel_map_is_valid(const ma_channel* pChannelMap, ma_uint32 channels); |
| 2038 |
|
| 2039 |
|
| 2040 |
|
| 2041 |
|
| 2042 |
|
| 2043 |
|
| 2044 |
|
| 2045 |
|
| 2046 |
MA_API ma_bool32 ma_channel_map_is_equal(const ma_channel* pChannelMapA, const ma_channel* pChannelMapB, ma_uint32 channels); |
| 2047 |
|
| 2048 |
|
| 2049 |
|
| 2050 |
|
| 2051 |
|
| 2052 |
|
| 2053 |
MA_API ma_bool32 ma_channel_map_is_blank(const ma_channel* pChannelMap, ma_uint32 channels); |
| 2054 |
|
| 2055 |
|
| 2056 |
|
| 2057 |
|
| 2058 |
|
| 2059 |
|
| 2060 |
MA_API ma_bool32 ma_channel_map_contains_channel_position(ma_uint32 channels, const ma_channel* pChannelMap, ma_channel channelPosition); |
| 2061 |
|
| 2062 |
|
| 2063 |
|
| 2064 |
|
| 2065 |
|
| 2066 |
|
| 2067 |
|
| 2068 |
MA_API ma_bool32 ma_channel_map_find_channel_position(ma_uint32 channels, const ma_channel* pChannelMap, ma_channel channelPosition, ma_uint32* pChannelIndex); |
| 2069 |
|
| 2070 |
|
| 2071 |
|
| 2072 |
|
| 2073 |
|
| 2074 |
|
| 2075 |
|
| 2076 |
|
| 2077 |
MA_API size_t ma_channel_map_to_string(const ma_channel* pChannelMap, ma_uint32 channels, char* pBufferOut, size_t bufferCap); |
| 2078 |
|
| 2079 |
|
| 2080 |
|
| 2081 |
|
| 2082 |
MA_API const char* ma_channel_position_to_string(ma_channel channel); |
| 2083 |
|
| 2084 |
|
| 2085 |
|
| 2086 |
|
| 2087 |
|
| 2088 |
|
| 2089 |
|
| 2090 |
|
| 2091 |
|
| 2092 |
|
| 2093 |
|
| 2094 |
|
| 2095 |
|
| 2096 |
|
| 2097 |
|
| 2098 |
|
| 2099 |
|
| 2100 |
MA_API ma_uint64 ma_convert_frames(void* pOut, ma_uint64 frameCountOut, ma_format formatOut, ma_uint32 channelsOut, ma_uint32 sampleRateOut, const void* pIn, ma_uint64 frameCountIn, ma_format formatIn, ma_uint32 channelsIn, ma_uint32 sampleRateIn); |
| 2101 |
MA_API ma_uint64 ma_convert_frames_ex(void* pOut, ma_uint64 frameCountOut, const void* pIn, ma_uint64 frameCountIn, const ma_data_converter_config* pConfig); |
| 2102 |
|
| 2103 |
|
| 2104 |
|
| 2105 |
|
| 2106 |
|
| 2107 |
|
| 2108 |
|
| 2109 |
typedef void ma_data_source; |
| 2110 |
|
| 2111 |
#define MA_DATA_SOURCE_SELF_MANAGED_RANGE_AND_LOOP_POINT 0x00000001 |
| 2112 |
|
| 2113 |
typedef struct |
| 2114 |
{ |
| 2115 |
ma_result (* onRead)(ma_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 2116 |
ma_result (* onSeek)(ma_data_source* pDataSource, ma_uint64 frameIndex); |
| 2117 |
ma_result (* onGetDataFormat)(ma_data_source* pDataSource, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap); |
| 2118 |
ma_result (* onGetCursor)(ma_data_source* pDataSource, ma_uint64* pCursor); |
| 2119 |
ma_result (* onGetLength)(ma_data_source* pDataSource, ma_uint64* pLength); |
| 2120 |
ma_result (* onSetLooping)(ma_data_source* pDataSource, ma_bool32 isLooping); |
| 2121 |
ma_uint32 flags; |
| 2122 |
} ma_data_source_vtable; |
| 2123 |
|
| 2124 |
typedef ma_data_source* (* ma_data_source_get_next_proc)(ma_data_source* pDataSource); |
| 2125 |
|
| 2126 |
typedef struct |
| 2127 |
{ |
| 2128 |
const ma_data_source_vtable* vtable; |
| 2129 |
} ma_data_source_config; |
| 2130 |
|
| 2131 |
MA_API ma_data_source_config ma_data_source_config_init(void); |
| 2132 |
|
| 2133 |
|
| 2134 |
typedef struct |
| 2135 |
{ |
| 2136 |
const ma_data_source_vtable* vtable; |
| 2137 |
ma_uint64 rangeBegInFrames; |
| 2138 |
ma_uint64 rangeEndInFrames; |
| 2139 |
ma_uint64 loopBegInFrames; |
| 2140 |
ma_uint64 loopEndInFrames; |
| 2141 |
ma_data_source* pCurrent; |
| 2142 |
ma_data_source* pNext; |
| 2143 |
ma_data_source_get_next_proc onGetNext; |
| 2144 |
MA_ATOMIC(4, ma_bool32) isLooping; |
| 2145 |
} ma_data_source_base; |
| 2146 |
|
| 2147 |
MA_API ma_result ma_data_source_init(const ma_data_source_config* pConfig, ma_data_source* pDataSource); |
| 2148 |
MA_API void ma_data_source_uninit(ma_data_source* pDataSource); |
| 2149 |
MA_API ma_result ma_data_source_read_pcm_frames(ma_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 2150 |
MA_API ma_result ma_data_source_seek_pcm_frames(ma_data_source* pDataSource, ma_uint64 frameCount, ma_uint64* pFramesSeeked); |
| 2151 |
MA_API ma_result ma_data_source_seek_to_pcm_frame(ma_data_source* pDataSource, ma_uint64 frameIndex); |
| 2152 |
MA_API ma_result ma_data_source_seek_seconds(ma_data_source* pDataSource, float secondCount, float* pSecondsSeeked); |
| 2153 |
MA_API ma_result ma_data_source_seek_to_second(ma_data_source* pDataSource, float seekPointInSeconds); |
| 2154 |
MA_API ma_result ma_data_source_get_data_format(ma_data_source* pDataSource, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap); |
| 2155 |
MA_API ma_result ma_data_source_get_cursor_in_pcm_frames(ma_data_source* pDataSource, ma_uint64* pCursor); |
| 2156 |
MA_API ma_result ma_data_source_get_length_in_pcm_frames(ma_data_source* pDataSource, ma_uint64* pLength); |
| 2157 |
MA_API ma_result ma_data_source_get_cursor_in_seconds(ma_data_source* pDataSource, float* pCursor); |
| 2158 |
MA_API ma_result ma_data_source_get_length_in_seconds(ma_data_source* pDataSource, float* pLength); |
| 2159 |
MA_API ma_result ma_data_source_set_looping(ma_data_source* pDataSource, ma_bool32 isLooping); |
| 2160 |
MA_API ma_bool32 ma_data_source_is_looping(const ma_data_source* pDataSource); |
| 2161 |
MA_API ma_result ma_data_source_set_range_in_pcm_frames(ma_data_source* pDataSource, ma_uint64 rangeBegInFrames, ma_uint64 rangeEndInFrames); |
| 2162 |
MA_API void ma_data_source_get_range_in_pcm_frames(const ma_data_source* pDataSource, ma_uint64* pRangeBegInFrames, ma_uint64* pRangeEndInFrames); |
| 2163 |
MA_API ma_result ma_data_source_set_loop_point_in_pcm_frames(ma_data_source* pDataSource, ma_uint64 loopBegInFrames, ma_uint64 loopEndInFrames); |
| 2164 |
MA_API void ma_data_source_get_loop_point_in_pcm_frames(const ma_data_source* pDataSource, ma_uint64* pLoopBegInFrames, ma_uint64* pLoopEndInFrames); |
| 2165 |
MA_API ma_result ma_data_source_set_current(ma_data_source* pDataSource, ma_data_source* pCurrentDataSource); |
| 2166 |
MA_API ma_data_source* ma_data_source_get_current(const ma_data_source* pDataSource); |
| 2167 |
MA_API ma_result ma_data_source_set_next(ma_data_source* pDataSource, ma_data_source* pNextDataSource); |
| 2168 |
MA_API ma_data_source* ma_data_source_get_next(const ma_data_source* pDataSource); |
| 2169 |
MA_API ma_result ma_data_source_set_next_callback(ma_data_source* pDataSource, ma_data_source_get_next_proc onGetNext); |
| 2170 |
MA_API ma_data_source_get_next_proc ma_data_source_get_next_callback(const ma_data_source* pDataSource); |
| 2171 |
|
| 2172 |
|
| 2173 |
typedef struct |
| 2174 |
{ |
| 2175 |
ma_data_source_base ds; |
| 2176 |
ma_format format; |
| 2177 |
ma_uint32 channels; |
| 2178 |
ma_uint32 sampleRate; |
| 2179 |
ma_uint64 cursor; |
| 2180 |
ma_uint64 sizeInFrames; |
| 2181 |
const void* pData; |
| 2182 |
} ma_audio_buffer_ref; |
| 2183 |
|
| 2184 |
MA_API ma_result ma_audio_buffer_ref_init(ma_format format, ma_uint32 channels, const void* pData, ma_uint64 sizeInFrames, ma_audio_buffer_ref* pAudioBufferRef); |
| 2185 |
MA_API void ma_audio_buffer_ref_uninit(ma_audio_buffer_ref* pAudioBufferRef); |
| 2186 |
MA_API ma_result ma_audio_buffer_ref_set_data(ma_audio_buffer_ref* pAudioBufferRef, const void* pData, ma_uint64 sizeInFrames); |
| 2187 |
MA_API ma_uint64 ma_audio_buffer_ref_read_pcm_frames(ma_audio_buffer_ref* pAudioBufferRef, void* pFramesOut, ma_uint64 frameCount, ma_bool32 loop); |
| 2188 |
MA_API ma_result ma_audio_buffer_ref_seek_to_pcm_frame(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64 frameIndex); |
| 2189 |
MA_API ma_result ma_audio_buffer_ref_map(ma_audio_buffer_ref* pAudioBufferRef, void** ppFramesOut, ma_uint64* pFrameCount); |
| 2190 |
MA_API ma_result ma_audio_buffer_ref_unmap(ma_audio_buffer_ref* pAudioBufferRef, ma_uint64 frameCount); |
| 2191 |
MA_API ma_bool32 ma_audio_buffer_ref_at_end(const ma_audio_buffer_ref* pAudioBufferRef); |
| 2192 |
MA_API ma_result ma_audio_buffer_ref_get_cursor_in_pcm_frames(const ma_audio_buffer_ref* pAudioBufferRef, ma_uint64* pCursor); |
| 2193 |
MA_API ma_result ma_audio_buffer_ref_get_length_in_pcm_frames(const ma_audio_buffer_ref* pAudioBufferRef, ma_uint64* pLength); |
| 2194 |
MA_API ma_result ma_audio_buffer_ref_get_available_frames(const ma_audio_buffer_ref* pAudioBufferRef, ma_uint64* pAvailableFrames); |
| 2195 |
|
| 2196 |
|
| 2197 |
|
| 2198 |
typedef struct |
| 2199 |
{ |
| 2200 |
ma_format format; |
| 2201 |
ma_uint32 channels; |
| 2202 |
ma_uint32 sampleRate; |
| 2203 |
ma_uint64 sizeInFrames; |
| 2204 |
const void* pData; |
| 2205 |
ma_allocation_callbacks allocationCallbacks; |
| 2206 |
} ma_audio_buffer_config; |
| 2207 |
|
| 2208 |
MA_API ma_audio_buffer_config ma_audio_buffer_config_init(ma_format format, ma_uint32 channels, ma_uint64 sizeInFrames, const void* pData, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2209 |
|
| 2210 |
typedef struct |
| 2211 |
{ |
| 2212 |
ma_audio_buffer_ref ref; |
| 2213 |
ma_allocation_callbacks allocationCallbacks; |
| 2214 |
ma_bool32 ownsData; |
| 2215 |
ma_uint8 _pExtraData[1]; |
| 2216 |
} ma_audio_buffer; |
| 2217 |
|
| 2218 |
MA_API ma_result ma_audio_buffer_init(const ma_audio_buffer_config* pConfig, ma_audio_buffer* pAudioBuffer); |
| 2219 |
MA_API ma_result ma_audio_buffer_init_copy(const ma_audio_buffer_config* pConfig, ma_audio_buffer* pAudioBuffer); |
| 2220 |
MA_API ma_result ma_audio_buffer_alloc_and_init(const ma_audio_buffer_config* pConfig, ma_audio_buffer** ppAudioBuffer); |
| 2221 |
MA_API void ma_audio_buffer_uninit(ma_audio_buffer* pAudioBuffer); |
| 2222 |
MA_API void ma_audio_buffer_uninit_and_free(ma_audio_buffer* pAudioBuffer); |
| 2223 |
MA_API ma_uint64 ma_audio_buffer_read_pcm_frames(ma_audio_buffer* pAudioBuffer, void* pFramesOut, ma_uint64 frameCount, ma_bool32 loop); |
| 2224 |
MA_API ma_result ma_audio_buffer_seek_to_pcm_frame(ma_audio_buffer* pAudioBuffer, ma_uint64 frameIndex); |
| 2225 |
MA_API ma_result ma_audio_buffer_map(ma_audio_buffer* pAudioBuffer, void** ppFramesOut, ma_uint64* pFrameCount); |
| 2226 |
MA_API ma_result ma_audio_buffer_unmap(ma_audio_buffer* pAudioBuffer, ma_uint64 frameCount); |
| 2227 |
MA_API ma_bool32 ma_audio_buffer_at_end(const ma_audio_buffer* pAudioBuffer); |
| 2228 |
MA_API ma_result ma_audio_buffer_get_cursor_in_pcm_frames(const ma_audio_buffer* pAudioBuffer, ma_uint64* pCursor); |
| 2229 |
MA_API ma_result ma_audio_buffer_get_length_in_pcm_frames(const ma_audio_buffer* pAudioBuffer, ma_uint64* pLength); |
| 2230 |
MA_API ma_result ma_audio_buffer_get_available_frames(const ma_audio_buffer* pAudioBuffer, ma_uint64* pAvailableFrames); |
| 2231 |
|
| 2232 |
|
| 2233 |
|
| 2234 |
|
| 2235 |
|
| 2236 |
|
| 2237 |
|
| 2238 |
|
| 2239 |
|
| 2240 |
|
| 2241 |
|
| 2242 |
|
| 2243 |
|
| 2244 |
typedef struct ma_paged_audio_buffer_page ma_paged_audio_buffer_page; |
| 2245 |
struct ma_paged_audio_buffer_page |
| 2246 |
{ |
| 2247 |
MA_ATOMIC(MA_SIZEOF_PTR, ma_paged_audio_buffer_page*) pNext; |
| 2248 |
ma_uint64 sizeInFrames; |
| 2249 |
ma_uint8 pAudioData[1]; |
| 2250 |
}; |
| 2251 |
|
| 2252 |
typedef struct |
| 2253 |
{ |
| 2254 |
ma_format format; |
| 2255 |
ma_uint32 channels; |
| 2256 |
ma_paged_audio_buffer_page head; |
| 2257 |
MA_ATOMIC(MA_SIZEOF_PTR, ma_paged_audio_buffer_page*) pTail; |
| 2258 |
} ma_paged_audio_buffer_data; |
| 2259 |
|
| 2260 |
MA_API ma_result ma_paged_audio_buffer_data_init(ma_format format, ma_uint32 channels, ma_paged_audio_buffer_data* pData); |
| 2261 |
MA_API void ma_paged_audio_buffer_data_uninit(ma_paged_audio_buffer_data* pData, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2262 |
MA_API ma_paged_audio_buffer_page* ma_paged_audio_buffer_data_get_head(ma_paged_audio_buffer_data* pData); |
| 2263 |
MA_API ma_paged_audio_buffer_page* ma_paged_audio_buffer_data_get_tail(ma_paged_audio_buffer_data* pData); |
| 2264 |
MA_API ma_result ma_paged_audio_buffer_data_get_length_in_pcm_frames(ma_paged_audio_buffer_data* pData, ma_uint64* pLength); |
| 2265 |
MA_API ma_result ma_paged_audio_buffer_data_allocate_page(ma_paged_audio_buffer_data* pData, ma_uint64 pageSizeInFrames, const void* pInitialData, const ma_allocation_callbacks* pAllocationCallbacks, ma_paged_audio_buffer_page** ppPage); |
| 2266 |
MA_API ma_result ma_paged_audio_buffer_data_free_page(ma_paged_audio_buffer_data* pData, ma_paged_audio_buffer_page* pPage, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2267 |
MA_API ma_result ma_paged_audio_buffer_data_append_page(ma_paged_audio_buffer_data* pData, ma_paged_audio_buffer_page* pPage); |
| 2268 |
MA_API ma_result ma_paged_audio_buffer_data_allocate_and_append_page(ma_paged_audio_buffer_data* pData, ma_uint32 pageSizeInFrames, const void* pInitialData, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2269 |
|
| 2270 |
|
| 2271 |
typedef struct |
| 2272 |
{ |
| 2273 |
ma_paged_audio_buffer_data* pData; |
| 2274 |
} ma_paged_audio_buffer_config; |
| 2275 |
|
| 2276 |
MA_API ma_paged_audio_buffer_config ma_paged_audio_buffer_config_init(ma_paged_audio_buffer_data* pData); |
| 2277 |
|
| 2278 |
|
| 2279 |
typedef struct |
| 2280 |
{ |
| 2281 |
ma_data_source_base ds; |
| 2282 |
ma_paged_audio_buffer_data* pData; |
| 2283 |
ma_paged_audio_buffer_page* pCurrent; |
| 2284 |
ma_uint64 relativeCursor; |
| 2285 |
ma_uint64 absoluteCursor; |
| 2286 |
} ma_paged_audio_buffer; |
| 2287 |
|
| 2288 |
MA_API ma_result ma_paged_audio_buffer_init(const ma_paged_audio_buffer_config* pConfig, ma_paged_audio_buffer* pPagedAudioBuffer); |
| 2289 |
MA_API void ma_paged_audio_buffer_uninit(ma_paged_audio_buffer* pPagedAudioBuffer); |
| 2290 |
MA_API ma_result ma_paged_audio_buffer_read_pcm_frames(ma_paged_audio_buffer* pPagedAudioBuffer, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 2291 |
MA_API ma_result ma_paged_audio_buffer_seek_to_pcm_frame(ma_paged_audio_buffer* pPagedAudioBuffer, ma_uint64 frameIndex); |
| 2292 |
MA_API ma_result ma_paged_audio_buffer_get_cursor_in_pcm_frames(ma_paged_audio_buffer* pPagedAudioBuffer, ma_uint64* pCursor); |
| 2293 |
MA_API ma_result ma_paged_audio_buffer_get_length_in_pcm_frames(ma_paged_audio_buffer* pPagedAudioBuffer, ma_uint64* pLength); |
| 2294 |
|
| 2295 |
|
| 2296 |
|
| 2297 |
|
| 2298 |
|
| 2299 |
|
| 2300 |
|
| 2301 |
|
| 2302 |
typedef struct |
| 2303 |
{ |
| 2304 |
void* pBuffer; |
| 2305 |
ma_uint32 subbufferSizeInBytes; |
| 2306 |
ma_uint32 subbufferCount; |
| 2307 |
ma_uint32 subbufferStrideInBytes; |
| 2308 |
MA_ATOMIC(4, ma_uint32) encodedReadOffset; |
| 2309 |
MA_ATOMIC(4, ma_uint32) encodedWriteOffset; |
| 2310 |
ma_bool8 ownsBuffer; |
| 2311 |
ma_bool8 clearOnWriteAcquire; |
| 2312 |
ma_allocation_callbacks allocationCallbacks; |
| 2313 |
} ma_rb; |
| 2314 |
|
| 2315 |
MA_API ma_result ma_rb_init_ex(size_t subbufferSizeInBytes, size_t subbufferCount, size_t subbufferStrideInBytes, void* pOptionalPreallocatedBuffer, const ma_allocation_callbacks* pAllocationCallbacks, ma_rb* pRB); |
| 2316 |
MA_API ma_result ma_rb_init(size_t bufferSizeInBytes, void* pOptionalPreallocatedBuffer, const ma_allocation_callbacks* pAllocationCallbacks, ma_rb* pRB); |
| 2317 |
MA_API void ma_rb_uninit(ma_rb* pRB); |
| 2318 |
MA_API void ma_rb_reset(ma_rb* pRB); |
| 2319 |
MA_API ma_result ma_rb_acquire_read(ma_rb* pRB, size_t* pSizeInBytes, void** ppBufferOut); |
| 2320 |
MA_API ma_result ma_rb_commit_read(ma_rb* pRB, size_t sizeInBytes); |
| 2321 |
MA_API ma_result ma_rb_acquire_write(ma_rb* pRB, size_t* pSizeInBytes, void** ppBufferOut); |
| 2322 |
MA_API ma_result ma_rb_commit_write(ma_rb* pRB, size_t sizeInBytes); |
| 2323 |
MA_API ma_result ma_rb_seek_read(ma_rb* pRB, size_t offsetInBytes); |
| 2324 |
MA_API ma_result ma_rb_seek_write(ma_rb* pRB, size_t offsetInBytes); |
| 2325 |
MA_API ma_int32 ma_rb_pointer_distance(ma_rb* pRB); |
| 2326 |
MA_API ma_uint32 ma_rb_available_read(ma_rb* pRB); |
| 2327 |
MA_API ma_uint32 ma_rb_available_write(ma_rb* pRB); |
| 2328 |
MA_API size_t ma_rb_get_subbuffer_size(ma_rb* pRB); |
| 2329 |
MA_API size_t ma_rb_get_subbuffer_stride(ma_rb* pRB); |
| 2330 |
MA_API size_t ma_rb_get_subbuffer_offset(ma_rb* pRB, size_t subbufferIndex); |
| 2331 |
MA_API void* ma_rb_get_subbuffer_ptr(ma_rb* pRB, size_t subbufferIndex, void* pBuffer); |
| 2332 |
|
| 2333 |
|
| 2334 |
typedef struct |
| 2335 |
{ |
| 2336 |
ma_data_source_base ds; |
| 2337 |
ma_rb rb; |
| 2338 |
ma_format format; |
| 2339 |
ma_uint32 channels; |
| 2340 |
ma_uint32 sampleRate; |
| 2341 |
} ma_pcm_rb; |
| 2342 |
|
| 2343 |
MA_API ma_result ma_pcm_rb_init_ex(ma_format format, ma_uint32 channels, ma_uint32 subbufferSizeInFrames, ma_uint32 subbufferCount, ma_uint32 subbufferStrideInFrames, void* pOptionalPreallocatedBuffer, const ma_allocation_callbacks* pAllocationCallbacks, ma_pcm_rb* pRB); |
| 2344 |
MA_API ma_result ma_pcm_rb_init(ma_format format, ma_uint32 channels, ma_uint32 bufferSizeInFrames, void* pOptionalPreallocatedBuffer, const ma_allocation_callbacks* pAllocationCallbacks, ma_pcm_rb* pRB); |
| 2345 |
MA_API void ma_pcm_rb_uninit(ma_pcm_rb* pRB); |
| 2346 |
MA_API void ma_pcm_rb_reset(ma_pcm_rb* pRB); |
| 2347 |
MA_API ma_result ma_pcm_rb_acquire_read(ma_pcm_rb* pRB, ma_uint32* pSizeInFrames, void** ppBufferOut); |
| 2348 |
MA_API ma_result ma_pcm_rb_commit_read(ma_pcm_rb* pRB, ma_uint32 sizeInFrames); |
| 2349 |
MA_API ma_result ma_pcm_rb_acquire_write(ma_pcm_rb* pRB, ma_uint32* pSizeInFrames, void** ppBufferOut); |
| 2350 |
MA_API ma_result ma_pcm_rb_commit_write(ma_pcm_rb* pRB, ma_uint32 sizeInFrames); |
| 2351 |
MA_API ma_result ma_pcm_rb_seek_read(ma_pcm_rb* pRB, ma_uint32 offsetInFrames); |
| 2352 |
MA_API ma_result ma_pcm_rb_seek_write(ma_pcm_rb* pRB, ma_uint32 offsetInFrames); |
| 2353 |
MA_API ma_int32 ma_pcm_rb_pointer_distance(ma_pcm_rb* pRB); |
| 2354 |
MA_API ma_uint32 ma_pcm_rb_available_read(ma_pcm_rb* pRB); |
| 2355 |
MA_API ma_uint32 ma_pcm_rb_available_write(ma_pcm_rb* pRB); |
| 2356 |
MA_API ma_uint32 ma_pcm_rb_get_subbuffer_size(ma_pcm_rb* pRB); |
| 2357 |
MA_API ma_uint32 ma_pcm_rb_get_subbuffer_stride(ma_pcm_rb* pRB); |
| 2358 |
MA_API ma_uint32 ma_pcm_rb_get_subbuffer_offset(ma_pcm_rb* pRB, ma_uint32 subbufferIndex); |
| 2359 |
MA_API void* ma_pcm_rb_get_subbuffer_ptr(ma_pcm_rb* pRB, ma_uint32 subbufferIndex, void* pBuffer); |
| 2360 |
MA_API ma_format ma_pcm_rb_get_format(const ma_pcm_rb* pRB); |
| 2361 |
MA_API ma_uint32 ma_pcm_rb_get_channels(const ma_pcm_rb* pRB); |
| 2362 |
MA_API ma_uint32 ma_pcm_rb_get_sample_rate(const ma_pcm_rb* pRB); |
| 2363 |
MA_API void ma_pcm_rb_set_sample_rate(ma_pcm_rb* pRB, ma_uint32 sampleRate); |
| 2364 |
|
| 2365 |
|
| 2366 |
|
| 2367 |
|
| 2368 |
|
| 2369 |
|
| 2370 |
|
| 2371 |
|
| 2372 |
|
| 2373 |
|
| 2374 |
|
| 2375 |
|
| 2376 |
typedef struct |
| 2377 |
{ |
| 2378 |
ma_pcm_rb rb; |
| 2379 |
} ma_duplex_rb; |
| 2380 |
|
| 2381 |
MA_API ma_result ma_duplex_rb_init(ma_format captureFormat, ma_uint32 captureChannels, ma_uint32 sampleRate, ma_uint32 captureInternalSampleRate, ma_uint32 captureInternalPeriodSizeInFrames, const ma_allocation_callbacks* pAllocationCallbacks, ma_duplex_rb* pRB); |
| 2382 |
MA_API ma_result ma_duplex_rb_uninit(ma_duplex_rb* pRB); |
| 2383 |
|
| 2384 |
|
| 2385 |
|
| 2386 |
|
| 2387 |
|
| 2388 |
|
| 2389 |
|
| 2390 |
|
| 2391 |
|
| 2392 |
|
| 2393 |
MA_API const char* ma_result_description(ma_result result); |
| 2394 |
|
| 2395 |
|
| 2396 |
|
| 2397 |
|
| 2398 |
MA_API void* ma_malloc(size_t sz, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2399 |
|
| 2400 |
|
| 2401 |
|
| 2402 |
|
| 2403 |
MA_API void* ma_calloc(size_t sz, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2404 |
|
| 2405 |
|
| 2406 |
|
| 2407 |
|
| 2408 |
MA_API void* ma_realloc(void* p, size_t sz, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2409 |
|
| 2410 |
|
| 2411 |
|
| 2412 |
|
| 2413 |
MA_API void ma_free(void* p, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2414 |
|
| 2415 |
|
| 2416 |
|
| 2417 |
|
| 2418 |
MA_API void* ma_aligned_malloc(size_t sz, size_t alignment, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2419 |
|
| 2420 |
|
| 2421 |
|
| 2422 |
|
| 2423 |
MA_API void ma_aligned_free(void* p, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2424 |
|
| 2425 |
|
| 2426 |
|
| 2427 |
|
| 2428 |
MA_API const char* ma_get_format_name(ma_format format); |
| 2429 |
|
| 2430 |
|
| 2431 |
|
| 2432 |
|
| 2433 |
MA_API void ma_blend_f32(float* pOut, float* pInA, float* pInB, float factor, ma_uint32 channels); |
| 2434 |
|
| 2435 |
|
| 2436 |
|
| 2437 |
|
| 2438 |
|
| 2439 |
|
| 2440 |
|
| 2441 |
|
| 2442 |
|
| 2443 |
MA_API ma_uint32 ma_get_bytes_per_sample(ma_format format); |
| 2444 |
static MA_INLINE ma_uint32 ma_get_bytes_per_frame(ma_format format, ma_uint32 channels) { return ma_get_bytes_per_sample(format) * channels; } |
| 2445 |
|
| 2446 |
|
| 2447 |
|
| 2448 |
|
| 2449 |
MA_API const char* ma_log_level_to_string(ma_uint32 logLevel); |
| 2450 |
|
| 2451 |
|
| 2452 |
|
| 2453 |
|
| 2454 |
|
| 2455 |
|
| 2456 |
|
| 2457 |
|
| 2458 |
|
| 2459 |
|
| 2460 |
|
| 2461 |
|
| 2462 |
MA_API ma_result ma_spinlock_lock(volatile ma_spinlock* pSpinlock); |
| 2463 |
|
| 2464 |
|
| 2465 |
|
| 2466 |
|
| 2467 |
MA_API ma_result ma_spinlock_lock_noyield(volatile ma_spinlock* pSpinlock); |
| 2468 |
|
| 2469 |
|
| 2470 |
|
| 2471 |
|
| 2472 |
MA_API ma_result ma_spinlock_unlock(volatile ma_spinlock* pSpinlock); |
| 2473 |
|
| 2474 |
|
| 2475 |
#ifndef MA_NO_THREADING |
| 2476 |
|
| 2477 |
|
| 2478 |
|
| 2479 |
|
| 2480 |
|
| 2481 |
|
| 2482 |
MA_API ma_result ma_mutex_init(ma_mutex* pMutex); |
| 2483 |
|
| 2484 |
|
| 2485 |
|
| 2486 |
|
| 2487 |
MA_API void ma_mutex_uninit(ma_mutex* pMutex); |
| 2488 |
|
| 2489 |
|
| 2490 |
|
| 2491 |
|
| 2492 |
MA_API void ma_mutex_lock(ma_mutex* pMutex); |
| 2493 |
|
| 2494 |
|
| 2495 |
|
| 2496 |
|
| 2497 |
MA_API void ma_mutex_unlock(ma_mutex* pMutex); |
| 2498 |
|
| 2499 |
|
| 2500 |
|
| 2501 |
|
| 2502 |
|
| 2503 |
MA_API ma_result ma_event_init(ma_event* pEvent); |
| 2504 |
|
| 2505 |
|
| 2506 |
|
| 2507 |
|
| 2508 |
MA_API void ma_event_uninit(ma_event* pEvent); |
| 2509 |
|
| 2510 |
|
| 2511 |
|
| 2512 |
|
| 2513 |
MA_API ma_result ma_event_wait(ma_event* pEvent); |
| 2514 |
|
| 2515 |
|
| 2516 |
|
| 2517 |
|
| 2518 |
MA_API ma_result ma_event_signal(ma_event* pEvent); |
| 2519 |
|
| 2520 |
|
| 2521 |
MA_API ma_result ma_semaphore_init(int initialValue, ma_semaphore* pSemaphore); |
| 2522 |
MA_API void ma_semaphore_uninit(ma_semaphore* pSemaphore); |
| 2523 |
MA_API ma_result ma_semaphore_wait(ma_semaphore* pSemaphore); |
| 2524 |
MA_API ma_result ma_semaphore_release(ma_semaphore* pSemaphore); |
| 2525 |
#endif |
| 2526 |
|
| 2527 |
|
| 2528 |
|
| 2529 |
|
| 2530 |
|
| 2531 |
|
| 2532 |
|
| 2533 |
|
| 2534 |
|
| 2535 |
|
| 2536 |
|
| 2537 |
|
| 2538 |
|
| 2539 |
|
| 2540 |
|
| 2541 |
|
| 2542 |
typedef struct |
| 2543 |
{ |
| 2544 |
#ifndef MA_NO_THREADING |
| 2545 |
ma_event e; |
| 2546 |
#endif |
| 2547 |
ma_uint32 counter; |
| 2548 |
} ma_fence; |
| 2549 |
|
| 2550 |
MA_API ma_result ma_fence_init(ma_fence* pFence); |
| 2551 |
MA_API void ma_fence_uninit(ma_fence* pFence); |
| 2552 |
MA_API ma_result ma_fence_acquire(ma_fence* pFence); |
| 2553 |
MA_API ma_result ma_fence_release(ma_fence* pFence); |
| 2554 |
MA_API ma_result ma_fence_wait(ma_fence* pFence); |
| 2555 |
|
| 2556 |
|
| 2557 |
|
| 2558 |
|
| 2559 |
|
| 2560 |
|
| 2561 |
typedef void ma_async_notification; |
| 2562 |
|
| 2563 |
typedef struct |
| 2564 |
{ |
| 2565 |
void (* onSignal)(ma_async_notification* pNotification); |
| 2566 |
} ma_async_notification_callbacks; |
| 2567 |
|
| 2568 |
MA_API ma_result ma_async_notification_signal(ma_async_notification* pNotification); |
| 2569 |
|
| 2570 |
|
| 2571 |
|
| 2572 |
|
| 2573 |
|
| 2574 |
|
| 2575 |
|
| 2576 |
typedef struct |
| 2577 |
{ |
| 2578 |
ma_async_notification_callbacks cb; |
| 2579 |
ma_bool32 signalled; |
| 2580 |
} ma_async_notification_poll; |
| 2581 |
|
| 2582 |
MA_API ma_result ma_async_notification_poll_init(ma_async_notification_poll* pNotificationPoll); |
| 2583 |
MA_API ma_bool32 ma_async_notification_poll_is_signalled(const ma_async_notification_poll* pNotificationPoll); |
| 2584 |
|
| 2585 |
|
| 2586 |
|
| 2587 |
|
| 2588 |
|
| 2589 |
|
| 2590 |
|
| 2591 |
typedef struct |
| 2592 |
{ |
| 2593 |
ma_async_notification_callbacks cb; |
| 2594 |
#ifndef MA_NO_THREADING |
| 2595 |
ma_event e; |
| 2596 |
#endif |
| 2597 |
} ma_async_notification_event; |
| 2598 |
|
| 2599 |
MA_API ma_result ma_async_notification_event_init(ma_async_notification_event* pNotificationEvent); |
| 2600 |
MA_API ma_result ma_async_notification_event_uninit(ma_async_notification_event* pNotificationEvent); |
| 2601 |
MA_API ma_result ma_async_notification_event_wait(ma_async_notification_event* pNotificationEvent); |
| 2602 |
MA_API ma_result ma_async_notification_event_signal(ma_async_notification_event* pNotificationEvent); |
| 2603 |
|
| 2604 |
|
| 2605 |
|
| 2606 |
|
| 2607 |
|
| 2608 |
|
| 2609 |
|
| 2610 |
|
| 2611 |
|
| 2612 |
|
| 2613 |
|
| 2614 |
|
| 2615 |
|
| 2616 |
|
| 2617 |
|
| 2618 |
|
| 2619 |
|
| 2620 |
|
| 2621 |
|
| 2622 |
|
| 2623 |
|
| 2624 |
|
| 2625 |
|
| 2626 |
|
| 2627 |
|
| 2628 |
|
| 2629 |
typedef struct |
| 2630 |
{ |
| 2631 |
ma_uint32 capacity; |
| 2632 |
} ma_slot_allocator_config; |
| 2633 |
|
| 2634 |
MA_API ma_slot_allocator_config ma_slot_allocator_config_init(ma_uint32 capacity); |
| 2635 |
|
| 2636 |
|
| 2637 |
typedef struct |
| 2638 |
{ |
| 2639 |
MA_ATOMIC(4, ma_uint32) bitfield; |
| 2640 |
} ma_slot_allocator_group; |
| 2641 |
|
| 2642 |
typedef struct |
| 2643 |
{ |
| 2644 |
ma_slot_allocator_group* pGroups; |
| 2645 |
ma_uint32* pSlots; |
| 2646 |
ma_uint32 count; |
| 2647 |
ma_uint32 capacity; |
| 2648 |
|
| 2649 |
|
| 2650 |
ma_bool32 _ownsHeap; |
| 2651 |
void* _pHeap; |
| 2652 |
} ma_slot_allocator; |
| 2653 |
|
| 2654 |
MA_API ma_result ma_slot_allocator_get_heap_size(const ma_slot_allocator_config* pConfig, size_t* pHeapSizeInBytes); |
| 2655 |
MA_API ma_result ma_slot_allocator_init_preallocated(const ma_slot_allocator_config* pConfig, void* pHeap, ma_slot_allocator* pAllocator); |
| 2656 |
MA_API ma_result ma_slot_allocator_init(const ma_slot_allocator_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_slot_allocator* pAllocator); |
| 2657 |
MA_API void ma_slot_allocator_uninit(ma_slot_allocator* pAllocator, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2658 |
MA_API ma_result ma_slot_allocator_alloc(ma_slot_allocator* pAllocator, ma_uint64* pSlot); |
| 2659 |
MA_API ma_result ma_slot_allocator_free(ma_slot_allocator* pAllocator, ma_uint64 slot); |
| 2660 |
|
| 2661 |
|
| 2662 |
typedef struct ma_job ma_job; |
| 2663 |
|
| 2664 |
|
| 2665 |
|
| 2666 |
|
| 2667 |
|
| 2668 |
typedef ma_result (* ma_job_proc)(ma_job* pJob); |
| 2669 |
|
| 2670 |
|
| 2671 |
typedef enum |
| 2672 |
{ |
| 2673 |
|
| 2674 |
MA_JOB_TYPE_QUIT = 0, |
| 2675 |
MA_JOB_TYPE_CUSTOM, |
| 2676 |
|
| 2677 |
|
| 2678 |
MA_JOB_TYPE_RESOURCE_MANAGER_LOAD_DATA_BUFFER_NODE, |
| 2679 |
MA_JOB_TYPE_RESOURCE_MANAGER_FREE_DATA_BUFFER_NODE, |
| 2680 |
MA_JOB_TYPE_RESOURCE_MANAGER_PAGE_DATA_BUFFER_NODE, |
| 2681 |
MA_JOB_TYPE_RESOURCE_MANAGER_LOAD_DATA_BUFFER, |
| 2682 |
MA_JOB_TYPE_RESOURCE_MANAGER_FREE_DATA_BUFFER, |
| 2683 |
MA_JOB_TYPE_RESOURCE_MANAGER_LOAD_DATA_STREAM, |
| 2684 |
MA_JOB_TYPE_RESOURCE_MANAGER_FREE_DATA_STREAM, |
| 2685 |
MA_JOB_TYPE_RESOURCE_MANAGER_PAGE_DATA_STREAM, |
| 2686 |
MA_JOB_TYPE_RESOURCE_MANAGER_SEEK_DATA_STREAM, |
| 2687 |
|
| 2688 |
|
| 2689 |
MA_JOB_TYPE_DEVICE_AAUDIO_REROUTE, |
| 2690 |
|
| 2691 |
|
| 2692 |
MA_JOB_TYPE_COUNT |
| 2693 |
} ma_job_type; |
| 2694 |
|
| 2695 |
struct ma_job |
| 2696 |
{ |
| 2697 |
union |
| 2698 |
{ |
| 2699 |
struct |
| 2700 |
{ |
| 2701 |
ma_uint16 code; |
| 2702 |
ma_uint16 slot; |
| 2703 |
ma_uint32 refcount; |
| 2704 |
} breakup; |
| 2705 |
ma_uint64 allocation; |
| 2706 |
} toc; |
| 2707 |
MA_ATOMIC(8, ma_uint64) next; |
| 2708 |
ma_uint32 order; |
| 2709 |
|
| 2710 |
union |
| 2711 |
{ |
| 2712 |
|
| 2713 |
struct |
| 2714 |
{ |
| 2715 |
ma_job_proc proc; |
| 2716 |
ma_uintptr data0; |
| 2717 |
ma_uintptr data1; |
| 2718 |
} custom; |
| 2719 |
|
| 2720 |
|
| 2721 |
union |
| 2722 |
{ |
| 2723 |
struct |
| 2724 |
{ |
| 2725 |
void* pResourceManager; |
| 2726 |
void* pDataBufferNode; |
| 2727 |
char* pFilePath; |
| 2728 |
wchar_t* pFilePathW; |
| 2729 |
ma_uint32 flags; |
| 2730 |
ma_async_notification* pInitNotification; |
| 2731 |
ma_async_notification* pDoneNotification; |
| 2732 |
ma_fence* pInitFence; |
| 2733 |
ma_fence* pDoneFence; |
| 2734 |
} loadDataBufferNode; |
| 2735 |
struct |
| 2736 |
{ |
| 2737 |
void* pResourceManager; |
| 2738 |
void* pDataBufferNode; |
| 2739 |
ma_async_notification* pDoneNotification; |
| 2740 |
ma_fence* pDoneFence; |
| 2741 |
} freeDataBufferNode; |
| 2742 |
struct |
| 2743 |
{ |
| 2744 |
void* pResourceManager; |
| 2745 |
void* pDataBufferNode; |
| 2746 |
void* pDecoder; |
| 2747 |
ma_async_notification* pDoneNotification; |
| 2748 |
ma_fence* pDoneFence; |
| 2749 |
} pageDataBufferNode; |
| 2750 |
|
| 2751 |
struct |
| 2752 |
{ |
| 2753 |
void* pDataBuffer; |
| 2754 |
ma_async_notification* pInitNotification; |
| 2755 |
ma_async_notification* pDoneNotification; |
| 2756 |
ma_fence* pInitFence; |
| 2757 |
ma_fence* pDoneFence; |
| 2758 |
ma_uint64 rangeBegInPCMFrames; |
| 2759 |
ma_uint64 rangeEndInPCMFrames; |
| 2760 |
ma_uint64 loopPointBegInPCMFrames; |
| 2761 |
ma_uint64 loopPointEndInPCMFrames; |
| 2762 |
ma_uint32 isLooping; |
| 2763 |
} loadDataBuffer; |
| 2764 |
struct |
| 2765 |
{ |
| 2766 |
void* pDataBuffer; |
| 2767 |
ma_async_notification* pDoneNotification; |
| 2768 |
ma_fence* pDoneFence; |
| 2769 |
} freeDataBuffer; |
| 2770 |
|
| 2771 |
struct |
| 2772 |
{ |
| 2773 |
void* pDataStream; |
| 2774 |
char* pFilePath; |
| 2775 |
wchar_t* pFilePathW; |
| 2776 |
ma_uint64 initialSeekPoint; |
| 2777 |
ma_async_notification* pInitNotification; |
| 2778 |
ma_fence* pInitFence; |
| 2779 |
} loadDataStream; |
| 2780 |
struct |
| 2781 |
{ |
| 2782 |
void* pDataStream; |
| 2783 |
ma_async_notification* pDoneNotification; |
| 2784 |
ma_fence* pDoneFence; |
| 2785 |
} freeDataStream; |
| 2786 |
struct |
| 2787 |
{ |
| 2788 |
void* pDataStream; |
| 2789 |
ma_uint32 pageIndex; |
| 2790 |
} pageDataStream; |
| 2791 |
struct |
| 2792 |
{ |
| 2793 |
void* pDataStream; |
| 2794 |
ma_uint64 frameIndex; |
| 2795 |
} seekDataStream; |
| 2796 |
} resourceManager; |
| 2797 |
|
| 2798 |
|
| 2799 |
union |
| 2800 |
{ |
| 2801 |
union |
| 2802 |
{ |
| 2803 |
struct |
| 2804 |
{ |
| 2805 |
void* pDevice; |
| 2806 |
ma_uint32 deviceType; |
| 2807 |
} reroute; |
| 2808 |
} aaudio; |
| 2809 |
} device; |
| 2810 |
} data; |
| 2811 |
}; |
| 2812 |
|
| 2813 |
MA_API ma_job ma_job_init(ma_uint16 code); |
| 2814 |
MA_API ma_result ma_job_process(ma_job* pJob); |
| 2815 |
|
| 2816 |
|
| 2817 |
|
| 2818 |
|
| 2819 |
|
| 2820 |
|
| 2821 |
|
| 2822 |
|
| 2823 |
typedef enum |
| 2824 |
{ |
| 2825 |
MA_JOB_QUEUE_FLAG_NON_BLOCKING = 0x00000001 |
| 2826 |
} ma_job_queue_flags; |
| 2827 |
|
| 2828 |
typedef struct |
| 2829 |
{ |
| 2830 |
ma_uint32 flags; |
| 2831 |
ma_uint32 capacity; |
| 2832 |
} ma_job_queue_config; |
| 2833 |
|
| 2834 |
MA_API ma_job_queue_config ma_job_queue_config_init(ma_uint32 flags, ma_uint32 capacity); |
| 2835 |
|
| 2836 |
|
| 2837 |
typedef struct |
| 2838 |
{ |
| 2839 |
ma_uint32 flags; |
| 2840 |
ma_uint32 capacity; |
| 2841 |
MA_ATOMIC(8, ma_uint64) head; |
| 2842 |
MA_ATOMIC(8, ma_uint64) tail; |
| 2843 |
#ifndef MA_NO_THREADING |
| 2844 |
ma_semaphore sem; |
| 2845 |
#endif |
| 2846 |
ma_slot_allocator allocator; |
| 2847 |
ma_job* pJobs; |
| 2848 |
#ifndef MA_USE_EXPERIMENTAL_LOCK_FREE_JOB_QUEUE |
| 2849 |
ma_spinlock lock; |
| 2850 |
#endif |
| 2851 |
|
| 2852 |
|
| 2853 |
void* _pHeap; |
| 2854 |
ma_bool32 _ownsHeap; |
| 2855 |
} ma_job_queue; |
| 2856 |
|
| 2857 |
MA_API ma_result ma_job_queue_get_heap_size(const ma_job_queue_config* pConfig, size_t* pHeapSizeInBytes); |
| 2858 |
MA_API ma_result ma_job_queue_init_preallocated(const ma_job_queue_config* pConfig, void* pHeap, ma_job_queue* pQueue); |
| 2859 |
MA_API ma_result ma_job_queue_init(const ma_job_queue_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_job_queue* pQueue); |
| 2860 |
MA_API void ma_job_queue_uninit(ma_job_queue* pQueue, const ma_allocation_callbacks* pAllocationCallbacks); |
| 2861 |
MA_API ma_result ma_job_queue_post(ma_job_queue* pQueue, const ma_job* pJob); |
| 2862 |
MA_API ma_result ma_job_queue_next(ma_job_queue* pQueue, ma_job* pJob); |
| 2863 |
|
| 2864 |
|
| 2865 |
|
| 2866 |
|
| 2867 |
|
| 2868 |
|
| 2869 |
|
| 2870 |
|
| 2871 |
|
| 2872 |
|
| 2873 |
|
| 2874 |
|
| 2875 |
|
| 2876 |
#ifndef MA_NO_DEVICE_IO |
| 2877 |
|
| 2878 |
#if defined(MA_WIN32) && !defined(MA_XBOX) |
| 2879 |
#define MA_SUPPORT_WASAPI |
| 2880 |
|
| 2881 |
#if defined(MA_WIN32_DESKTOP) |
| 2882 |
#define MA_SUPPORT_DSOUND |
| 2883 |
#define MA_SUPPORT_WINMM |
| 2884 |
#define MA_SUPPORT_JACK |
| 2885 |
#endif |
| 2886 |
#endif |
| 2887 |
#if defined(MA_UNIX) && !defined(MA_ORBIS) && !defined(MA_PROSPERO) |
| 2888 |
#if defined(MA_LINUX) |
| 2889 |
#if !defined(MA_ANDROID) && !defined(MA_EMSCRIPTEN) |
| 2890 |
#define MA_SUPPORT_ALSA |
| 2891 |
#endif |
| 2892 |
#endif |
| 2893 |
#if !defined(MA_BSD) && !defined(MA_ANDROID) && !defined(MA_EMSCRIPTEN) |
| 2894 |
#define MA_SUPPORT_PULSEAUDIO |
| 2895 |
#define MA_SUPPORT_JACK |
| 2896 |
#endif |
| 2897 |
#if defined(__OpenBSD__) |
| 2898 |
#define MA_SUPPORT_SNDIO |
| 2899 |
#endif |
| 2900 |
#if defined(__NetBSD__) || defined(__OpenBSD__) |
| 2901 |
#define MA_SUPPORT_AUDIO4 |
| 2902 |
#endif |
| 2903 |
#if defined(__FreeBSD__) || defined(__DragonFly__) |
| 2904 |
#define MA_SUPPORT_OSS |
| 2905 |
#endif |
| 2906 |
#endif |
| 2907 |
#if defined(MA_ANDROID) |
| 2908 |
#define MA_SUPPORT_AAUDIO |
| 2909 |
#define MA_SUPPORT_OPENSL |
| 2910 |
#endif |
| 2911 |
#if defined(MA_APPLE) |
| 2912 |
#define MA_SUPPORT_COREAUDIO |
| 2913 |
#endif |
| 2914 |
#if defined(MA_EMSCRIPTEN) |
| 2915 |
#define MA_SUPPORT_WEBAUDIO |
| 2916 |
#endif |
| 2917 |
|
| 2918 |
|
| 2919 |
#define MA_SUPPORT_CUSTOM |
| 2920 |
|
| 2921 |
|
| 2922 |
#if !defined(MA_EMSCRIPTEN) |
| 2923 |
#define MA_SUPPORT_NULL |
| 2924 |
#endif |
| 2925 |
|
| 2926 |
|
| 2927 |
#if defined(MA_SUPPORT_WASAPI) && !defined(MA_NO_WASAPI) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_WASAPI)) |
| 2928 |
#define MA_HAS_WASAPI |
| 2929 |
#endif |
| 2930 |
#if defined(MA_SUPPORT_DSOUND) && !defined(MA_NO_DSOUND) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_DSOUND)) |
| 2931 |
#define MA_HAS_DSOUND |
| 2932 |
#endif |
| 2933 |
#if defined(MA_SUPPORT_WINMM) && !defined(MA_NO_WINMM) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_WINMM)) |
| 2934 |
#define MA_HAS_WINMM |
| 2935 |
#endif |
| 2936 |
#if defined(MA_SUPPORT_ALSA) && !defined(MA_NO_ALSA) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_ALSA)) |
| 2937 |
#define MA_HAS_ALSA |
| 2938 |
#endif |
| 2939 |
#if defined(MA_SUPPORT_PULSEAUDIO) && !defined(MA_NO_PULSEAUDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_PULSEAUDIO)) |
| 2940 |
#define MA_HAS_PULSEAUDIO |
| 2941 |
#endif |
| 2942 |
#if defined(MA_SUPPORT_JACK) && !defined(MA_NO_JACK) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_JACK)) |
| 2943 |
#define MA_HAS_JACK |
| 2944 |
#endif |
| 2945 |
#if defined(MA_SUPPORT_COREAUDIO) && !defined(MA_NO_COREAUDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_COREAUDIO)) |
| 2946 |
#define MA_HAS_COREAUDIO |
| 2947 |
#endif |
| 2948 |
#if defined(MA_SUPPORT_SNDIO) && !defined(MA_NO_SNDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_SNDIO)) |
| 2949 |
#define MA_HAS_SNDIO |
| 2950 |
#endif |
| 2951 |
#if defined(MA_SUPPORT_AUDIO4) && !defined(MA_NO_AUDIO4) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_AUDIO4)) |
| 2952 |
#define MA_HAS_AUDIO4 |
| 2953 |
#endif |
| 2954 |
#if defined(MA_SUPPORT_OSS) && !defined(MA_NO_OSS) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_OSS)) |
| 2955 |
#define MA_HAS_OSS |
| 2956 |
#endif |
| 2957 |
#if defined(MA_SUPPORT_AAUDIO) && !defined(MA_NO_AAUDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_AAUDIO)) |
| 2958 |
#define MA_HAS_AAUDIO |
| 2959 |
#endif |
| 2960 |
#if defined(MA_SUPPORT_OPENSL) && !defined(MA_NO_OPENSL) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_OPENSL)) |
| 2961 |
#define MA_HAS_OPENSL |
| 2962 |
#endif |
| 2963 |
#if defined(MA_SUPPORT_WEBAUDIO) && !defined(MA_NO_WEBAUDIO) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_WEBAUDIO)) |
| 2964 |
#define MA_HAS_WEBAUDIO |
| 2965 |
#endif |
| 2966 |
#if defined(MA_SUPPORT_CUSTOM) && !defined(MA_NO_CUSTOM) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_CUSTOM)) |
| 2967 |
#define MA_HAS_CUSTOM |
| 2968 |
#endif |
| 2969 |
#if defined(MA_SUPPORT_NULL) && !defined(MA_NO_NULL) && (!defined(MA_ENABLE_ONLY_SPECIFIC_BACKENDS) || defined(MA_ENABLE_NULL)) |
| 2970 |
#define MA_HAS_NULL |
| 2971 |
#endif |
| 2972 |
|
| 2973 |
typedef enum |
| 2974 |
{ |
| 2975 |
ma_device_state_uninitialized = 0, |
| 2976 |
ma_device_state_stopped = 1, |
| 2977 |
ma_device_state_started = 2, |
| 2978 |
ma_device_state_starting = 3, |
| 2979 |
ma_device_state_stopping = 4 |
| 2980 |
} ma_device_state; |
| 2981 |
|
| 2982 |
MA_ATOMIC_SAFE_TYPE_DECL(i32, 4, device_state) |
| 2983 |
|
| 2984 |
|
| 2985 |
#ifdef MA_SUPPORT_WASAPI |
| 2986 |
|
| 2987 |
typedef struct |
| 2988 |
{ |
| 2989 |
void* lpVtbl; |
| 2990 |
ma_uint32 counter; |
| 2991 |
ma_device* pDevice; |
| 2992 |
} ma_IMMNotificationClient; |
| 2993 |
#endif |
| 2994 |
|
| 2995 |
|
| 2996 |
typedef enum |
| 2997 |
{ |
| 2998 |
ma_backend_wasapi, |
| 2999 |
ma_backend_dsound, |
| 3000 |
ma_backend_winmm, |
| 3001 |
ma_backend_coreaudio, |
| 3002 |
ma_backend_sndio, |
| 3003 |
ma_backend_audio4, |
| 3004 |
ma_backend_oss, |
| 3005 |
ma_backend_pulseaudio, |
| 3006 |
ma_backend_alsa, |
| 3007 |
ma_backend_jack, |
| 3008 |
ma_backend_aaudio, |
| 3009 |
ma_backend_opensl, |
| 3010 |
ma_backend_webaudio, |
| 3011 |
ma_backend_custom, |
| 3012 |
ma_backend_null |
| 3013 |
} ma_backend; |
| 3014 |
|
| 3015 |
#define MA_BACKEND_COUNT (ma_backend_null+1) |
| 3016 |
|
| 3017 |
|
| 3018 |
|
| 3019 |
|
| 3020 |
|
| 3021 |
|
| 3022 |
|
| 3023 |
|
| 3024 |
|
| 3025 |
typedef struct |
| 3026 |
{ |
| 3027 |
ma_bool32 noThread; |
| 3028 |
ma_uint32 jobQueueCapacity; |
| 3029 |
ma_uint32 jobQueueFlags; |
| 3030 |
} ma_device_job_thread_config; |
| 3031 |
|
| 3032 |
MA_API ma_device_job_thread_config ma_device_job_thread_config_init(void); |
| 3033 |
|
| 3034 |
typedef struct |
| 3035 |
{ |
| 3036 |
ma_thread thread; |
| 3037 |
ma_job_queue jobQueue; |
| 3038 |
ma_bool32 _hasThread; |
| 3039 |
} ma_device_job_thread; |
| 3040 |
|
| 3041 |
MA_API ma_result ma_device_job_thread_init(const ma_device_job_thread_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_device_job_thread* pJobThread); |
| 3042 |
MA_API void ma_device_job_thread_uninit(ma_device_job_thread* pJobThread, const ma_allocation_callbacks* pAllocationCallbacks); |
| 3043 |
MA_API ma_result ma_device_job_thread_post(ma_device_job_thread* pJobThread, const ma_job* pJob); |
| 3044 |
MA_API ma_result ma_device_job_thread_next(ma_device_job_thread* pJobThread, ma_job* pJob); |
| 3045 |
|
| 3046 |
|
| 3047 |
|
| 3048 |
|
| 3049 |
typedef enum |
| 3050 |
{ |
| 3051 |
ma_device_notification_type_started, |
| 3052 |
ma_device_notification_type_stopped, |
| 3053 |
ma_device_notification_type_rerouted, |
| 3054 |
ma_device_notification_type_interruption_began, |
| 3055 |
ma_device_notification_type_interruption_ended, |
| 3056 |
ma_device_notification_type_unlocked |
| 3057 |
} ma_device_notification_type; |
| 3058 |
|
| 3059 |
typedef struct |
| 3060 |
{ |
| 3061 |
ma_device* pDevice; |
| 3062 |
ma_device_notification_type type; |
| 3063 |
union |
| 3064 |
{ |
| 3065 |
struct |
| 3066 |
{ |
| 3067 |
int _unused; |
| 3068 |
} started; |
| 3069 |
struct |
| 3070 |
{ |
| 3071 |
int _unused; |
| 3072 |
} stopped; |
| 3073 |
struct |
| 3074 |
{ |
| 3075 |
int _unused; |
| 3076 |
} rerouted; |
| 3077 |
struct |
| 3078 |
{ |
| 3079 |
int _unused; |
| 3080 |
} interruption; |
| 3081 |
} data; |
| 3082 |
} ma_device_notification; |
| 3083 |
|
| 3084 |
|
| 3085 |
|
| 3086 |
|
| 3087 |
|
| 3088 |
|
| 3089 |
|
| 3090 |
|
| 3091 |
|
| 3092 |
|
| 3093 |
|
| 3094 |
|
| 3095 |
|
| 3096 |
|
| 3097 |
|
| 3098 |
|
| 3099 |
|
| 3100 |
|
| 3101 |
|
| 3102 |
|
| 3103 |
|
| 3104 |
|
| 3105 |
|
| 3106 |
|
| 3107 |
|
| 3108 |
|
| 3109 |
|
| 3110 |
|
| 3111 |
|
| 3112 |
|
| 3113 |
|
| 3114 |
|
| 3115 |
|
| 3116 |
|
| 3117 |
|
| 3118 |
|
| 3119 |
|
| 3120 |
|
| 3121 |
|
| 3122 |
|
| 3123 |
|
| 3124 |
typedef void (* ma_device_notification_proc)(const ma_device_notification* pNotification); |
| 3125 |
|
| 3126 |
|
| 3127 |
|
| 3128 |
|
| 3129 |
|
| 3130 |
|
| 3131 |
|
| 3132 |
|
| 3133 |
|
| 3134 |
|
| 3135 |
|
| 3136 |
|
| 3137 |
|
| 3138 |
|
| 3139 |
|
| 3140 |
|
| 3141 |
|
| 3142 |
|
| 3143 |
|
| 3144 |
|
| 3145 |
|
| 3146 |
|
| 3147 |
|
| 3148 |
|
| 3149 |
|
| 3150 |
|
| 3151 |
|
| 3152 |
|
| 3153 |
|
| 3154 |
|
| 3155 |
|
| 3156 |
|
| 3157 |
|
| 3158 |
|
| 3159 |
|
| 3160 |
|
| 3161 |
|
| 3162 |
|
| 3163 |
|
| 3164 |
|
| 3165 |
|
| 3166 |
|
| 3167 |
typedef void (* ma_device_data_proc)(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount); |
| 3168 |
|
| 3169 |
|
| 3170 |
|
| 3171 |
|
| 3172 |
|
| 3173 |
|
| 3174 |
|
| 3175 |
|
| 3176 |
|
| 3177 |
|
| 3178 |
|
| 3179 |
|
| 3180 |
|
| 3181 |
|
| 3182 |
|
| 3183 |
|
| 3184 |
|
| 3185 |
|
| 3186 |
|
| 3187 |
|
| 3188 |
|
| 3189 |
|
| 3190 |
|
| 3191 |
typedef void (* ma_stop_proc)(ma_device* pDevice); |
| 3192 |
|
| 3193 |
typedef enum |
| 3194 |
{ |
| 3195 |
ma_device_type_playback = 1, |
| 3196 |
ma_device_type_capture = 2, |
| 3197 |
ma_device_type_duplex = ma_device_type_playback | ma_device_type_capture, |
| 3198 |
ma_device_type_loopback = 4 |
| 3199 |
} ma_device_type; |
| 3200 |
|
| 3201 |
typedef enum |
| 3202 |
{ |
| 3203 |
ma_share_mode_shared = 0, |
| 3204 |
ma_share_mode_exclusive |
| 3205 |
} ma_share_mode; |
| 3206 |
|
| 3207 |
|
| 3208 |
typedef enum |
| 3209 |
{ |
| 3210 |
ma_ios_session_category_default = 0, |
| 3211 |
ma_ios_session_category_none, |
| 3212 |
ma_ios_session_category_ambient, |
| 3213 |
ma_ios_session_category_solo_ambient, |
| 3214 |
ma_ios_session_category_playback, |
| 3215 |
ma_ios_session_category_record, |
| 3216 |
ma_ios_session_category_play_and_record, |
| 3217 |
ma_ios_session_category_multi_route |
| 3218 |
} ma_ios_session_category; |
| 3219 |
|
| 3220 |
|
| 3221 |
typedef enum |
| 3222 |
{ |
| 3223 |
ma_ios_session_category_option_mix_with_others = 0x01, |
| 3224 |
ma_ios_session_category_option_duck_others = 0x02, |
| 3225 |
ma_ios_session_category_option_allow_bluetooth = 0x04, |
| 3226 |
ma_ios_session_category_option_default_to_speaker = 0x08, |
| 3227 |
ma_ios_session_category_option_interrupt_spoken_audio_and_mix_with_others = 0x11, |
| 3228 |
ma_ios_session_category_option_allow_bluetooth_a2dp = 0x20, |
| 3229 |
ma_ios_session_category_option_allow_air_play = 0x40, |
| 3230 |
} ma_ios_session_category_option; |
| 3231 |
|
| 3232 |
|
| 3233 |
typedef enum |
| 3234 |
{ |
| 3235 |
ma_opensl_stream_type_default = 0, |
| 3236 |
ma_opensl_stream_type_voice, |
| 3237 |
ma_opensl_stream_type_system, |
| 3238 |
ma_opensl_stream_type_ring, |
| 3239 |
ma_opensl_stream_type_media, |
| 3240 |
ma_opensl_stream_type_alarm, |
| 3241 |
ma_opensl_stream_type_notification |
| 3242 |
} ma_opensl_stream_type; |
| 3243 |
|
| 3244 |
|
| 3245 |
typedef enum |
| 3246 |
{ |
| 3247 |
ma_opensl_recording_preset_default = 0, |
| 3248 |
ma_opensl_recording_preset_generic, |
| 3249 |
ma_opensl_recording_preset_camcorder, |
| 3250 |
ma_opensl_recording_preset_voice_recognition, |
| 3251 |
ma_opensl_recording_preset_voice_communication, |
| 3252 |
ma_opensl_recording_preset_voice_unprocessed |
| 3253 |
} ma_opensl_recording_preset; |
| 3254 |
|
| 3255 |
|
| 3256 |
typedef enum |
| 3257 |
{ |
| 3258 |
ma_wasapi_usage_default = 0, |
| 3259 |
ma_wasapi_usage_games, |
| 3260 |
ma_wasapi_usage_pro_audio, |
| 3261 |
} ma_wasapi_usage; |
| 3262 |
|
| 3263 |
|
| 3264 |
typedef enum |
| 3265 |
{ |
| 3266 |
ma_aaudio_usage_default = 0, |
| 3267 |
ma_aaudio_usage_media, |
| 3268 |
ma_aaudio_usage_voice_communication, |
| 3269 |
ma_aaudio_usage_voice_communication_signalling, |
| 3270 |
ma_aaudio_usage_alarm, |
| 3271 |
ma_aaudio_usage_notification, |
| 3272 |
ma_aaudio_usage_notification_ringtone, |
| 3273 |
ma_aaudio_usage_notification_event, |
| 3274 |
ma_aaudio_usage_assistance_accessibility, |
| 3275 |
ma_aaudio_usage_assistance_navigation_guidance, |
| 3276 |
ma_aaudio_usage_assistance_sonification, |
| 3277 |
ma_aaudio_usage_game, |
| 3278 |
ma_aaudio_usage_assitant, |
| 3279 |
ma_aaudio_usage_emergency, |
| 3280 |
ma_aaudio_usage_safety, |
| 3281 |
ma_aaudio_usage_vehicle_status, |
| 3282 |
ma_aaudio_usage_announcement |
| 3283 |
} ma_aaudio_usage; |
| 3284 |
|
| 3285 |
|
| 3286 |
typedef enum |
| 3287 |
{ |
| 3288 |
ma_aaudio_content_type_default = 0, |
| 3289 |
ma_aaudio_content_type_speech, |
| 3290 |
ma_aaudio_content_type_music, |
| 3291 |
ma_aaudio_content_type_movie, |
| 3292 |
ma_aaudio_content_type_sonification |
| 3293 |
} ma_aaudio_content_type; |
| 3294 |
|
| 3295 |
|
| 3296 |
typedef enum |
| 3297 |
{ |
| 3298 |
ma_aaudio_input_preset_default = 0, |
| 3299 |
ma_aaudio_input_preset_generic, |
| 3300 |
ma_aaudio_input_preset_camcorder, |
| 3301 |
ma_aaudio_input_preset_voice_recognition, |
| 3302 |
ma_aaudio_input_preset_voice_communication, |
| 3303 |
ma_aaudio_input_preset_unprocessed, |
| 3304 |
ma_aaudio_input_preset_voice_performance |
| 3305 |
} ma_aaudio_input_preset; |
| 3306 |
|
| 3307 |
typedef enum |
| 3308 |
{ |
| 3309 |
ma_aaudio_allow_capture_default = 0, |
| 3310 |
ma_aaudio_allow_capture_by_all, |
| 3311 |
ma_aaudio_allow_capture_by_system, |
| 3312 |
ma_aaudio_allow_capture_by_none |
| 3313 |
} ma_aaudio_allowed_capture_policy; |
| 3314 |
|
| 3315 |
typedef union |
| 3316 |
{ |
| 3317 |
ma_int64 counter; |
| 3318 |
double counterD; |
| 3319 |
} ma_timer; |
| 3320 |
|
| 3321 |
typedef union |
| 3322 |
{ |
| 3323 |
ma_wchar_win32 wasapi[64]; |
| 3324 |
ma_uint8 dsound[16]; |
| 3325 |
ma_uint32 winmm; |
| 3326 |
char alsa[256]; |
| 3327 |
char pulse[256]; |
| 3328 |
int jack; |
| 3329 |
char coreaudio[256]; |
| 3330 |
char sndio[256]; |
| 3331 |
char audio4[256]; |
| 3332 |
char oss[64]; |
| 3333 |
ma_int32 aaudio; |
| 3334 |
ma_uint32 opensl; |
| 3335 |
char webaudio[32]; |
| 3336 |
union |
| 3337 |
{ |
| 3338 |
int i; |
| 3339 |
char s[256]; |
| 3340 |
void* p; |
| 3341 |
} custom; |
| 3342 |
int nullbackend; |
| 3343 |
} ma_device_id; |
| 3344 |
|
| 3345 |
MA_API ma_bool32 ma_device_id_equal(const ma_device_id* pA, const ma_device_id* pB); |
| 3346 |
|
| 3347 |
|
| 3348 |
typedef struct ma_context_config ma_context_config; |
| 3349 |
typedef struct ma_device_config ma_device_config; |
| 3350 |
typedef struct ma_backend_callbacks ma_backend_callbacks; |
| 3351 |
|
| 3352 |
#define MA_DATA_FORMAT_FLAG_EXCLUSIVE_MODE (1U << 1) |
| 3353 |
|
| 3354 |
#ifndef MA_MAX_DEVICE_NAME_LENGTH |
| 3355 |
#define MA_MAX_DEVICE_NAME_LENGTH 255 |
| 3356 |
#endif |
| 3357 |
|
| 3358 |
typedef struct |
| 3359 |
{ |
| 3360 |
|
| 3361 |
ma_device_id id; |
| 3362 |
char name[MA_MAX_DEVICE_NAME_LENGTH + 1]; |
| 3363 |
ma_bool32 isDefault; |
| 3364 |
|
| 3365 |
ma_uint32 nativeDataFormatCount; |
| 3366 |
struct |
| 3367 |
{ |
| 3368 |
ma_format format; |
| 3369 |
ma_uint32 channels; |
| 3370 |
ma_uint32 sampleRate; |
| 3371 |
ma_uint32 flags; |
| 3372 |
} nativeDataFormats[ 64]; |
| 3373 |
} ma_device_info; |
| 3374 |
|
| 3375 |
struct ma_device_config |
| 3376 |
{ |
| 3377 |
ma_device_type deviceType; |
| 3378 |
ma_uint32 sampleRate; |
| 3379 |
ma_uint32 periodSizeInFrames; |
| 3380 |
ma_uint32 periodSizeInMilliseconds; |
| 3381 |
ma_uint32 periods; |
| 3382 |
ma_performance_profile performanceProfile; |
| 3383 |
ma_bool8 noPreSilencedOutputBuffer; |
| 3384 |
ma_bool8 noClip; |
| 3385 |
ma_bool8 noDisableDenormals; |
| 3386 |
ma_bool8 noFixedSizedCallback; |
| 3387 |
ma_device_data_proc dataCallback; |
| 3388 |
ma_device_notification_proc notificationCallback; |
| 3389 |
ma_stop_proc stopCallback; |
| 3390 |
void* pUserData; |
| 3391 |
ma_resampler_config resampling; |
| 3392 |
struct |
| 3393 |
{ |
| 3394 |
const ma_device_id* pDeviceID; |
| 3395 |
ma_format format; |
| 3396 |
ma_uint32 channels; |
| 3397 |
ma_channel* pChannelMap; |
| 3398 |
ma_channel_mix_mode channelMixMode; |
| 3399 |
ma_bool32 calculateLFEFromSpatialChannels; |
| 3400 |
ma_share_mode shareMode; |
| 3401 |
} playback; |
| 3402 |
struct |
| 3403 |
{ |
| 3404 |
const ma_device_id* pDeviceID; |
| 3405 |
ma_format format; |
| 3406 |
ma_uint32 channels; |
| 3407 |
ma_channel* pChannelMap; |
| 3408 |
ma_channel_mix_mode channelMixMode; |
| 3409 |
ma_bool32 calculateLFEFromSpatialChannels; |
| 3410 |
ma_share_mode shareMode; |
| 3411 |
} capture; |
| 3412 |
|
| 3413 |
struct |
| 3414 |
{ |
| 3415 |
ma_wasapi_usage usage; |
| 3416 |
ma_bool8 noAutoConvertSRC; |
| 3417 |
ma_bool8 noDefaultQualitySRC; |
| 3418 |
ma_bool8 noAutoStreamRouting; |
| 3419 |
ma_bool8 noHardwareOffloading; |
| 3420 |
ma_uint32 loopbackProcessID; |
| 3421 |
ma_bool8 loopbackProcessExclude; |
| 3422 |
} wasapi; |
| 3423 |
struct |
| 3424 |
{ |
| 3425 |
ma_bool32 noMMap; |
| 3426 |
ma_bool32 noAutoFormat; |
| 3427 |
ma_bool32 noAutoChannels; |
| 3428 |
ma_bool32 noAutoResample; |
| 3429 |
} alsa; |
| 3430 |
struct |
| 3431 |
{ |
| 3432 |
const char* pStreamNamePlayback; |
| 3433 |
const char* pStreamNameCapture; |
| 3434 |
int channelMap; |
| 3435 |
} pulse; |
| 3436 |
struct |
| 3437 |
{ |
| 3438 |
ma_bool32 allowNominalSampleRateChange; |
| 3439 |
} coreaudio; |
| 3440 |
struct |
| 3441 |
{ |
| 3442 |
ma_opensl_stream_type streamType; |
| 3443 |
ma_opensl_recording_preset recordingPreset; |
| 3444 |
ma_bool32 enableCompatibilityWorkarounds; |
| 3445 |
} opensl; |
| 3446 |
struct |
| 3447 |
{ |
| 3448 |
ma_aaudio_usage usage; |
| 3449 |
ma_aaudio_content_type contentType; |
| 3450 |
ma_aaudio_input_preset inputPreset; |
| 3451 |
ma_aaudio_allowed_capture_policy allowedCapturePolicy; |
| 3452 |
ma_bool32 noAutoStartAfterReroute; |
| 3453 |
ma_bool32 enableCompatibilityWorkarounds; |
| 3454 |
ma_bool32 allowSetBufferCapacity; |
| 3455 |
} aaudio; |
| 3456 |
}; |
| 3457 |
|
| 3458 |
|
| 3459 |
|
| 3460 |
|
| 3461 |
|
| 3462 |
|
| 3463 |
|
| 3464 |
|
| 3465 |
|
| 3466 |
|
| 3467 |
|
| 3468 |
|
| 3469 |
|
| 3470 |
|
| 3471 |
|
| 3472 |
|
| 3473 |
|
| 3474 |
|
| 3475 |
|
| 3476 |
|
| 3477 |
|
| 3478 |
|
| 3479 |
typedef ma_bool32 (* ma_enum_devices_callback_proc)(ma_context* pContext, ma_device_type deviceType, const ma_device_info* pInfo, void* pUserData); |
| 3480 |
|
| 3481 |
|
| 3482 |
|
| 3483 |
|
| 3484 |
|
| 3485 |
typedef struct |
| 3486 |
{ |
| 3487 |
const ma_device_id* pDeviceID; |
| 3488 |
ma_share_mode shareMode; |
| 3489 |
ma_format format; |
| 3490 |
ma_uint32 channels; |
| 3491 |
ma_uint32 sampleRate; |
| 3492 |
ma_channel channelMap[MA_MAX_CHANNELS]; |
| 3493 |
ma_uint32 periodSizeInFrames; |
| 3494 |
ma_uint32 periodSizeInMilliseconds; |
| 3495 |
ma_uint32 periodCount; |
| 3496 |
} ma_device_descriptor; |
| 3497 |
|
| 3498 |
|
| 3499 |
|
| 3500 |
|
| 3501 |
|
| 3502 |
|
| 3503 |
|
| 3504 |
|
| 3505 |
|
| 3506 |
|
| 3507 |
|
| 3508 |
|
| 3509 |
|
| 3510 |
|
| 3511 |
|
| 3512 |
|
| 3513 |
|
| 3514 |
|
| 3515 |
|
| 3516 |
|
| 3517 |
|
| 3518 |
|
| 3519 |
|
| 3520 |
|
| 3521 |
|
| 3522 |
|
| 3523 |
|
| 3524 |
|
| 3525 |
|
| 3526 |
|
| 3527 |
|
| 3528 |
|
| 3529 |
|
| 3530 |
|
| 3531 |
|
| 3532 |
|
| 3533 |
|
| 3534 |
|
| 3535 |
|
| 3536 |
|
| 3537 |
|
| 3538 |
|
| 3539 |
|
| 3540 |
|
| 3541 |
|
| 3542 |
|
| 3543 |
|
| 3544 |
|
| 3545 |
|
| 3546 |
|
| 3547 |
|
| 3548 |
|
| 3549 |
|
| 3550 |
|
| 3551 |
|
| 3552 |
|
| 3553 |
|
| 3554 |
|
| 3555 |
|
| 3556 |
|
| 3557 |
|
| 3558 |
|
| 3559 |
|
| 3560 |
|
| 3561 |
|
| 3562 |
|
| 3563 |
|
| 3564 |
|
| 3565 |
|
| 3566 |
struct ma_backend_callbacks |
| 3567 |
{ |
| 3568 |
ma_result (* onContextInit)(ma_context* pContext, const ma_context_config* pConfig, ma_backend_callbacks* pCallbacks); |
| 3569 |
ma_result (* onContextUninit)(ma_context* pContext); |
| 3570 |
ma_result (* onContextEnumerateDevices)(ma_context* pContext, ma_enum_devices_callback_proc callback, void* pUserData); |
| 3571 |
ma_result (* onContextGetDeviceInfo)(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo); |
| 3572 |
ma_result (* onDeviceInit)(ma_device* pDevice, const ma_device_config* pConfig, ma_device_descriptor* pDescriptorPlayback, ma_device_descriptor* pDescriptorCapture); |
| 3573 |
ma_result (* onDeviceUninit)(ma_device* pDevice); |
| 3574 |
ma_result (* onDeviceStart)(ma_device* pDevice); |
| 3575 |
ma_result (* onDeviceStop)(ma_device* pDevice); |
| 3576 |
ma_result (* onDeviceRead)(ma_device* pDevice, void* pFrames, ma_uint32 frameCount, ma_uint32* pFramesRead); |
| 3577 |
ma_result (* onDeviceWrite)(ma_device* pDevice, const void* pFrames, ma_uint32 frameCount, ma_uint32* pFramesWritten); |
| 3578 |
ma_result (* onDeviceDataLoop)(ma_device* pDevice); |
| 3579 |
ma_result (* onDeviceDataLoopWakeup)(ma_device* pDevice); |
| 3580 |
ma_result (* onDeviceGetInfo)(ma_device* pDevice, ma_device_type type, ma_device_info* pDeviceInfo); |
| 3581 |
}; |
| 3582 |
|
| 3583 |
struct ma_context_config |
| 3584 |
{ |
| 3585 |
ma_log* pLog; |
| 3586 |
ma_thread_priority threadPriority; |
| 3587 |
size_t threadStackSize; |
| 3588 |
void* pUserData; |
| 3589 |
ma_allocation_callbacks allocationCallbacks; |
| 3590 |
struct |
| 3591 |
{ |
| 3592 |
ma_handle hWnd; |
| 3593 |
} dsound; |
| 3594 |
struct |
| 3595 |
{ |
| 3596 |
ma_bool32 useVerboseDeviceEnumeration; |
| 3597 |
} alsa; |
| 3598 |
struct |
| 3599 |
{ |
| 3600 |
const char* pApplicationName; |
| 3601 |
const char* pServerName; |
| 3602 |
ma_bool32 tryAutoSpawn; |
| 3603 |
} pulse; |
| 3604 |
struct |
| 3605 |
{ |
| 3606 |
ma_ios_session_category sessionCategory; |
| 3607 |
ma_uint32 sessionCategoryOptions; |
| 3608 |
ma_bool32 noAudioSessionActivate; |
| 3609 |
ma_bool32 noAudioSessionDeactivate; |
| 3610 |
} coreaudio; |
| 3611 |
struct |
| 3612 |
{ |
| 3613 |
const char* pClientName; |
| 3614 |
ma_bool32 tryStartServer; |
| 3615 |
} jack; |
| 3616 |
ma_backend_callbacks custom; |
| 3617 |
}; |
| 3618 |
|
| 3619 |
|
| 3620 |
typedef struct |
| 3621 |
{ |
| 3622 |
int code; |
| 3623 |
ma_event* pEvent; |
| 3624 |
union |
| 3625 |
{ |
| 3626 |
struct |
| 3627 |
{ |
| 3628 |
int _unused; |
| 3629 |
} quit; |
| 3630 |
struct |
| 3631 |
{ |
| 3632 |
ma_device_type deviceType; |
| 3633 |
void* pAudioClient; |
| 3634 |
void** ppAudioClientService; |
| 3635 |
ma_result* pResult; |
| 3636 |
} createAudioClient; |
| 3637 |
struct |
| 3638 |
{ |
| 3639 |
ma_device* pDevice; |
| 3640 |
ma_device_type deviceType; |
| 3641 |
} releaseAudioClient; |
| 3642 |
} data; |
| 3643 |
} ma_context_command__wasapi; |
| 3644 |
|
| 3645 |
struct ma_context |
| 3646 |
{ |
| 3647 |
ma_backend_callbacks callbacks; |
| 3648 |
ma_backend backend; |
| 3649 |
ma_log* pLog; |
| 3650 |
ma_log log; |
| 3651 |
ma_thread_priority threadPriority; |
| 3652 |
size_t threadStackSize; |
| 3653 |
void* pUserData; |
| 3654 |
ma_allocation_callbacks allocationCallbacks; |
| 3655 |
ma_mutex deviceEnumLock; |
| 3656 |
ma_mutex deviceInfoLock; |
| 3657 |
ma_uint32 deviceInfoCapacity; |
| 3658 |
ma_uint32 playbackDeviceInfoCount; |
| 3659 |
ma_uint32 captureDeviceInfoCount; |
| 3660 |
ma_device_info* pDeviceInfos; |
| 3661 |
|
| 3662 |
union |
| 3663 |
{ |
| 3664 |
#ifdef MA_SUPPORT_WASAPI |
| 3665 |
struct |
| 3666 |
{ |
| 3667 |
ma_thread commandThread; |
| 3668 |
ma_mutex commandLock; |
| 3669 |
ma_semaphore commandSem; |
| 3670 |
ma_uint32 commandIndex; |
| 3671 |
ma_uint32 commandCount; |
| 3672 |
ma_context_command__wasapi commands[4]; |
| 3673 |
ma_handle hAvrt; |
| 3674 |
ma_proc AvSetMmThreadCharacteristicsA; |
| 3675 |
ma_proc AvRevertMmThreadcharacteristics; |
| 3676 |
ma_handle hMMDevapi; |
| 3677 |
ma_proc ActivateAudioInterfaceAsync; |
| 3678 |
} wasapi; |
| 3679 |
#endif |
| 3680 |
#ifdef MA_SUPPORT_DSOUND |
| 3681 |
struct |
| 3682 |
{ |
| 3683 |
ma_handle hWnd; |
| 3684 |
ma_handle hDSoundDLL; |
| 3685 |
ma_proc DirectSoundCreate; |
| 3686 |
ma_proc DirectSoundEnumerateA; |
| 3687 |
ma_proc DirectSoundCaptureCreate; |
| 3688 |
ma_proc DirectSoundCaptureEnumerateA; |
| 3689 |
} dsound; |
| 3690 |
#endif |
| 3691 |
#ifdef MA_SUPPORT_WINMM |
| 3692 |
struct |
| 3693 |
{ |
| 3694 |
ma_handle hWinMM; |
| 3695 |
ma_proc waveOutGetNumDevs; |
| 3696 |
ma_proc waveOutGetDevCapsA; |
| 3697 |
ma_proc waveOutOpen; |
| 3698 |
ma_proc waveOutClose; |
| 3699 |
ma_proc waveOutPrepareHeader; |
| 3700 |
ma_proc waveOutUnprepareHeader; |
| 3701 |
ma_proc waveOutWrite; |
| 3702 |
ma_proc waveOutReset; |
| 3703 |
ma_proc waveInGetNumDevs; |
| 3704 |
ma_proc waveInGetDevCapsA; |
| 3705 |
ma_proc waveInOpen; |
| 3706 |
ma_proc waveInClose; |
| 3707 |
ma_proc waveInPrepareHeader; |
| 3708 |
ma_proc waveInUnprepareHeader; |
| 3709 |
ma_proc waveInAddBuffer; |
| 3710 |
ma_proc waveInStart; |
| 3711 |
ma_proc waveInReset; |
| 3712 |
} winmm; |
| 3713 |
#endif |
| 3714 |
#ifdef MA_SUPPORT_ALSA |
| 3715 |
struct |
| 3716 |
{ |
| 3717 |
ma_handle asoundSO; |
| 3718 |
ma_proc snd_pcm_open; |
| 3719 |
ma_proc snd_pcm_close; |
| 3720 |
ma_proc snd_pcm_hw_params_sizeof; |
| 3721 |
ma_proc snd_pcm_hw_params_any; |
| 3722 |
ma_proc snd_pcm_hw_params_set_format; |
| 3723 |
ma_proc snd_pcm_hw_params_set_format_first; |
| 3724 |
ma_proc snd_pcm_hw_params_get_format_mask; |
| 3725 |
ma_proc snd_pcm_hw_params_set_channels; |
| 3726 |
ma_proc snd_pcm_hw_params_set_channels_near; |
| 3727 |
ma_proc snd_pcm_hw_params_set_channels_minmax; |
| 3728 |
ma_proc snd_pcm_hw_params_set_rate_resample; |
| 3729 |
ma_proc snd_pcm_hw_params_set_rate; |
| 3730 |
ma_proc snd_pcm_hw_params_set_rate_near; |
| 3731 |
ma_proc snd_pcm_hw_params_set_rate_minmax; |
| 3732 |
ma_proc snd_pcm_hw_params_set_buffer_size_near; |
| 3733 |
ma_proc snd_pcm_hw_params_set_periods_near; |
| 3734 |
ma_proc snd_pcm_hw_params_set_access; |
| 3735 |
ma_proc snd_pcm_hw_params_get_format; |
| 3736 |
ma_proc snd_pcm_hw_params_get_channels; |
| 3737 |
ma_proc snd_pcm_hw_params_get_channels_min; |
| 3738 |
ma_proc snd_pcm_hw_params_get_channels_max; |
| 3739 |
ma_proc snd_pcm_hw_params_get_rate; |
| 3740 |
ma_proc snd_pcm_hw_params_get_rate_min; |
| 3741 |
ma_proc snd_pcm_hw_params_get_rate_max; |
| 3742 |
ma_proc snd_pcm_hw_params_get_buffer_size; |
| 3743 |
ma_proc snd_pcm_hw_params_get_periods; |
| 3744 |
ma_proc snd_pcm_hw_params_get_access; |
| 3745 |
ma_proc snd_pcm_hw_params_test_format; |
| 3746 |
ma_proc snd_pcm_hw_params_test_channels; |
| 3747 |
ma_proc snd_pcm_hw_params_test_rate; |
| 3748 |
ma_proc snd_pcm_hw_params; |
| 3749 |
ma_proc snd_pcm_sw_params_sizeof; |
| 3750 |
ma_proc snd_pcm_sw_params_current; |
| 3751 |
ma_proc snd_pcm_sw_params_get_boundary; |
| 3752 |
ma_proc snd_pcm_sw_params_set_avail_min; |
| 3753 |
ma_proc snd_pcm_sw_params_set_start_threshold; |
| 3754 |
ma_proc snd_pcm_sw_params_set_stop_threshold; |
| 3755 |
ma_proc snd_pcm_sw_params; |
| 3756 |
ma_proc snd_pcm_format_mask_sizeof; |
| 3757 |
ma_proc snd_pcm_format_mask_test; |
| 3758 |
ma_proc snd_pcm_get_chmap; |
| 3759 |
ma_proc snd_pcm_state; |
| 3760 |
ma_proc snd_pcm_prepare; |
| 3761 |
ma_proc snd_pcm_start; |
| 3762 |
ma_proc snd_pcm_drop; |
| 3763 |
ma_proc snd_pcm_drain; |
| 3764 |
ma_proc snd_pcm_reset; |
| 3765 |
ma_proc snd_device_name_hint; |
| 3766 |
ma_proc snd_device_name_get_hint; |
| 3767 |
ma_proc snd_card_get_index; |
| 3768 |
ma_proc snd_device_name_free_hint; |
| 3769 |
ma_proc snd_pcm_mmap_begin; |
| 3770 |
ma_proc snd_pcm_mmap_commit; |
| 3771 |
ma_proc snd_pcm_recover; |
| 3772 |
ma_proc snd_pcm_readi; |
| 3773 |
ma_proc snd_pcm_writei; |
| 3774 |
ma_proc snd_pcm_avail; |
| 3775 |
ma_proc snd_pcm_avail_update; |
| 3776 |
ma_proc snd_pcm_wait; |
| 3777 |
ma_proc snd_pcm_nonblock; |
| 3778 |
ma_proc snd_pcm_info; |
| 3779 |
ma_proc snd_pcm_info_sizeof; |
| 3780 |
ma_proc snd_pcm_info_get_name; |
| 3781 |
ma_proc snd_pcm_poll_descriptors; |
| 3782 |
ma_proc snd_pcm_poll_descriptors_count; |
| 3783 |
ma_proc snd_pcm_poll_descriptors_revents; |
| 3784 |
ma_proc snd_config_update_free_global; |
| 3785 |
|
| 3786 |
ma_mutex internalDeviceEnumLock; |
| 3787 |
ma_bool32 useVerboseDeviceEnumeration; |
| 3788 |
} alsa; |
| 3789 |
#endif |
| 3790 |
#ifdef MA_SUPPORT_PULSEAUDIO |
| 3791 |
struct |
| 3792 |
{ |
| 3793 |
ma_handle pulseSO; |
| 3794 |
ma_proc pa_mainloop_new; |
| 3795 |
ma_proc pa_mainloop_free; |
| 3796 |
ma_proc pa_mainloop_quit; |
| 3797 |
ma_proc pa_mainloop_get_api; |
| 3798 |
ma_proc pa_mainloop_iterate; |
| 3799 |
ma_proc pa_mainloop_wakeup; |
| 3800 |
ma_proc pa_threaded_mainloop_new; |
| 3801 |
ma_proc pa_threaded_mainloop_free; |
| 3802 |
ma_proc pa_threaded_mainloop_start; |
| 3803 |
ma_proc pa_threaded_mainloop_stop; |
| 3804 |
ma_proc pa_threaded_mainloop_lock; |
| 3805 |
ma_proc pa_threaded_mainloop_unlock; |
| 3806 |
ma_proc pa_threaded_mainloop_wait; |
| 3807 |
ma_proc pa_threaded_mainloop_signal; |
| 3808 |
ma_proc pa_threaded_mainloop_accept; |
| 3809 |
ma_proc pa_threaded_mainloop_get_retval; |
| 3810 |
ma_proc pa_threaded_mainloop_get_api; |
| 3811 |
ma_proc pa_threaded_mainloop_in_thread; |
| 3812 |
ma_proc pa_threaded_mainloop_set_name; |
| 3813 |
ma_proc pa_context_new; |
| 3814 |
ma_proc pa_context_unref; |
| 3815 |
ma_proc pa_context_connect; |
| 3816 |
ma_proc pa_context_disconnect; |
| 3817 |
ma_proc pa_context_set_state_callback; |
| 3818 |
ma_proc pa_context_get_state; |
| 3819 |
ma_proc pa_context_get_sink_info_list; |
| 3820 |
ma_proc pa_context_get_source_info_list; |
| 3821 |
ma_proc pa_context_get_sink_info_by_name; |
| 3822 |
ma_proc pa_context_get_source_info_by_name; |
| 3823 |
ma_proc pa_operation_unref; |
| 3824 |
ma_proc pa_operation_get_state; |
| 3825 |
ma_proc pa_channel_map_init_extend; |
| 3826 |
ma_proc pa_channel_map_valid; |
| 3827 |
ma_proc pa_channel_map_compatible; |
| 3828 |
ma_proc pa_stream_new; |
| 3829 |
ma_proc pa_stream_unref; |
| 3830 |
ma_proc pa_stream_connect_playback; |
| 3831 |
ma_proc pa_stream_connect_record; |
| 3832 |
ma_proc pa_stream_disconnect; |
| 3833 |
ma_proc pa_stream_get_state; |
| 3834 |
ma_proc pa_stream_get_sample_spec; |
| 3835 |
ma_proc pa_stream_get_channel_map; |
| 3836 |
ma_proc pa_stream_get_buffer_attr; |
| 3837 |
ma_proc pa_stream_set_buffer_attr; |
| 3838 |
ma_proc pa_stream_get_device_name; |
| 3839 |
ma_proc pa_stream_set_write_callback; |
| 3840 |
ma_proc pa_stream_set_read_callback; |
| 3841 |
ma_proc pa_stream_set_suspended_callback; |
| 3842 |
ma_proc pa_stream_set_moved_callback; |
| 3843 |
ma_proc pa_stream_is_suspended; |
| 3844 |
ma_proc pa_stream_flush; |
| 3845 |
ma_proc pa_stream_drain; |
| 3846 |
ma_proc pa_stream_is_corked; |
| 3847 |
ma_proc pa_stream_cork; |
| 3848 |
ma_proc pa_stream_trigger; |
| 3849 |
ma_proc pa_stream_begin_write; |
| 3850 |
ma_proc pa_stream_write; |
| 3851 |
ma_proc pa_stream_peek; |
| 3852 |
ma_proc pa_stream_drop; |
| 3853 |
ma_proc pa_stream_writable_size; |
| 3854 |
ma_proc pa_stream_readable_size; |
| 3855 |
|
| 3856 |
ma_ptr pMainLoop; |
| 3857 |
ma_ptr pPulseContext; |
| 3858 |
char* pApplicationName; |
| 3859 |
char* pServerName; |
| 3860 |
} pulse; |
| 3861 |
#endif |
| 3862 |
#ifdef MA_SUPPORT_JACK |
| 3863 |
struct |
| 3864 |
{ |
| 3865 |
ma_handle jackSO; |
| 3866 |
ma_proc jack_client_open; |
| 3867 |
ma_proc jack_client_close; |
| 3868 |
ma_proc jack_client_name_size; |
| 3869 |
ma_proc jack_set_process_callback; |
| 3870 |
ma_proc jack_set_buffer_size_callback; |
| 3871 |
ma_proc jack_on_shutdown; |
| 3872 |
ma_proc jack_get_sample_rate; |
| 3873 |
ma_proc jack_get_buffer_size; |
| 3874 |
ma_proc jack_get_ports; |
| 3875 |
ma_proc jack_activate; |
| 3876 |
ma_proc jack_deactivate; |
| 3877 |
ma_proc jack_connect; |
| 3878 |
ma_proc jack_port_register; |
| 3879 |
ma_proc jack_port_name; |
| 3880 |
ma_proc jack_port_get_buffer; |
| 3881 |
ma_proc jack_free; |
| 3882 |
|
| 3883 |
char* pClientName; |
| 3884 |
ma_bool32 tryStartServer; |
| 3885 |
} jack; |
| 3886 |
#endif |
| 3887 |
#ifdef MA_SUPPORT_COREAUDIO |
| 3888 |
struct |
| 3889 |
{ |
| 3890 |
ma_handle hCoreFoundation; |
| 3891 |
ma_proc CFStringGetCString; |
| 3892 |
ma_proc CFRelease; |
| 3893 |
|
| 3894 |
ma_handle hCoreAudio; |
| 3895 |
ma_proc AudioObjectGetPropertyData; |
| 3896 |
ma_proc AudioObjectGetPropertyDataSize; |
| 3897 |
ma_proc AudioObjectSetPropertyData; |
| 3898 |
ma_proc AudioObjectAddPropertyListener; |
| 3899 |
ma_proc AudioObjectRemovePropertyListener; |
| 3900 |
|
| 3901 |
ma_handle hAudioUnit; |
| 3902 |
ma_proc AudioComponentFindNext; |
| 3903 |
ma_proc AudioComponentInstanceDispose; |
| 3904 |
ma_proc AudioComponentInstanceNew; |
| 3905 |
ma_proc AudioOutputUnitStart; |
| 3906 |
ma_proc AudioOutputUnitStop; |
| 3907 |
ma_proc AudioUnitAddPropertyListener; |
| 3908 |
ma_proc AudioUnitGetPropertyInfo; |
| 3909 |
ma_proc AudioUnitGetProperty; |
| 3910 |
ma_proc AudioUnitSetProperty; |
| 3911 |
ma_proc AudioUnitInitialize; |
| 3912 |
ma_proc AudioUnitRender; |
| 3913 |
|
| 3914 |
ma_ptr component; |
| 3915 |
ma_bool32 noAudioSessionDeactivate; |
| 3916 |
} coreaudio; |
| 3917 |
#endif |
| 3918 |
#ifdef MA_SUPPORT_SNDIO |
| 3919 |
struct |
| 3920 |
{ |
| 3921 |
ma_handle sndioSO; |
| 3922 |
ma_proc sio_open; |
| 3923 |
ma_proc sio_close; |
| 3924 |
ma_proc sio_setpar; |
| 3925 |
ma_proc sio_getpar; |
| 3926 |
ma_proc sio_getcap; |
| 3927 |
ma_proc sio_start; |
| 3928 |
ma_proc sio_stop; |
| 3929 |
ma_proc sio_read; |
| 3930 |
ma_proc sio_write; |
| 3931 |
ma_proc sio_onmove; |
| 3932 |
ma_proc sio_nfds; |
| 3933 |
ma_proc sio_pollfd; |
| 3934 |
ma_proc sio_revents; |
| 3935 |
ma_proc sio_eof; |
| 3936 |
ma_proc sio_setvol; |
| 3937 |
ma_proc sio_onvol; |
| 3938 |
ma_proc sio_initpar; |
| 3939 |
} sndio; |
| 3940 |
#endif |
| 3941 |
#ifdef MA_SUPPORT_AUDIO4 |
| 3942 |
struct |
| 3943 |
{ |
| 3944 |
int _unused; |
| 3945 |
} audio4; |
| 3946 |
#endif |
| 3947 |
#ifdef MA_SUPPORT_OSS |
| 3948 |
struct |
| 3949 |
{ |
| 3950 |
int versionMajor; |
| 3951 |
int versionMinor; |
| 3952 |
} oss; |
| 3953 |
#endif |
| 3954 |
#ifdef MA_SUPPORT_AAUDIO |
| 3955 |
struct |
| 3956 |
{ |
| 3957 |
ma_handle hAAudio; |
| 3958 |
ma_proc AAudio_createStreamBuilder; |
| 3959 |
ma_proc AAudioStreamBuilder_delete; |
| 3960 |
ma_proc AAudioStreamBuilder_setDeviceId; |
| 3961 |
ma_proc AAudioStreamBuilder_setDirection; |
| 3962 |
ma_proc AAudioStreamBuilder_setSharingMode; |
| 3963 |
ma_proc AAudioStreamBuilder_setFormat; |
| 3964 |
ma_proc AAudioStreamBuilder_setChannelCount; |
| 3965 |
ma_proc AAudioStreamBuilder_setSampleRate; |
| 3966 |
ma_proc AAudioStreamBuilder_setBufferCapacityInFrames; |
| 3967 |
ma_proc AAudioStreamBuilder_setFramesPerDataCallback; |
| 3968 |
ma_proc AAudioStreamBuilder_setDataCallback; |
| 3969 |
ma_proc AAudioStreamBuilder_setErrorCallback; |
| 3970 |
ma_proc AAudioStreamBuilder_setPerformanceMode; |
| 3971 |
ma_proc AAudioStreamBuilder_setUsage; |
| 3972 |
ma_proc AAudioStreamBuilder_setContentType; |
| 3973 |
ma_proc AAudioStreamBuilder_setInputPreset; |
| 3974 |
ma_proc AAudioStreamBuilder_setAllowedCapturePolicy; |
| 3975 |
ma_proc AAudioStreamBuilder_openStream; |
| 3976 |
ma_proc AAudioStream_close; |
| 3977 |
ma_proc AAudioStream_getState; |
| 3978 |
ma_proc AAudioStream_waitForStateChange; |
| 3979 |
ma_proc AAudioStream_getFormat; |
| 3980 |
ma_proc AAudioStream_getChannelCount; |
| 3981 |
ma_proc AAudioStream_getSampleRate; |
| 3982 |
ma_proc AAudioStream_getBufferCapacityInFrames; |
| 3983 |
ma_proc AAudioStream_getFramesPerDataCallback; |
| 3984 |
ma_proc AAudioStream_getFramesPerBurst; |
| 3985 |
ma_proc AAudioStream_requestStart; |
| 3986 |
ma_proc AAudioStream_requestStop; |
| 3987 |
ma_device_job_thread jobThread; |
| 3988 |
} aaudio; |
| 3989 |
#endif |
| 3990 |
#ifdef MA_SUPPORT_OPENSL |
| 3991 |
struct |
| 3992 |
{ |
| 3993 |
ma_handle libOpenSLES; |
| 3994 |
ma_handle SL_IID_ENGINE; |
| 3995 |
ma_handle SL_IID_AUDIOIODEVICECAPABILITIES; |
| 3996 |
ma_handle SL_IID_ANDROIDSIMPLEBUFFERQUEUE; |
| 3997 |
ma_handle SL_IID_RECORD; |
| 3998 |
ma_handle SL_IID_PLAY; |
| 3999 |
ma_handle SL_IID_OUTPUTMIX; |
| 4000 |
ma_handle SL_IID_ANDROIDCONFIGURATION; |
| 4001 |
ma_proc slCreateEngine; |
| 4002 |
} opensl; |
| 4003 |
#endif |
| 4004 |
#ifdef MA_SUPPORT_WEBAUDIO |
| 4005 |
struct |
| 4006 |
{ |
| 4007 |
int _unused; |
| 4008 |
} webaudio; |
| 4009 |
#endif |
| 4010 |
#ifdef MA_SUPPORT_NULL |
| 4011 |
struct |
| 4012 |
{ |
| 4013 |
int _unused; |
| 4014 |
} null_backend; |
| 4015 |
#endif |
| 4016 |
}; |
| 4017 |
|
| 4018 |
union |
| 4019 |
{ |
| 4020 |
#if defined(MA_WIN32) |
| 4021 |
struct |
| 4022 |
{ |
| 4023 |
ma_handle hOle32DLL; |
| 4024 |
ma_proc CoInitialize; |
| 4025 |
ma_proc CoInitializeEx; |
| 4026 |
ma_proc CoUninitialize; |
| 4027 |
ma_proc CoCreateInstance; |
| 4028 |
ma_proc CoTaskMemFree; |
| 4029 |
ma_proc PropVariantClear; |
| 4030 |
ma_proc StringFromGUID2; |
| 4031 |
|
| 4032 |
ma_handle hUser32DLL; |
| 4033 |
ma_proc GetForegroundWindow; |
| 4034 |
ma_proc GetDesktopWindow; |
| 4035 |
|
| 4036 |
ma_handle hAdvapi32DLL; |
| 4037 |
ma_proc RegOpenKeyExA; |
| 4038 |
ma_proc RegCloseKey; |
| 4039 |
ma_proc RegQueryValueExA; |
| 4040 |
|
| 4041 |
long CoInitializeResult; |
| 4042 |
} win32; |
| 4043 |
#endif |
| 4044 |
#ifdef MA_POSIX |
| 4045 |
struct |
| 4046 |
{ |
| 4047 |
int _unused; |
| 4048 |
} posix; |
| 4049 |
#endif |
| 4050 |
int _unused; |
| 4051 |
}; |
| 4052 |
}; |
| 4053 |
|
| 4054 |
struct ma_device |
| 4055 |
{ |
| 4056 |
ma_context* pContext; |
| 4057 |
ma_device_type type; |
| 4058 |
ma_uint32 sampleRate; |
| 4059 |
ma_atomic_device_state state; |
| 4060 |
ma_device_data_proc onData; |
| 4061 |
ma_device_notification_proc onNotification; |
| 4062 |
ma_stop_proc onStop; |
| 4063 |
void* pUserData; |
| 4064 |
ma_mutex startStopLock; |
| 4065 |
ma_event wakeupEvent; |
| 4066 |
ma_event startEvent; |
| 4067 |
ma_event stopEvent; |
| 4068 |
ma_thread thread; |
| 4069 |
ma_result workResult; |
| 4070 |
ma_bool8 isOwnerOfContext; |
| 4071 |
ma_bool8 noPreSilencedOutputBuffer; |
| 4072 |
ma_bool8 noClip; |
| 4073 |
ma_bool8 noDisableDenormals; |
| 4074 |
ma_bool8 noFixedSizedCallback; |
| 4075 |
ma_atomic_float masterVolumeFactor; |
| 4076 |
ma_duplex_rb duplexRB; |
| 4077 |
struct |
| 4078 |
{ |
| 4079 |
ma_resample_algorithm algorithm; |
| 4080 |
ma_resampling_backend_vtable* pBackendVTable; |
| 4081 |
void* pBackendUserData; |
| 4082 |
struct |
| 4083 |
{ |
| 4084 |
ma_uint32 lpfOrder; |
| 4085 |
} linear; |
| 4086 |
} resampling; |
| 4087 |
struct |
| 4088 |
{ |
| 4089 |
ma_device_id* pID; |
| 4090 |
ma_device_id id; |
| 4091 |
char name[MA_MAX_DEVICE_NAME_LENGTH + 1]; |
| 4092 |
ma_share_mode shareMode; |
| 4093 |
ma_format format; |
| 4094 |
ma_uint32 channels; |
| 4095 |
ma_channel channelMap[MA_MAX_CHANNELS]; |
| 4096 |
ma_format internalFormat; |
| 4097 |
ma_uint32 internalChannels; |
| 4098 |
ma_uint32 internalSampleRate; |
| 4099 |
ma_channel internalChannelMap[MA_MAX_CHANNELS]; |
| 4100 |
ma_uint32 internalPeriodSizeInFrames; |
| 4101 |
ma_uint32 internalPeriods; |
| 4102 |
ma_channel_mix_mode channelMixMode; |
| 4103 |
ma_bool32 calculateLFEFromSpatialChannels; |
| 4104 |
ma_data_converter converter; |
| 4105 |
void* pIntermediaryBuffer; |
| 4106 |
ma_uint32 intermediaryBufferCap; |
| 4107 |
ma_uint32 intermediaryBufferLen; |
| 4108 |
void* pInputCache; |
| 4109 |
ma_uint64 inputCacheCap; |
| 4110 |
ma_uint64 inputCacheConsumed; |
| 4111 |
ma_uint64 inputCacheRemaining; |
| 4112 |
} playback; |
| 4113 |
struct |
| 4114 |
{ |
| 4115 |
ma_device_id* pID; |
| 4116 |
ma_device_id id; |
| 4117 |
char name[MA_MAX_DEVICE_NAME_LENGTH + 1]; |
| 4118 |
ma_share_mode shareMode; |
| 4119 |
ma_format format; |
| 4120 |
ma_uint32 channels; |
| 4121 |
ma_channel channelMap[MA_MAX_CHANNELS]; |
| 4122 |
ma_format internalFormat; |
| 4123 |
ma_uint32 internalChannels; |
| 4124 |
ma_uint32 internalSampleRate; |
| 4125 |
ma_channel internalChannelMap[MA_MAX_CHANNELS]; |
| 4126 |
ma_uint32 internalPeriodSizeInFrames; |
| 4127 |
ma_uint32 internalPeriods; |
| 4128 |
ma_channel_mix_mode channelMixMode; |
| 4129 |
ma_bool32 calculateLFEFromSpatialChannels; |
| 4130 |
ma_data_converter converter; |
| 4131 |
void* pIntermediaryBuffer; |
| 4132 |
ma_uint32 intermediaryBufferCap; |
| 4133 |
ma_uint32 intermediaryBufferLen; |
| 4134 |
} capture; |
| 4135 |
|
| 4136 |
union |
| 4137 |
{ |
| 4138 |
#ifdef MA_SUPPORT_WASAPI |
| 4139 |
struct |
| 4140 |
{ |
| 4141 |
ma_ptr pAudioClientPlayback; |
| 4142 |
ma_ptr pAudioClientCapture; |
| 4143 |
ma_ptr pRenderClient; |
| 4144 |
ma_ptr pCaptureClient; |
| 4145 |
ma_ptr pDeviceEnumerator; |
| 4146 |
ma_IMMNotificationClient notificationClient; |
| 4147 |
ma_handle hEventPlayback; |
| 4148 |
ma_handle hEventCapture; |
| 4149 |
ma_uint32 actualBufferSizeInFramesPlayback; |
| 4150 |
ma_uint32 actualBufferSizeInFramesCapture; |
| 4151 |
ma_uint32 originalPeriodSizeInFrames; |
| 4152 |
ma_uint32 originalPeriodSizeInMilliseconds; |
| 4153 |
ma_uint32 originalPeriods; |
| 4154 |
ma_performance_profile originalPerformanceProfile; |
| 4155 |
ma_uint32 periodSizeInFramesPlayback; |
| 4156 |
ma_uint32 periodSizeInFramesCapture; |
| 4157 |
void* pMappedBufferCapture; |
| 4158 |
ma_uint32 mappedBufferCaptureCap; |
| 4159 |
ma_uint32 mappedBufferCaptureLen; |
| 4160 |
void* pMappedBufferPlayback; |
| 4161 |
ma_uint32 mappedBufferPlaybackCap; |
| 4162 |
ma_uint32 mappedBufferPlaybackLen; |
| 4163 |
ma_atomic_bool32 isStartedCapture; |
| 4164 |
ma_atomic_bool32 isStartedPlayback; |
| 4165 |
ma_uint32 loopbackProcessID; |
| 4166 |
ma_bool8 loopbackProcessExclude; |
| 4167 |
ma_bool8 noAutoConvertSRC; |
| 4168 |
ma_bool8 noDefaultQualitySRC; |
| 4169 |
ma_bool8 noHardwareOffloading; |
| 4170 |
ma_bool8 allowCaptureAutoStreamRouting; |
| 4171 |
ma_bool8 allowPlaybackAutoStreamRouting; |
| 4172 |
ma_bool8 isDetachedPlayback; |
| 4173 |
ma_bool8 isDetachedCapture; |
| 4174 |
ma_wasapi_usage usage; |
| 4175 |
void* hAvrtHandle; |
| 4176 |
ma_mutex rerouteLock; |
| 4177 |
} wasapi; |
| 4178 |
#endif |
| 4179 |
#ifdef MA_SUPPORT_DSOUND |
| 4180 |
struct |
| 4181 |
{ |
| 4182 |
ma_ptr pPlayback; |
| 4183 |
ma_ptr pPlaybackPrimaryBuffer; |
| 4184 |
ma_ptr pPlaybackBuffer; |
| 4185 |
ma_ptr pCapture; |
| 4186 |
ma_ptr pCaptureBuffer; |
| 4187 |
} dsound; |
| 4188 |
#endif |
| 4189 |
#ifdef MA_SUPPORT_WINMM |
| 4190 |
struct |
| 4191 |
{ |
| 4192 |
ma_handle hDevicePlayback; |
| 4193 |
ma_handle hDeviceCapture; |
| 4194 |
ma_handle hEventPlayback; |
| 4195 |
ma_handle hEventCapture; |
| 4196 |
ma_uint32 fragmentSizeInFrames; |
| 4197 |
ma_uint32 iNextHeaderPlayback; |
| 4198 |
ma_uint32 iNextHeaderCapture; |
| 4199 |
ma_uint32 headerFramesConsumedPlayback; |
| 4200 |
ma_uint32 headerFramesConsumedCapture; |
| 4201 |
ma_uint8* pWAVEHDRPlayback; |
| 4202 |
ma_uint8* pWAVEHDRCapture; |
| 4203 |
ma_uint8* pIntermediaryBufferPlayback; |
| 4204 |
ma_uint8* pIntermediaryBufferCapture; |
| 4205 |
ma_uint8* _pHeapData; |
| 4206 |
} winmm; |
| 4207 |
#endif |
| 4208 |
#ifdef MA_SUPPORT_ALSA |
| 4209 |
struct |
| 4210 |
{ |
| 4211 |
ma_ptr pPCMPlayback; |
| 4212 |
ma_ptr pPCMCapture; |
| 4213 |
void* pPollDescriptorsPlayback; |
| 4214 |
void* pPollDescriptorsCapture; |
| 4215 |
int pollDescriptorCountPlayback; |
| 4216 |
int pollDescriptorCountCapture; |
| 4217 |
int wakeupfdPlayback; |
| 4218 |
int wakeupfdCapture; |
| 4219 |
ma_bool8 isUsingMMapPlayback; |
| 4220 |
ma_bool8 isUsingMMapCapture; |
| 4221 |
} alsa; |
| 4222 |
#endif |
| 4223 |
#ifdef MA_SUPPORT_PULSEAUDIO |
| 4224 |
struct |
| 4225 |
{ |
| 4226 |
ma_ptr pMainLoop; |
| 4227 |
ma_ptr pPulseContext; |
| 4228 |
ma_ptr pStreamPlayback; |
| 4229 |
ma_ptr pStreamCapture; |
| 4230 |
} pulse; |
| 4231 |
#endif |
| 4232 |
#ifdef MA_SUPPORT_JACK |
| 4233 |
struct |
| 4234 |
{ |
| 4235 |
ma_ptr pClient; |
| 4236 |
ma_ptr* ppPortsPlayback; |
| 4237 |
ma_ptr* ppPortsCapture; |
| 4238 |
float* pIntermediaryBufferPlayback; |
| 4239 |
float* pIntermediaryBufferCapture; |
| 4240 |
} jack; |
| 4241 |
#endif |
| 4242 |
#ifdef MA_SUPPORT_COREAUDIO |
| 4243 |
struct |
| 4244 |
{ |
| 4245 |
ma_uint32 deviceObjectIDPlayback; |
| 4246 |
ma_uint32 deviceObjectIDCapture; |
| 4247 |
ma_ptr audioUnitPlayback; |
| 4248 |
ma_ptr audioUnitCapture; |
| 4249 |
ma_ptr pAudioBufferList; |
| 4250 |
ma_uint32 audioBufferCapInFrames; |
| 4251 |
ma_event stopEvent; |
| 4252 |
ma_uint32 originalPeriodSizeInFrames; |
| 4253 |
ma_uint32 originalPeriodSizeInMilliseconds; |
| 4254 |
ma_uint32 originalPeriods; |
| 4255 |
ma_performance_profile originalPerformanceProfile; |
| 4256 |
ma_bool32 isDefaultPlaybackDevice; |
| 4257 |
ma_bool32 isDefaultCaptureDevice; |
| 4258 |
ma_bool32 isSwitchingPlaybackDevice; |
| 4259 |
ma_bool32 isSwitchingCaptureDevice; |
| 4260 |
void* pNotificationHandler; |
| 4261 |
} coreaudio; |
| 4262 |
#endif |
| 4263 |
#ifdef MA_SUPPORT_SNDIO |
| 4264 |
struct |
| 4265 |
{ |
| 4266 |
ma_ptr handlePlayback; |
| 4267 |
ma_ptr handleCapture; |
| 4268 |
ma_bool32 isStartedPlayback; |
| 4269 |
ma_bool32 isStartedCapture; |
| 4270 |
} sndio; |
| 4271 |
#endif |
| 4272 |
#ifdef MA_SUPPORT_AUDIO4 |
| 4273 |
struct |
| 4274 |
{ |
| 4275 |
int fdPlayback; |
| 4276 |
int fdCapture; |
| 4277 |
} audio4; |
| 4278 |
#endif |
| 4279 |
#ifdef MA_SUPPORT_OSS |
| 4280 |
struct |
| 4281 |
{ |
| 4282 |
int fdPlayback; |
| 4283 |
int fdCapture; |
| 4284 |
} oss; |
| 4285 |
#endif |
| 4286 |
#ifdef MA_SUPPORT_AAUDIO |
| 4287 |
struct |
| 4288 |
{ |
| 4289 |
ma_ptr pStreamPlayback; |
| 4290 |
ma_ptr pStreamCapture; |
| 4291 |
ma_mutex rerouteLock; |
| 4292 |
ma_atomic_bool32 isTearingDown; |
| 4293 |
ma_aaudio_usage usage; |
| 4294 |
ma_aaudio_content_type contentType; |
| 4295 |
ma_aaudio_input_preset inputPreset; |
| 4296 |
ma_aaudio_allowed_capture_policy allowedCapturePolicy; |
| 4297 |
ma_bool32 noAutoStartAfterReroute; |
| 4298 |
} aaudio; |
| 4299 |
#endif |
| 4300 |
#ifdef MA_SUPPORT_OPENSL |
| 4301 |
struct |
| 4302 |
{ |
| 4303 |
ma_ptr pOutputMixObj; |
| 4304 |
ma_ptr pOutputMix; |
| 4305 |
ma_ptr pAudioPlayerObj; |
| 4306 |
ma_ptr pAudioPlayer; |
| 4307 |
ma_ptr pAudioRecorderObj; |
| 4308 |
ma_ptr pAudioRecorder; |
| 4309 |
ma_ptr pBufferQueuePlayback; |
| 4310 |
ma_ptr pBufferQueueCapture; |
| 4311 |
ma_bool32 isDrainingCapture; |
| 4312 |
ma_bool32 isDrainingPlayback; |
| 4313 |
ma_uint32 currentBufferIndexPlayback; |
| 4314 |
ma_uint32 currentBufferIndexCapture; |
| 4315 |
ma_uint8* pBufferPlayback; |
| 4316 |
ma_uint8* pBufferCapture; |
| 4317 |
} opensl; |
| 4318 |
#endif |
| 4319 |
#ifdef MA_SUPPORT_WEBAUDIO |
| 4320 |
struct |
| 4321 |
{ |
| 4322 |
|
| 4323 |
int audioContext; |
| 4324 |
int audioWorklet; |
| 4325 |
float* pIntermediaryBuffer; |
| 4326 |
void* pStackBuffer; |
| 4327 |
ma_result initResult; |
| 4328 |
int deviceIndex; |
| 4329 |
} webaudio; |
| 4330 |
#endif |
| 4331 |
#ifdef MA_SUPPORT_NULL |
| 4332 |
struct |
| 4333 |
{ |
| 4334 |
ma_thread deviceThread; |
| 4335 |
ma_event operationEvent; |
| 4336 |
ma_event operationCompletionEvent; |
| 4337 |
ma_semaphore operationSemaphore; |
| 4338 |
ma_uint32 operation; |
| 4339 |
ma_result operationResult; |
| 4340 |
ma_timer timer; |
| 4341 |
double priorRunTime; |
| 4342 |
ma_uint32 currentPeriodFramesRemainingPlayback; |
| 4343 |
ma_uint32 currentPeriodFramesRemainingCapture; |
| 4344 |
ma_uint64 lastProcessedFramePlayback; |
| 4345 |
ma_uint64 lastProcessedFrameCapture; |
| 4346 |
ma_atomic_bool32 isStarted; |
| 4347 |
} null_device; |
| 4348 |
#endif |
| 4349 |
}; |
| 4350 |
}; |
| 4351 |
#if defined(_MSC_VER) && !defined(__clang__) |
| 4352 |
#pragma warning(pop) |
| 4353 |
#elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) |
| 4354 |
#pragma GCC diagnostic pop |
| 4355 |
#endif |
| 4356 |
|
| 4357 |
|
| 4358 |
|
| 4359 |
|
| 4360 |
|
| 4361 |
|
| 4362 |
|
| 4363 |
|
| 4364 |
|
| 4365 |
|
| 4366 |
|
| 4367 |
|
| 4368 |
|
| 4369 |
|
| 4370 |
|
| 4371 |
|
| 4372 |
|
| 4373 |
|
| 4374 |
|
| 4375 |
|
| 4376 |
|
| 4377 |
|
| 4378 |
MA_API ma_context_config ma_context_config_init(void); |
| 4379 |
|
| 4380 |
|
| 4381 |
|
| 4382 |
|
| 4383 |
|
| 4384 |
|
| 4385 |
|
| 4386 |
|
| 4387 |
|
| 4388 |
|
| 4389 |
|
| 4390 |
|
| 4391 |
|
| 4392 |
|
| 4393 |
|
| 4394 |
|
| 4395 |
|
| 4396 |
|
| 4397 |
|
| 4398 |
|
| 4399 |
|
| 4400 |
|
| 4401 |
|
| 4402 |
|
| 4403 |
|
| 4404 |
|
| 4405 |
|
| 4406 |
|
| 4407 |
|
| 4408 |
|
| 4409 |
|
| 4410 |
|
| 4411 |
|
| 4412 |
|
| 4413 |
|
| 4414 |
|
| 4415 |
|
| 4416 |
|
| 4417 |
|
| 4418 |
|
| 4419 |
|
| 4420 |
|
| 4421 |
|
| 4422 |
|
| 4423 |
|
| 4424 |
|
| 4425 |
|
| 4426 |
|
| 4427 |
|
| 4428 |
|
| 4429 |
|
| 4430 |
|
| 4431 |
|
| 4432 |
|
| 4433 |
|
| 4434 |
|
| 4435 |
|
| 4436 |
|
| 4437 |
|
| 4438 |
|
| 4439 |
|
| 4440 |
|
| 4441 |
|
| 4442 |
|
| 4443 |
|
| 4444 |
|
| 4445 |
|
| 4446 |
|
| 4447 |
|
| 4448 |
|
| 4449 |
|
| 4450 |
|
| 4451 |
|
| 4452 |
|
| 4453 |
|
| 4454 |
|
| 4455 |
|
| 4456 |
|
| 4457 |
|
| 4458 |
|
| 4459 |
|
| 4460 |
|
| 4461 |
|
| 4462 |
|
| 4463 |
|
| 4464 |
|
| 4465 |
|
| 4466 |
|
| 4467 |
|
| 4468 |
|
| 4469 |
|
| 4470 |
|
| 4471 |
|
| 4472 |
|
| 4473 |
|
| 4474 |
|
| 4475 |
|
| 4476 |
|
| 4477 |
|
| 4478 |
|
| 4479 |
|
| 4480 |
|
| 4481 |
|
| 4482 |
|
| 4483 |
|
| 4484 |
|
| 4485 |
|
| 4486 |
|
| 4487 |
|
| 4488 |
|
| 4489 |
|
| 4490 |
|
| 4491 |
|
| 4492 |
|
| 4493 |
|
| 4494 |
|
| 4495 |
|
| 4496 |
|
| 4497 |
|
| 4498 |
|
| 4499 |
|
| 4500 |
|
| 4501 |
|
| 4502 |
|
| 4503 |
|
| 4504 |
|
| 4505 |
|
| 4506 |
|
| 4507 |
|
| 4508 |
|
| 4509 |
|
| 4510 |
|
| 4511 |
|
| 4512 |
|
| 4513 |
|
| 4514 |
|
| 4515 |
|
| 4516 |
|
| 4517 |
|
| 4518 |
|
| 4519 |
|
| 4520 |
|
| 4521 |
|
| 4522 |
|
| 4523 |
|
| 4524 |
|
| 4525 |
|
| 4526 |
|
| 4527 |
|
| 4528 |
|
| 4529 |
|
| 4530 |
|
| 4531 |
|
| 4532 |
|
| 4533 |
|
| 4534 |
|
| 4535 |
|
| 4536 |
|
| 4537 |
|
| 4538 |
|
| 4539 |
|
| 4540 |
|
| 4541 |
|
| 4542 |
|
| 4543 |
|
| 4544 |
|
| 4545 |
|
| 4546 |
|
| 4547 |
|
| 4548 |
|
| 4549 |
|
| 4550 |
|
| 4551 |
|
| 4552 |
|
| 4553 |
|
| 4554 |
|
| 4555 |
|
| 4556 |
|
| 4557 |
|
| 4558 |
|
| 4559 |
|
| 4560 |
|
| 4561 |
|
| 4562 |
|
| 4563 |
|
| 4564 |
|
| 4565 |
|
| 4566 |
|
| 4567 |
|
| 4568 |
|
| 4569 |
|
| 4570 |
|
| 4571 |
|
| 4572 |
|
| 4573 |
|
| 4574 |
|
| 4575 |
|
| 4576 |
|
| 4577 |
|
| 4578 |
|
| 4579 |
|
| 4580 |
|
| 4581 |
|
| 4582 |
|
| 4583 |
|
| 4584 |
|
| 4585 |
|
| 4586 |
|
| 4587 |
|
| 4588 |
|
| 4589 |
|
| 4590 |
MA_API ma_result ma_context_init(const ma_backend backends[], ma_uint32 backendCount, const ma_context_config* pConfig, ma_context* pContext); |
| 4591 |
|
| 4592 |
|
| 4593 |
|
| 4594 |
|
| 4595 |
|
| 4596 |
|
| 4597 |
|
| 4598 |
|
| 4599 |
|
| 4600 |
|
| 4601 |
|
| 4602 |
|
| 4603 |
|
| 4604 |
|
| 4605 |
|
| 4606 |
|
| 4607 |
|
| 4608 |
|
| 4609 |
|
| 4610 |
|
| 4611 |
|
| 4612 |
|
| 4613 |
|
| 4614 |
|
| 4615 |
MA_API ma_result ma_context_uninit(ma_context* pContext); |
| 4616 |
|
| 4617 |
|
| 4618 |
|
| 4619 |
|
| 4620 |
|
| 4621 |
|
| 4622 |
MA_API size_t ma_context_sizeof(void); |
| 4623 |
|
| 4624 |
|
| 4625 |
|
| 4626 |
|
| 4627 |
|
| 4628 |
|
| 4629 |
|
| 4630 |
|
| 4631 |
|
| 4632 |
|
| 4633 |
|
| 4634 |
|
| 4635 |
|
| 4636 |
|
| 4637 |
|
| 4638 |
|
| 4639 |
|
| 4640 |
|
| 4641 |
MA_API ma_log* ma_context_get_log(ma_context* pContext); |
| 4642 |
|
| 4643 |
|
| 4644 |
|
| 4645 |
|
| 4646 |
|
| 4647 |
|
| 4648 |
|
| 4649 |
|
| 4650 |
|
| 4651 |
|
| 4652 |
|
| 4653 |
|
| 4654 |
|
| 4655 |
|
| 4656 |
|
| 4657 |
|
| 4658 |
|
| 4659 |
|
| 4660 |
|
| 4661 |
|
| 4662 |
|
| 4663 |
|
| 4664 |
|
| 4665 |
|
| 4666 |
|
| 4667 |
|
| 4668 |
|
| 4669 |
|
| 4670 |
|
| 4671 |
|
| 4672 |
|
| 4673 |
|
| 4674 |
|
| 4675 |
|
| 4676 |
|
| 4677 |
|
| 4678 |
|
| 4679 |
|
| 4680 |
|
| 4681 |
|
| 4682 |
|
| 4683 |
|
| 4684 |
|
| 4685 |
|
| 4686 |
|
| 4687 |
|
| 4688 |
|
| 4689 |
|
| 4690 |
|
| 4691 |
|
| 4692 |
|
| 4693 |
|
| 4694 |
|
| 4695 |
|
| 4696 |
|
| 4697 |
|
| 4698 |
|
| 4699 |
|
| 4700 |
|
| 4701 |
|
| 4702 |
|
| 4703 |
|
| 4704 |
|
| 4705 |
|
| 4706 |
|
| 4707 |
|
| 4708 |
MA_API ma_result ma_context_enumerate_devices(ma_context* pContext, ma_enum_devices_callback_proc callback, void* pUserData); |
| 4709 |
|
| 4710 |
|
| 4711 |
|
| 4712 |
|
| 4713 |
|
| 4714 |
|
| 4715 |
|
| 4716 |
|
| 4717 |
|
| 4718 |
|
| 4719 |
|
| 4720 |
|
| 4721 |
|
| 4722 |
|
| 4723 |
|
| 4724 |
|
| 4725 |
|
| 4726 |
|
| 4727 |
|
| 4728 |
|
| 4729 |
|
| 4730 |
|
| 4731 |
|
| 4732 |
|
| 4733 |
|
| 4734 |
|
| 4735 |
|
| 4736 |
|
| 4737 |
|
| 4738 |
|
| 4739 |
|
| 4740 |
|
| 4741 |
|
| 4742 |
|
| 4743 |
|
| 4744 |
|
| 4745 |
|
| 4746 |
|
| 4747 |
|
| 4748 |
|
| 4749 |
|
| 4750 |
|
| 4751 |
|
| 4752 |
|
| 4753 |
|
| 4754 |
|
| 4755 |
|
| 4756 |
|
| 4757 |
|
| 4758 |
|
| 4759 |
|
| 4760 |
|
| 4761 |
|
| 4762 |
|
| 4763 |
MA_API ma_result ma_context_get_devices(ma_context* pContext, ma_device_info** ppPlaybackDeviceInfos, ma_uint32* pPlaybackDeviceCount, ma_device_info** ppCaptureDeviceInfos, ma_uint32* pCaptureDeviceCount); |
| 4764 |
|
| 4765 |
|
| 4766 |
|
| 4767 |
|
| 4768 |
|
| 4769 |
|
| 4770 |
|
| 4771 |
|
| 4772 |
|
| 4773 |
|
| 4774 |
|
| 4775 |
|
| 4776 |
|
| 4777 |
|
| 4778 |
|
| 4779 |
|
| 4780 |
|
| 4781 |
|
| 4782 |
|
| 4783 |
|
| 4784 |
|
| 4785 |
|
| 4786 |
|
| 4787 |
|
| 4788 |
|
| 4789 |
|
| 4790 |
|
| 4791 |
|
| 4792 |
|
| 4793 |
|
| 4794 |
|
| 4795 |
|
| 4796 |
|
| 4797 |
|
| 4798 |
|
| 4799 |
|
| 4800 |
|
| 4801 |
|
| 4802 |
|
| 4803 |
|
| 4804 |
|
| 4805 |
MA_API ma_result ma_context_get_device_info(ma_context* pContext, ma_device_type deviceType, const ma_device_id* pDeviceID, ma_device_info* pDeviceInfo); |
| 4806 |
|
| 4807 |
|
| 4808 |
|
| 4809 |
|
| 4810 |
|
| 4811 |
|
| 4812 |
|
| 4813 |
|
| 4814 |
|
| 4815 |
|
| 4816 |
|
| 4817 |
|
| 4818 |
|
| 4819 |
|
| 4820 |
|
| 4821 |
MA_API ma_bool32 ma_context_is_loopback_supported(ma_context* pContext); |
| 4822 |
|
| 4823 |
|
| 4824 |
|
| 4825 |
|
| 4826 |
|
| 4827 |
|
| 4828 |
|
| 4829 |
|
| 4830 |
|
| 4831 |
|
| 4832 |
|
| 4833 |
|
| 4834 |
|
| 4835 |
|
| 4836 |
|
| 4837 |
|
| 4838 |
|
| 4839 |
|
| 4840 |
|
| 4841 |
|
| 4842 |
|
| 4843 |
|
| 4844 |
|
| 4845 |
|
| 4846 |
|
| 4847 |
|
| 4848 |
|
| 4849 |
|
| 4850 |
|
| 4851 |
|
| 4852 |
|
| 4853 |
|
| 4854 |
|
| 4855 |
|
| 4856 |
|
| 4857 |
|
| 4858 |
|
| 4859 |
|
| 4860 |
|
| 4861 |
|
| 4862 |
|
| 4863 |
|
| 4864 |
|
| 4865 |
|
| 4866 |
|
| 4867 |
|
| 4868 |
|
| 4869 |
|
| 4870 |
|
| 4871 |
|
| 4872 |
|
| 4873 |
|
| 4874 |
|
| 4875 |
|
| 4876 |
|
| 4877 |
|
| 4878 |
|
| 4879 |
|
| 4880 |
|
| 4881 |
|
| 4882 |
|
| 4883 |
|
| 4884 |
|
| 4885 |
|
| 4886 |
|
| 4887 |
|
| 4888 |
|
| 4889 |
MA_API ma_device_config ma_device_config_init(ma_device_type deviceType); |
| 4890 |
|
| 4891 |
|
| 4892 |
|
| 4893 |
|
| 4894 |
|
| 4895 |
|
| 4896 |
|
| 4897 |
|
| 4898 |
|
| 4899 |
|
| 4900 |
|
| 4901 |
|
| 4902 |
|
| 4903 |
|
| 4904 |
|
| 4905 |
|
| 4906 |
|
| 4907 |
|
| 4908 |
|
| 4909 |
|
| 4910 |
|
| 4911 |
|
| 4912 |
|
| 4913 |
|
| 4914 |
|
| 4915 |
|
| 4916 |
|
| 4917 |
|
| 4918 |
|
| 4919 |
|
| 4920 |
|
| 4921 |
|
| 4922 |
|
| 4923 |
|
| 4924 |
|
| 4925 |
|
| 4926 |
|
| 4927 |
|
| 4928 |
|
| 4929 |
|
| 4930 |
|
| 4931 |
|
| 4932 |
|
| 4933 |
|
| 4934 |
|
| 4935 |
|
| 4936 |
|
| 4937 |
|
| 4938 |
|
| 4939 |
|
| 4940 |
|
| 4941 |
|
| 4942 |
|
| 4943 |
|
| 4944 |
|
| 4945 |
|
| 4946 |
|
| 4947 |
|
| 4948 |
|
| 4949 |
|
| 4950 |
|
| 4951 |
|
| 4952 |
|
| 4953 |
|
| 4954 |
|
| 4955 |
|
| 4956 |
|
| 4957 |
|
| 4958 |
|
| 4959 |
|
| 4960 |
|
| 4961 |
|
| 4962 |
|
| 4963 |
|
| 4964 |
|
| 4965 |
|
| 4966 |
|
| 4967 |
|
| 4968 |
|
| 4969 |
|
| 4970 |
|
| 4971 |
|
| 4972 |
|
| 4973 |
|
| 4974 |
|
| 4975 |
|
| 4976 |
|
| 4977 |
|
| 4978 |
|
| 4979 |
|
| 4980 |
|
| 4981 |
|
| 4982 |
|
| 4983 |
|
| 4984 |
|
| 4985 |
|
| 4986 |
|
| 4987 |
|
| 4988 |
|
| 4989 |
|
| 4990 |
|
| 4991 |
|
| 4992 |
|
| 4993 |
|
| 4994 |
|
| 4995 |
|
| 4996 |
|
| 4997 |
|
| 4998 |
|
| 4999 |
|
| 5000 |
|
| 5001 |
|
| 5002 |
|
| 5003 |
|
| 5004 |
|
| 5005 |
|
| 5006 |
|
| 5007 |
|
| 5008 |
|
| 5009 |
|
| 5010 |
|
| 5011 |
|
| 5012 |
|
| 5013 |
|
| 5014 |
|
| 5015 |
|
| 5016 |
|
| 5017 |
|
| 5018 |
|
| 5019 |
|
| 5020 |
|
| 5021 |
|
| 5022 |
|
| 5023 |
|
| 5024 |
|
| 5025 |
|
| 5026 |
|
| 5027 |
|
| 5028 |
|
| 5029 |
|
| 5030 |
|
| 5031 |
|
| 5032 |
|
| 5033 |
|
| 5034 |
|
| 5035 |
|
| 5036 |
|
| 5037 |
|
| 5038 |
|
| 5039 |
|
| 5040 |
|
| 5041 |
|
| 5042 |
|
| 5043 |
|
| 5044 |
|
| 5045 |
|
| 5046 |
|
| 5047 |
|
| 5048 |
|
| 5049 |
|
| 5050 |
|
| 5051 |
|
| 5052 |
|
| 5053 |
|
| 5054 |
|
| 5055 |
|
| 5056 |
|
| 5057 |
|
| 5058 |
|
| 5059 |
|
| 5060 |
|
| 5061 |
|
| 5062 |
|
| 5063 |
|
| 5064 |
|
| 5065 |
|
| 5066 |
|
| 5067 |
|
| 5068 |
|
| 5069 |
|
| 5070 |
|
| 5071 |
|
| 5072 |
|
| 5073 |
|
| 5074 |
|
| 5075 |
|
| 5076 |
|
| 5077 |
|
| 5078 |
|
| 5079 |
|
| 5080 |
|
| 5081 |
|
| 5082 |
|
| 5083 |
|
| 5084 |
|
| 5085 |
|
| 5086 |
|
| 5087 |
|
| 5088 |
|
| 5089 |
|
| 5090 |
|
| 5091 |
|
| 5092 |
|
| 5093 |
|
| 5094 |
|
| 5095 |
|
| 5096 |
|
| 5097 |
|
| 5098 |
|
| 5099 |
|
| 5100 |
|
| 5101 |
|
| 5102 |
|
| 5103 |
|
| 5104 |
|
| 5105 |
|
| 5106 |
|
| 5107 |
|
| 5108 |
|
| 5109 |
|
| 5110 |
|
| 5111 |
|
| 5112 |
|
| 5113 |
|
| 5114 |
|
| 5115 |
|
| 5116 |
|
| 5117 |
|
| 5118 |
|
| 5119 |
|
| 5120 |
|
| 5121 |
|
| 5122 |
|
| 5123 |
|
| 5124 |
|
| 5125 |
|
| 5126 |
|
| 5127 |
|
| 5128 |
|
| 5129 |
|
| 5130 |
|
| 5131 |
|
| 5132 |
|
| 5133 |
|
| 5134 |
|
| 5135 |
|
| 5136 |
|
| 5137 |
|
| 5138 |
|
| 5139 |
|
| 5140 |
|
| 5141 |
|
| 5142 |
|
| 5143 |
|
| 5144 |
|
| 5145 |
|
| 5146 |
|
| 5147 |
|
| 5148 |
|
| 5149 |
|
| 5150 |
|
| 5151 |
|
| 5152 |
|
| 5153 |
|
| 5154 |
|
| 5155 |
|
| 5156 |
|
| 5157 |
|
| 5158 |
|
| 5159 |
|
| 5160 |
|
| 5161 |
|
| 5162 |
|
| 5163 |
|
| 5164 |
|
| 5165 |
|
| 5166 |
|
| 5167 |
|
| 5168 |
|
| 5169 |
|
| 5170 |
|
| 5171 |
|
| 5172 |
|
| 5173 |
|
| 5174 |
|
| 5175 |
|
| 5176 |
|
| 5177 |
|
| 5178 |
|
| 5179 |
|
| 5180 |
|
| 5181 |
|
| 5182 |
|
| 5183 |
|
| 5184 |
|
| 5185 |
|
| 5186 |
|
| 5187 |
|
| 5188 |
|
| 5189 |
|
| 5190 |
|
| 5191 |
|
| 5192 |
|
| 5193 |
|
| 5194 |
|
| 5195 |
|
| 5196 |
|
| 5197 |
|
| 5198 |
|
| 5199 |
|
| 5200 |
|
| 5201 |
|
| 5202 |
|
| 5203 |
|
| 5204 |
|
| 5205 |
|
| 5206 |
|
| 5207 |
|
| 5208 |
|
| 5209 |
|
| 5210 |
|
| 5211 |
|
| 5212 |
|
| 5213 |
|
| 5214 |
|
| 5215 |
|
| 5216 |
|
| 5217 |
|
| 5218 |
|
| 5219 |
|
| 5220 |
|
| 5221 |
|
| 5222 |
MA_API ma_result ma_device_init(ma_context* pContext, const ma_device_config* pConfig, ma_device* pDevice); |
| 5223 |
|
| 5224 |
|
| 5225 |
|
| 5226 |
|
| 5227 |
|
| 5228 |
|
| 5229 |
|
| 5230 |
|
| 5231 |
|
| 5232 |
|
| 5233 |
|
| 5234 |
|
| 5235 |
|
| 5236 |
|
| 5237 |
|
| 5238 |
|
| 5239 |
|
| 5240 |
|
| 5241 |
|
| 5242 |
|
| 5243 |
|
| 5244 |
|
| 5245 |
|
| 5246 |
|
| 5247 |
|
| 5248 |
|
| 5249 |
|
| 5250 |
|
| 5251 |
|
| 5252 |
|
| 5253 |
|
| 5254 |
|
| 5255 |
|
| 5256 |
|
| 5257 |
|
| 5258 |
|
| 5259 |
|
| 5260 |
|
| 5261 |
|
| 5262 |
|
| 5263 |
|
| 5264 |
|
| 5265 |
|
| 5266 |
|
| 5267 |
|
| 5268 |
|
| 5269 |
|
| 5270 |
|
| 5271 |
|
| 5272 |
|
| 5273 |
|
| 5274 |
|
| 5275 |
|
| 5276 |
|
| 5277 |
|
| 5278 |
|
| 5279 |
|
| 5280 |
MA_API ma_result ma_device_init_ex(const ma_backend backends[], ma_uint32 backendCount, const ma_context_config* pContextConfig, const ma_device_config* pConfig, ma_device* pDevice); |
| 5281 |
|
| 5282 |
|
| 5283 |
|
| 5284 |
|
| 5285 |
|
| 5286 |
|
| 5287 |
|
| 5288 |
|
| 5289 |
|
| 5290 |
|
| 5291 |
|
| 5292 |
|
| 5293 |
|
| 5294 |
|
| 5295 |
|
| 5296 |
|
| 5297 |
|
| 5298 |
|
| 5299 |
|
| 5300 |
|
| 5301 |
|
| 5302 |
|
| 5303 |
|
| 5304 |
|
| 5305 |
|
| 5306 |
|
| 5307 |
|
| 5308 |
|
| 5309 |
|
| 5310 |
|
| 5311 |
|
| 5312 |
|
| 5313 |
|
| 5314 |
MA_API void ma_device_uninit(ma_device* pDevice); |
| 5315 |
|
| 5316 |
|
| 5317 |
|
| 5318 |
|
| 5319 |
|
| 5320 |
MA_API ma_context* ma_device_get_context(ma_device* pDevice); |
| 5321 |
|
| 5322 |
|
| 5323 |
|
| 5324 |
|
| 5325 |
MA_API ma_log* ma_device_get_log(ma_device* pDevice); |
| 5326 |
|
| 5327 |
|
| 5328 |
|
| 5329 |
|
| 5330 |
|
| 5331 |
|
| 5332 |
|
| 5333 |
|
| 5334 |
|
| 5335 |
|
| 5336 |
|
| 5337 |
|
| 5338 |
|
| 5339 |
|
| 5340 |
|
| 5341 |
|
| 5342 |
|
| 5343 |
|
| 5344 |
|
| 5345 |
|
| 5346 |
|
| 5347 |
|
| 5348 |
|
| 5349 |
|
| 5350 |
|
| 5351 |
|
| 5352 |
|
| 5353 |
|
| 5354 |
|
| 5355 |
|
| 5356 |
|
| 5357 |
|
| 5358 |
|
| 5359 |
|
| 5360 |
|
| 5361 |
MA_API ma_result ma_device_get_info(ma_device* pDevice, ma_device_type type, ma_device_info* pDeviceInfo); |
| 5362 |
|
| 5363 |
|
| 5364 |
|
| 5365 |
|
| 5366 |
|
| 5367 |
|
| 5368 |
|
| 5369 |
|
| 5370 |
|
| 5371 |
|
| 5372 |
|
| 5373 |
|
| 5374 |
|
| 5375 |
|
| 5376 |
|
| 5377 |
|
| 5378 |
|
| 5379 |
|
| 5380 |
|
| 5381 |
|
| 5382 |
|
| 5383 |
|
| 5384 |
|
| 5385 |
|
| 5386 |
|
| 5387 |
|
| 5388 |
|
| 5389 |
|
| 5390 |
|
| 5391 |
|
| 5392 |
|
| 5393 |
|
| 5394 |
|
| 5395 |
|
| 5396 |
|
| 5397 |
|
| 5398 |
|
| 5399 |
|
| 5400 |
|
| 5401 |
|
| 5402 |
|
| 5403 |
|
| 5404 |
|
| 5405 |
|
| 5406 |
|
| 5407 |
|
| 5408 |
|
| 5409 |
|
| 5410 |
|
| 5411 |
|
| 5412 |
|
| 5413 |
|
| 5414 |
MA_API ma_result ma_device_get_name(ma_device* pDevice, ma_device_type type, char* pName, size_t nameCap, size_t* pLengthNotIncludingNullTerminator); |
| 5415 |
|
| 5416 |
|
| 5417 |
|
| 5418 |
|
| 5419 |
|
| 5420 |
|
| 5421 |
|
| 5422 |
|
| 5423 |
|
| 5424 |
|
| 5425 |
|
| 5426 |
|
| 5427 |
|
| 5428 |
|
| 5429 |
|
| 5430 |
|
| 5431 |
|
| 5432 |
|
| 5433 |
|
| 5434 |
|
| 5435 |
|
| 5436 |
|
| 5437 |
|
| 5438 |
|
| 5439 |
|
| 5440 |
|
| 5441 |
|
| 5442 |
|
| 5443 |
|
| 5444 |
|
| 5445 |
|
| 5446 |
|
| 5447 |
|
| 5448 |
|
| 5449 |
|
| 5450 |
|
| 5451 |
|
| 5452 |
|
| 5453 |
|
| 5454 |
|
| 5455 |
|
| 5456 |
|
| 5457 |
|
| 5458 |
MA_API ma_result ma_device_start(ma_device* pDevice); |
| 5459 |
|
| 5460 |
|
| 5461 |
|
| 5462 |
|
| 5463 |
|
| 5464 |
|
| 5465 |
|
| 5466 |
|
| 5467 |
|
| 5468 |
|
| 5469 |
|
| 5470 |
|
| 5471 |
|
| 5472 |
|
| 5473 |
|
| 5474 |
|
| 5475 |
|
| 5476 |
|
| 5477 |
|
| 5478 |
|
| 5479 |
|
| 5480 |
|
| 5481 |
|
| 5482 |
|
| 5483 |
|
| 5484 |
|
| 5485 |
|
| 5486 |
|
| 5487 |
|
| 5488 |
|
| 5489 |
|
| 5490 |
|
| 5491 |
|
| 5492 |
|
| 5493 |
|
| 5494 |
|
| 5495 |
|
| 5496 |
|
| 5497 |
|
| 5498 |
|
| 5499 |
|
| 5500 |
|
| 5501 |
|
| 5502 |
|
| 5503 |
|
| 5504 |
MA_API ma_result ma_device_stop(ma_device* pDevice); |
| 5505 |
|
| 5506 |
|
| 5507 |
|
| 5508 |
|
| 5509 |
|
| 5510 |
|
| 5511 |
|
| 5512 |
|
| 5513 |
|
| 5514 |
|
| 5515 |
|
| 5516 |
|
| 5517 |
|
| 5518 |
|
| 5519 |
|
| 5520 |
|
| 5521 |
|
| 5522 |
|
| 5523 |
|
| 5524 |
|
| 5525 |
|
| 5526 |
|
| 5527 |
|
| 5528 |
|
| 5529 |
|
| 5530 |
|
| 5531 |
|
| 5532 |
|
| 5533 |
|
| 5534 |
|
| 5535 |
|
| 5536 |
|
| 5537 |
MA_API ma_bool32 ma_device_is_started(const ma_device* pDevice); |
| 5538 |
|
| 5539 |
|
| 5540 |
|
| 5541 |
|
| 5542 |
|
| 5543 |
|
| 5544 |
|
| 5545 |
|
| 5546 |
|
| 5547 |
|
| 5548 |
|
| 5549 |
|
| 5550 |
|
| 5551 |
|
| 5552 |
|
| 5553 |
|
| 5554 |
|
| 5555 |
|
| 5556 |
|
| 5557 |
|
| 5558 |
|
| 5559 |
|
| 5560 |
|
| 5561 |
|
| 5562 |
|
| 5563 |
|
| 5564 |
|
| 5565 |
|
| 5566 |
|
| 5567 |
|
| 5568 |
|
| 5569 |
|
| 5570 |
|
| 5571 |
|
| 5572 |
|
| 5573 |
|
| 5574 |
|
| 5575 |
|
| 5576 |
|
| 5577 |
|
| 5578 |
|
| 5579 |
|
| 5580 |
|
| 5581 |
|
| 5582 |
|
| 5583 |
|
| 5584 |
|
| 5585 |
|
| 5586 |
|
| 5587 |
|
| 5588 |
|
| 5589 |
|
| 5590 |
|
| 5591 |
|
| 5592 |
MA_API ma_device_state ma_device_get_state(const ma_device* pDevice); |
| 5593 |
|
| 5594 |
|
| 5595 |
|
| 5596 |
|
| 5597 |
|
| 5598 |
|
| 5599 |
|
| 5600 |
|
| 5601 |
|
| 5602 |
|
| 5603 |
|
| 5604 |
|
| 5605 |
|
| 5606 |
|
| 5607 |
|
| 5608 |
|
| 5609 |
|
| 5610 |
|
| 5611 |
|
| 5612 |
|
| 5613 |
|
| 5614 |
|
| 5615 |
|
| 5616 |
|
| 5617 |
|
| 5618 |
|
| 5619 |
|
| 5620 |
|
| 5621 |
|
| 5622 |
|
| 5623 |
|
| 5624 |
|
| 5625 |
|
| 5626 |
|
| 5627 |
|
| 5628 |
|
| 5629 |
|
| 5630 |
|
| 5631 |
|
| 5632 |
|
| 5633 |
|
| 5634 |
|
| 5635 |
|
| 5636 |
|
| 5637 |
|
| 5638 |
|
| 5639 |
|
| 5640 |
|
| 5641 |
MA_API ma_result ma_device_post_init(ma_device* pDevice, ma_device_type deviceType, const ma_device_descriptor* pPlaybackDescriptor, const ma_device_descriptor* pCaptureDescriptor); |
| 5642 |
|
| 5643 |
|
| 5644 |
|
| 5645 |
|
| 5646 |
|
| 5647 |
|
| 5648 |
|
| 5649 |
|
| 5650 |
|
| 5651 |
|
| 5652 |
|
| 5653 |
|
| 5654 |
|
| 5655 |
|
| 5656 |
|
| 5657 |
|
| 5658 |
|
| 5659 |
|
| 5660 |
|
| 5661 |
|
| 5662 |
|
| 5663 |
|
| 5664 |
|
| 5665 |
|
| 5666 |
|
| 5667 |
|
| 5668 |
|
| 5669 |
|
| 5670 |
|
| 5671 |
|
| 5672 |
|
| 5673 |
|
| 5674 |
|
| 5675 |
|
| 5676 |
|
| 5677 |
|
| 5678 |
|
| 5679 |
|
| 5680 |
|
| 5681 |
|
| 5682 |
|
| 5683 |
|
| 5684 |
|
| 5685 |
|
| 5686 |
|
| 5687 |
|
| 5688 |
|
| 5689 |
|
| 5690 |
MA_API ma_result ma_device_set_master_volume(ma_device* pDevice, float volume); |
| 5691 |
|
| 5692 |
|
| 5693 |
|
| 5694 |
|
| 5695 |
|
| 5696 |
|
| 5697 |
|
| 5698 |
|
| 5699 |
|
| 5700 |
|
| 5701 |
|
| 5702 |
|
| 5703 |
|
| 5704 |
|
| 5705 |
|
| 5706 |
|
| 5707 |
|
| 5708 |
|
| 5709 |
|
| 5710 |
|
| 5711 |
|
| 5712 |
|
| 5713 |
|
| 5714 |
|
| 5715 |
|
| 5716 |
|
| 5717 |
|
| 5718 |
|
| 5719 |
|
| 5720 |
|
| 5721 |
|
| 5722 |
|
| 5723 |
|
| 5724 |
|
| 5725 |
|
| 5726 |
|
| 5727 |
|
| 5728 |
|
| 5729 |
|
| 5730 |
|
| 5731 |
|
| 5732 |
|
| 5733 |
MA_API ma_result ma_device_get_master_volume(ma_device* pDevice, float* pVolume); |
| 5734 |
|
| 5735 |
|
| 5736 |
|
| 5737 |
|
| 5738 |
|
| 5739 |
|
| 5740 |
|
| 5741 |
|
| 5742 |
|
| 5743 |
|
| 5744 |
|
| 5745 |
|
| 5746 |
|
| 5747 |
|
| 5748 |
|
| 5749 |
|
| 5750 |
|
| 5751 |
|
| 5752 |
|
| 5753 |
|
| 5754 |
|
| 5755 |
|
| 5756 |
|
| 5757 |
|
| 5758 |
|
| 5759 |
|
| 5760 |
|
| 5761 |
|
| 5762 |
|
| 5763 |
|
| 5764 |
|
| 5765 |
|
| 5766 |
|
| 5767 |
|
| 5768 |
|
| 5769 |
|
| 5770 |
|
| 5771 |
|
| 5772 |
|
| 5773 |
|
| 5774 |
|
| 5775 |
|
| 5776 |
|
| 5777 |
|
| 5778 |
|
| 5779 |
|
| 5780 |
MA_API ma_result ma_device_set_master_volume_db(ma_device* pDevice, float gainDB); |
| 5781 |
|
| 5782 |
|
| 5783 |
|
| 5784 |
|
| 5785 |
|
| 5786 |
|
| 5787 |
|
| 5788 |
|
| 5789 |
|
| 5790 |
|
| 5791 |
|
| 5792 |
|
| 5793 |
|
| 5794 |
|
| 5795 |
|
| 5796 |
|
| 5797 |
|
| 5798 |
|
| 5799 |
|
| 5800 |
|
| 5801 |
|
| 5802 |
|
| 5803 |
|
| 5804 |
|
| 5805 |
|
| 5806 |
|
| 5807 |
|
| 5808 |
|
| 5809 |
|
| 5810 |
|
| 5811 |
|
| 5812 |
|
| 5813 |
|
| 5814 |
|
| 5815 |
|
| 5816 |
|
| 5817 |
|
| 5818 |
|
| 5819 |
|
| 5820 |
|
| 5821 |
|
| 5822 |
|
| 5823 |
MA_API ma_result ma_device_get_master_volume_db(ma_device* pDevice, float* pGainDB); |
| 5824 |
|
| 5825 |
|
| 5826 |
|
| 5827 |
|
| 5828 |
|
| 5829 |
|
| 5830 |
|
| 5831 |
|
| 5832 |
|
| 5833 |
|
| 5834 |
|
| 5835 |
|
| 5836 |
|
| 5837 |
|
| 5838 |
|
| 5839 |
|
| 5840 |
|
| 5841 |
|
| 5842 |
|
| 5843 |
|
| 5844 |
|
| 5845 |
|
| 5846 |
|
| 5847 |
|
| 5848 |
|
| 5849 |
|
| 5850 |
|
| 5851 |
|
| 5852 |
|
| 5853 |
|
| 5854 |
|
| 5855 |
|
| 5856 |
|
| 5857 |
|
| 5858 |
|
| 5859 |
|
| 5860 |
|
| 5861 |
|
| 5862 |
|
| 5863 |
|
| 5864 |
|
| 5865 |
|
| 5866 |
|
| 5867 |
|
| 5868 |
|
| 5869 |
|
| 5870 |
|
| 5871 |
MA_API ma_result ma_device_handle_backend_data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount); |
| 5872 |
|
| 5873 |
|
| 5874 |
|
| 5875 |
|
| 5876 |
|
| 5877 |
|
| 5878 |
|
| 5879 |
|
| 5880 |
|
| 5881 |
|
| 5882 |
|
| 5883 |
|
| 5884 |
|
| 5885 |
|
| 5886 |
|
| 5887 |
|
| 5888 |
|
| 5889 |
|
| 5890 |
|
| 5891 |
|
| 5892 |
|
| 5893 |
|
| 5894 |
|
| 5895 |
|
| 5896 |
|
| 5897 |
|
| 5898 |
|
| 5899 |
|
| 5900 |
|
| 5901 |
|
| 5902 |
|
| 5903 |
|
| 5904 |
|
| 5905 |
|
| 5906 |
|
| 5907 |
|
| 5908 |
|
| 5909 |
|
| 5910 |
|
| 5911 |
|
| 5912 |
|
| 5913 |
|
| 5914 |
|
| 5915 |
|
| 5916 |
|
| 5917 |
|
| 5918 |
|
| 5919 |
|
| 5920 |
|
| 5921 |
|
| 5922 |
|
| 5923 |
|
| 5924 |
MA_API ma_uint32 ma_calculate_buffer_size_in_frames_from_descriptor(const ma_device_descriptor* pDescriptor, ma_uint32 nativeSampleRate, ma_performance_profile performanceProfile); |
| 5925 |
|
| 5926 |
|
| 5927 |
|
| 5928 |
|
| 5929 |
|
| 5930 |
|
| 5931 |
MA_API const char* ma_get_backend_name(ma_backend backend); |
| 5932 |
|
| 5933 |
|
| 5934 |
|
| 5935 |
|
| 5936 |
MA_API ma_result ma_get_backend_from_name(const char* pBackendName, ma_backend* pBackend); |
| 5937 |
|
| 5938 |
|
| 5939 |
|
| 5940 |
|
| 5941 |
MA_API ma_bool32 ma_is_backend_enabled(ma_backend backend); |
| 5942 |
|
| 5943 |
|
| 5944 |
|
| 5945 |
|
| 5946 |
|
| 5947 |
|
| 5948 |
|
| 5949 |
|
| 5950 |
|
| 5951 |
|
| 5952 |
|
| 5953 |
|
| 5954 |
|
| 5955 |
|
| 5956 |
|
| 5957 |
|
| 5958 |
|
| 5959 |
|
| 5960 |
|
| 5961 |
|
| 5962 |
|
| 5963 |
|
| 5964 |
|
| 5965 |
|
| 5966 |
|
| 5967 |
|
| 5968 |
|
| 5969 |
|
| 5970 |
|
| 5971 |
|
| 5972 |
|
| 5973 |
|
| 5974 |
|
| 5975 |
|
| 5976 |
|
| 5977 |
|
| 5978 |
|
| 5979 |
|
| 5980 |
|
| 5981 |
|
| 5982 |
|
| 5983 |
|
| 5984 |
|
| 5985 |
|
| 5986 |
|
| 5987 |
|
| 5988 |
|
| 5989 |
|
| 5990 |
|
| 5991 |
|
| 5992 |
|
| 5993 |
|
| 5994 |
|
| 5995 |
|
| 5996 |
|
| 5997 |
|
| 5998 |
|
| 5999 |
|
| 6000 |
|
| 6001 |
|
| 6002 |
|
| 6003 |
|
| 6004 |
|
| 6005 |
|
| 6006 |
|
| 6007 |
|
| 6008 |
|
| 6009 |
|
| 6010 |
|
| 6011 |
|
| 6012 |
|
| 6013 |
|
| 6014 |
MA_API ma_result ma_get_enabled_backends(ma_backend* pBackends, size_t backendCap, size_t* pBackendCount); |
| 6015 |
|
| 6016 |
|
| 6017 |
|
| 6018 |
|
| 6019 |
MA_API ma_bool32 ma_is_loopback_supported(ma_backend backend); |
| 6020 |
|
| 6021 |
#endif |
| 6022 |
|
| 6023 |
|
| 6024 |
|
| 6025 |
|
| 6026 |
|
| 6027 |
|
| 6028 |
|
| 6029 |
|
| 6030 |
|
| 6031 |
|
| 6032 |
|
| 6033 |
|
| 6034 |
MA_API ma_uint32 ma_calculate_buffer_size_in_milliseconds_from_frames(ma_uint32 bufferSizeInFrames, ma_uint32 sampleRate); |
| 6035 |
|
| 6036 |
|
| 6037 |
|
| 6038 |
|
| 6039 |
MA_API ma_uint32 ma_calculate_buffer_size_in_frames_from_milliseconds(ma_uint32 bufferSizeInMilliseconds, ma_uint32 sampleRate); |
| 6040 |
|
| 6041 |
|
| 6042 |
|
| 6043 |
|
| 6044 |
MA_API void ma_copy_pcm_frames(void* dst, const void* src, ma_uint64 frameCount, ma_format format, ma_uint32 channels); |
| 6045 |
|
| 6046 |
|
| 6047 |
|
| 6048 |
|
| 6049 |
|
| 6050 |
|
| 6051 |
|
| 6052 |
|
| 6053 |
|
| 6054 |
MA_API void ma_silence_pcm_frames(void* p, ma_uint64 frameCount, ma_format format, ma_uint32 channels); |
| 6055 |
|
| 6056 |
|
| 6057 |
|
| 6058 |
|
| 6059 |
|
| 6060 |
MA_API void* ma_offset_pcm_frames_ptr(void* p, ma_uint64 offsetInFrames, ma_format format, ma_uint32 channels); |
| 6061 |
MA_API const void* ma_offset_pcm_frames_const_ptr(const void* p, ma_uint64 offsetInFrames, ma_format format, ma_uint32 channels); |
| 6062 |
static MA_INLINE float* ma_offset_pcm_frames_ptr_f32(float* p, ma_uint64 offsetInFrames, ma_uint32 channels) { return (float*)ma_offset_pcm_frames_ptr((void*)p, offsetInFrames, ma_format_f32, channels); } |
| 6063 |
static MA_INLINE const float* ma_offset_pcm_frames_const_ptr_f32(const float* p, ma_uint64 offsetInFrames, ma_uint32 channels) { return (const float*)ma_offset_pcm_frames_const_ptr((const void*)p, offsetInFrames, ma_format_f32, channels); } |
| 6064 |
|
| 6065 |
|
| 6066 |
|
| 6067 |
|
| 6068 |
|
| 6069 |
MA_API void ma_clip_samples_u8(ma_uint8* pDst, const ma_int16* pSrc, ma_uint64 count); |
| 6070 |
MA_API void ma_clip_samples_s16(ma_int16* pDst, const ma_int32* pSrc, ma_uint64 count); |
| 6071 |
MA_API void ma_clip_samples_s24(ma_uint8* pDst, const ma_int64* pSrc, ma_uint64 count); |
| 6072 |
MA_API void ma_clip_samples_s32(ma_int32* pDst, const ma_int64* pSrc, ma_uint64 count); |
| 6073 |
MA_API void ma_clip_samples_f32(float* pDst, const float* pSrc, ma_uint64 count); |
| 6074 |
MA_API void ma_clip_pcm_frames(void* pDst, const void* pSrc, ma_uint64 frameCount, ma_format format, ma_uint32 channels); |
| 6075 |
|
| 6076 |
|
| 6077 |
|
| 6078 |
|
| 6079 |
|
| 6080 |
|
| 6081 |
MA_API void ma_copy_and_apply_volume_factor_u8(ma_uint8* pSamplesOut, const ma_uint8* pSamplesIn, ma_uint64 sampleCount, float factor); |
| 6082 |
MA_API void ma_copy_and_apply_volume_factor_s16(ma_int16* pSamplesOut, const ma_int16* pSamplesIn, ma_uint64 sampleCount, float factor); |
| 6083 |
MA_API void ma_copy_and_apply_volume_factor_s24(void* pSamplesOut, const void* pSamplesIn, ma_uint64 sampleCount, float factor); |
| 6084 |
MA_API void ma_copy_and_apply_volume_factor_s32(ma_int32* pSamplesOut, const ma_int32* pSamplesIn, ma_uint64 sampleCount, float factor); |
| 6085 |
MA_API void ma_copy_and_apply_volume_factor_f32(float* pSamplesOut, const float* pSamplesIn, ma_uint64 sampleCount, float factor); |
| 6086 |
|
| 6087 |
MA_API void ma_apply_volume_factor_u8(ma_uint8* pSamples, ma_uint64 sampleCount, float factor); |
| 6088 |
MA_API void ma_apply_volume_factor_s16(ma_int16* pSamples, ma_uint64 sampleCount, float factor); |
| 6089 |
MA_API void ma_apply_volume_factor_s24(void* pSamples, ma_uint64 sampleCount, float factor); |
| 6090 |
MA_API void ma_apply_volume_factor_s32(ma_int32* pSamples, ma_uint64 sampleCount, float factor); |
| 6091 |
MA_API void ma_apply_volume_factor_f32(float* pSamples, ma_uint64 sampleCount, float factor); |
| 6092 |
|
| 6093 |
MA_API void ma_copy_and_apply_volume_factor_pcm_frames_u8(ma_uint8* pFramesOut, const ma_uint8* pFramesIn, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6094 |
MA_API void ma_copy_and_apply_volume_factor_pcm_frames_s16(ma_int16* pFramesOut, const ma_int16* pFramesIn, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6095 |
MA_API void ma_copy_and_apply_volume_factor_pcm_frames_s24(void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6096 |
MA_API void ma_copy_and_apply_volume_factor_pcm_frames_s32(ma_int32* pFramesOut, const ma_int32* pFramesIn, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6097 |
MA_API void ma_copy_and_apply_volume_factor_pcm_frames_f32(float* pFramesOut, const float* pFramesIn, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6098 |
MA_API void ma_copy_and_apply_volume_factor_pcm_frames(void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount, ma_format format, ma_uint32 channels, float factor); |
| 6099 |
|
| 6100 |
MA_API void ma_apply_volume_factor_pcm_frames_u8(ma_uint8* pFrames, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6101 |
MA_API void ma_apply_volume_factor_pcm_frames_s16(ma_int16* pFrames, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6102 |
MA_API void ma_apply_volume_factor_pcm_frames_s24(void* pFrames, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6103 |
MA_API void ma_apply_volume_factor_pcm_frames_s32(ma_int32* pFrames, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6104 |
MA_API void ma_apply_volume_factor_pcm_frames_f32(float* pFrames, ma_uint64 frameCount, ma_uint32 channels, float factor); |
| 6105 |
MA_API void ma_apply_volume_factor_pcm_frames(void* pFrames, ma_uint64 frameCount, ma_format format, ma_uint32 channels, float factor); |
| 6106 |
|
| 6107 |
MA_API void ma_copy_and_apply_volume_factor_per_channel_f32(float* pFramesOut, const float* pFramesIn, ma_uint64 frameCount, ma_uint32 channels, float* pChannelGains); |
| 6108 |
|
| 6109 |
|
| 6110 |
MA_API void ma_copy_and_apply_volume_and_clip_samples_u8(ma_uint8* pDst, const ma_int16* pSrc, ma_uint64 count, float volume); |
| 6111 |
MA_API void ma_copy_and_apply_volume_and_clip_samples_s16(ma_int16* pDst, const ma_int32* pSrc, ma_uint64 count, float volume); |
| 6112 |
MA_API void ma_copy_and_apply_volume_and_clip_samples_s24(ma_uint8* pDst, const ma_int64* pSrc, ma_uint64 count, float volume); |
| 6113 |
MA_API void ma_copy_and_apply_volume_and_clip_samples_s32(ma_int32* pDst, const ma_int64* pSrc, ma_uint64 count, float volume); |
| 6114 |
MA_API void ma_copy_and_apply_volume_and_clip_samples_f32(float* pDst, const float* pSrc, ma_uint64 count, float volume); |
| 6115 |
MA_API void ma_copy_and_apply_volume_and_clip_pcm_frames(void* pDst, const void* pSrc, ma_uint64 frameCount, ma_format format, ma_uint32 channels, float volume); |
| 6116 |
|
| 6117 |
|
| 6118 |
|
| 6119 |
|
| 6120 |
|
| 6121 |
MA_API float ma_volume_linear_to_db(float factor); |
| 6122 |
|
| 6123 |
|
| 6124 |
|
| 6125 |
|
| 6126 |
MA_API float ma_volume_db_to_linear(float gain); |
| 6127 |
|
| 6128 |
|
| 6129 |
|
| 6130 |
|
| 6131 |
|
| 6132 |
|
| 6133 |
|
| 6134 |
MA_API ma_result ma_mix_pcm_frames_f32(float* pDst, const float* pSrc, ma_uint64 frameCount, ma_uint32 channels, float volume); |
| 6135 |
|
| 6136 |
|
| 6137 |
|
| 6138 |
|
| 6139 |
|
| 6140 |
|
| 6141 |
|
| 6142 |
|
| 6143 |
|
| 6144 |
|
| 6145 |
|
| 6146 |
|
| 6147 |
|
| 6148 |
typedef void ma_vfs; |
| 6149 |
typedef ma_handle ma_vfs_file; |
| 6150 |
|
| 6151 |
typedef enum |
| 6152 |
{ |
| 6153 |
MA_OPEN_MODE_READ = 0x00000001, |
| 6154 |
MA_OPEN_MODE_WRITE = 0x00000002 |
| 6155 |
} ma_open_mode_flags; |
| 6156 |
|
| 6157 |
typedef enum |
| 6158 |
{ |
| 6159 |
ma_seek_origin_start, |
| 6160 |
ma_seek_origin_current, |
| 6161 |
ma_seek_origin_end |
| 6162 |
} ma_seek_origin; |
| 6163 |
|
| 6164 |
typedef struct |
| 6165 |
{ |
| 6166 |
ma_uint64 sizeInBytes; |
| 6167 |
} ma_file_info; |
| 6168 |
|
| 6169 |
typedef struct |
| 6170 |
{ |
| 6171 |
ma_result (* onOpen) (ma_vfs* pVFS, const char* pFilePath, ma_uint32 openMode, ma_vfs_file* pFile); |
| 6172 |
ma_result (* onOpenW)(ma_vfs* pVFS, const wchar_t* pFilePath, ma_uint32 openMode, ma_vfs_file* pFile); |
| 6173 |
ma_result (* onClose)(ma_vfs* pVFS, ma_vfs_file file); |
| 6174 |
ma_result (* onRead) (ma_vfs* pVFS, ma_vfs_file file, void* pDst, size_t sizeInBytes, size_t* pBytesRead); |
| 6175 |
ma_result (* onWrite)(ma_vfs* pVFS, ma_vfs_file file, const void* pSrc, size_t sizeInBytes, size_t* pBytesWritten); |
| 6176 |
ma_result (* onSeek) (ma_vfs* pVFS, ma_vfs_file file, ma_int64 offset, ma_seek_origin origin); |
| 6177 |
ma_result (* onTell) (ma_vfs* pVFS, ma_vfs_file file, ma_int64* pCursor); |
| 6178 |
ma_result (* onInfo) (ma_vfs* pVFS, ma_vfs_file file, ma_file_info* pInfo); |
| 6179 |
} ma_vfs_callbacks; |
| 6180 |
|
| 6181 |
MA_API ma_result ma_vfs_open(ma_vfs* pVFS, const char* pFilePath, ma_uint32 openMode, ma_vfs_file* pFile); |
| 6182 |
MA_API ma_result ma_vfs_open_w(ma_vfs* pVFS, const wchar_t* pFilePath, ma_uint32 openMode, ma_vfs_file* pFile); |
| 6183 |
MA_API ma_result ma_vfs_close(ma_vfs* pVFS, ma_vfs_file file); |
| 6184 |
MA_API ma_result ma_vfs_read(ma_vfs* pVFS, ma_vfs_file file, void* pDst, size_t sizeInBytes, size_t* pBytesRead); |
| 6185 |
MA_API ma_result ma_vfs_write(ma_vfs* pVFS, ma_vfs_file file, const void* pSrc, size_t sizeInBytes, size_t* pBytesWritten); |
| 6186 |
MA_API ma_result ma_vfs_seek(ma_vfs* pVFS, ma_vfs_file file, ma_int64 offset, ma_seek_origin origin); |
| 6187 |
MA_API ma_result ma_vfs_tell(ma_vfs* pVFS, ma_vfs_file file, ma_int64* pCursor); |
| 6188 |
MA_API ma_result ma_vfs_info(ma_vfs* pVFS, ma_vfs_file file, ma_file_info* pInfo); |
| 6189 |
MA_API ma_result ma_vfs_open_and_read_file(ma_vfs* pVFS, const char* pFilePath, void** ppData, size_t* pSize, const ma_allocation_callbacks* pAllocationCallbacks); |
| 6190 |
|
| 6191 |
typedef struct |
| 6192 |
{ |
| 6193 |
ma_vfs_callbacks cb; |
| 6194 |
ma_allocation_callbacks allocationCallbacks; |
| 6195 |
} ma_default_vfs; |
| 6196 |
|
| 6197 |
MA_API ma_result ma_default_vfs_init(ma_default_vfs* pVFS, const ma_allocation_callbacks* pAllocationCallbacks); |
| 6198 |
|
| 6199 |
|
| 6200 |
|
| 6201 |
typedef ma_result (* ma_read_proc)(void* pUserData, void* pBufferOut, size_t bytesToRead, size_t* pBytesRead); |
| 6202 |
typedef ma_result (* ma_seek_proc)(void* pUserData, ma_int64 offset, ma_seek_origin origin); |
| 6203 |
typedef ma_result (* ma_tell_proc)(void* pUserData, ma_int64* pCursor); |
| 6204 |
|
| 6205 |
|
| 6206 |
|
| 6207 |
#if !defined(MA_NO_DECODING) || !defined(MA_NO_ENCODING) |
| 6208 |
typedef enum |
| 6209 |
{ |
| 6210 |
ma_encoding_format_unknown = 0, |
| 6211 |
ma_encoding_format_wav, |
| 6212 |
ma_encoding_format_flac, |
| 6213 |
ma_encoding_format_mp3, |
| 6214 |
ma_encoding_format_vorbis |
| 6215 |
} ma_encoding_format; |
| 6216 |
#endif |
| 6217 |
|
| 6218 |
|
| 6219 |
|
| 6220 |
|
| 6221 |
|
| 6222 |
|
| 6223 |
|
| 6224 |
|
| 6225 |
|
| 6226 |
|
| 6227 |
#ifndef MA_NO_DECODING |
| 6228 |
typedef struct ma_decoder ma_decoder; |
| 6229 |
|
| 6230 |
|
| 6231 |
typedef struct |
| 6232 |
{ |
| 6233 |
ma_format preferredFormat; |
| 6234 |
ma_uint32 seekPointCount; |
| 6235 |
} ma_decoding_backend_config; |
| 6236 |
|
| 6237 |
MA_API ma_decoding_backend_config ma_decoding_backend_config_init(ma_format preferredFormat, ma_uint32 seekPointCount); |
| 6238 |
|
| 6239 |
|
| 6240 |
typedef struct |
| 6241 |
{ |
| 6242 |
ma_result (* onInit )(void* pUserData, ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_proc onTell, void* pReadSeekTellUserData, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend); |
| 6243 |
ma_result (* onInitFile )(void* pUserData, const char* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend); |
| 6244 |
ma_result (* onInitFileW )(void* pUserData, const wchar_t* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend); |
| 6245 |
ma_result (* onInitMemory)(void* pUserData, const void* pData, size_t dataSize, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source** ppBackend); |
| 6246 |
void (* onUninit )(void* pUserData, ma_data_source* pBackend, const ma_allocation_callbacks* pAllocationCallbacks); |
| 6247 |
} ma_decoding_backend_vtable; |
| 6248 |
|
| 6249 |
|
| 6250 |
typedef ma_result (* ma_decoder_read_proc)(ma_decoder* pDecoder, void* pBufferOut, size_t bytesToRead, size_t* pBytesRead); |
| 6251 |
typedef ma_result (* ma_decoder_seek_proc)(ma_decoder* pDecoder, ma_int64 byteOffset, ma_seek_origin origin); |
| 6252 |
typedef ma_result (* ma_decoder_tell_proc)(ma_decoder* pDecoder, ma_int64* pCursor); |
| 6253 |
|
| 6254 |
typedef struct |
| 6255 |
{ |
| 6256 |
ma_format format; |
| 6257 |
ma_uint32 channels; |
| 6258 |
ma_uint32 sampleRate; |
| 6259 |
ma_channel* pChannelMap; |
| 6260 |
ma_channel_mix_mode channelMixMode; |
| 6261 |
ma_dither_mode ditherMode; |
| 6262 |
ma_resampler_config resampling; |
| 6263 |
ma_allocation_callbacks allocationCallbacks; |
| 6264 |
ma_encoding_format encodingFormat; |
| 6265 |
ma_uint32 seekPointCount; |
| 6266 |
ma_decoding_backend_vtable** ppCustomBackendVTables; |
| 6267 |
ma_uint32 customBackendCount; |
| 6268 |
void* pCustomBackendUserData; |
| 6269 |
} ma_decoder_config; |
| 6270 |
|
| 6271 |
struct ma_decoder |
| 6272 |
{ |
| 6273 |
ma_data_source_base ds; |
| 6274 |
ma_data_source* pBackend; |
| 6275 |
const ma_decoding_backend_vtable* pBackendVTable; |
| 6276 |
void* pBackendUserData; |
| 6277 |
ma_decoder_read_proc onRead; |
| 6278 |
ma_decoder_seek_proc onSeek; |
| 6279 |
ma_decoder_tell_proc onTell; |
| 6280 |
void* pUserData; |
| 6281 |
ma_uint64 readPointerInPCMFrames; |
| 6282 |
ma_format outputFormat; |
| 6283 |
ma_uint32 outputChannels; |
| 6284 |
ma_uint32 outputSampleRate; |
| 6285 |
ma_data_converter converter; |
| 6286 |
void* pInputCache; |
| 6287 |
ma_uint64 inputCacheCap; |
| 6288 |
ma_uint64 inputCacheConsumed; |
| 6289 |
ma_uint64 inputCacheRemaining; |
| 6290 |
ma_allocation_callbacks allocationCallbacks; |
| 6291 |
union |
| 6292 |
{ |
| 6293 |
struct |
| 6294 |
{ |
| 6295 |
ma_vfs* pVFS; |
| 6296 |
ma_vfs_file file; |
| 6297 |
} vfs; |
| 6298 |
struct |
| 6299 |
{ |
| 6300 |
const ma_uint8* pData; |
| 6301 |
size_t dataSize; |
| 6302 |
size_t currentReadPos; |
| 6303 |
} memory; |
| 6304 |
} data; |
| 6305 |
}; |
| 6306 |
|
| 6307 |
MA_API ma_decoder_config ma_decoder_config_init(ma_format outputFormat, ma_uint32 outputChannels, ma_uint32 outputSampleRate); |
| 6308 |
MA_API ma_decoder_config ma_decoder_config_init_default(void); |
| 6309 |
|
| 6310 |
MA_API ma_result ma_decoder_init(ma_decoder_read_proc onRead, ma_decoder_seek_proc onSeek, void* pUserData, const ma_decoder_config* pConfig, ma_decoder* pDecoder); |
| 6311 |
MA_API ma_result ma_decoder_init_memory(const void* pData, size_t dataSize, const ma_decoder_config* pConfig, ma_decoder* pDecoder); |
| 6312 |
MA_API ma_result ma_decoder_init_vfs(ma_vfs* pVFS, const char* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder); |
| 6313 |
MA_API ma_result ma_decoder_init_vfs_w(ma_vfs* pVFS, const wchar_t* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder); |
| 6314 |
MA_API ma_result ma_decoder_init_file(const char* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder); |
| 6315 |
MA_API ma_result ma_decoder_init_file_w(const wchar_t* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder); |
| 6316 |
|
| 6317 |
|
| 6318 |
|
| 6319 |
|
| 6320 |
MA_API ma_result ma_decoder_uninit(ma_decoder* pDecoder); |
| 6321 |
|
| 6322 |
|
| 6323 |
|
| 6324 |
|
| 6325 |
|
| 6326 |
|
| 6327 |
MA_API ma_result ma_decoder_read_pcm_frames(ma_decoder* pDecoder, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 6328 |
|
| 6329 |
|
| 6330 |
|
| 6331 |
|
| 6332 |
|
| 6333 |
|
| 6334 |
MA_API ma_result ma_decoder_seek_to_pcm_frame(ma_decoder* pDecoder, ma_uint64 frameIndex); |
| 6335 |
|
| 6336 |
|
| 6337 |
|
| 6338 |
|
| 6339 |
MA_API ma_result ma_decoder_get_data_format(ma_decoder* pDecoder, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap); |
| 6340 |
|
| 6341 |
|
| 6342 |
|
| 6343 |
|
| 6344 |
MA_API ma_result ma_decoder_get_cursor_in_pcm_frames(ma_decoder* pDecoder, ma_uint64* pCursor); |
| 6345 |
|
| 6346 |
|
| 6347 |
|
| 6348 |
|
| 6349 |
|
| 6350 |
|
| 6351 |
|
| 6352 |
|
| 6353 |
|
| 6354 |
|
| 6355 |
|
| 6356 |
|
| 6357 |
|
| 6358 |
|
| 6359 |
|
| 6360 |
MA_API ma_result ma_decoder_get_length_in_pcm_frames(ma_decoder* pDecoder, ma_uint64* pLength); |
| 6361 |
|
| 6362 |
|
| 6363 |
|
| 6364 |
|
| 6365 |
|
| 6366 |
|
| 6367 |
|
| 6368 |
|
| 6369 |
|
| 6370 |
|
| 6371 |
MA_API ma_result ma_decoder_get_available_frames(ma_decoder* pDecoder, ma_uint64* pAvailableFrames); |
| 6372 |
|
| 6373 |
|
| 6374 |
|
| 6375 |
|
| 6376 |
|
| 6377 |
MA_API ma_result ma_decode_from_vfs(ma_vfs* pVFS, const char* pFilePath, ma_decoder_config* pConfig, ma_uint64* pFrameCountOut, void** ppPCMFramesOut); |
| 6378 |
MA_API ma_result ma_decode_file(const char* pFilePath, ma_decoder_config* pConfig, ma_uint64* pFrameCountOut, void** ppPCMFramesOut); |
| 6379 |
MA_API ma_result ma_decode_memory(const void* pData, size_t dataSize, ma_decoder_config* pConfig, ma_uint64* pFrameCountOut, void** ppPCMFramesOut); |
| 6380 |
|
| 6381 |
#endif |
| 6382 |
|
| 6383 |
|
| 6384 |
|
| 6385 |
|
| 6386 |
|
| 6387 |
|
| 6388 |
|
| 6389 |
|
| 6390 |
|
| 6391 |
|
| 6392 |
#ifndef MA_NO_ENCODING |
| 6393 |
typedef struct ma_encoder ma_encoder; |
| 6394 |
|
| 6395 |
typedef ma_result (* ma_encoder_write_proc) (ma_encoder* pEncoder, const void* pBufferIn, size_t bytesToWrite, size_t* pBytesWritten); |
| 6396 |
typedef ma_result (* ma_encoder_seek_proc) (ma_encoder* pEncoder, ma_int64 offset, ma_seek_origin origin); |
| 6397 |
typedef ma_result (* ma_encoder_init_proc) (ma_encoder* pEncoder); |
| 6398 |
typedef void (* ma_encoder_uninit_proc) (ma_encoder* pEncoder); |
| 6399 |
typedef ma_result (* ma_encoder_write_pcm_frames_proc)(ma_encoder* pEncoder, const void* pFramesIn, ma_uint64 frameCount, ma_uint64* pFramesWritten); |
| 6400 |
|
| 6401 |
typedef struct |
| 6402 |
{ |
| 6403 |
ma_encoding_format encodingFormat; |
| 6404 |
ma_format format; |
| 6405 |
ma_uint32 channels; |
| 6406 |
ma_uint32 sampleRate; |
| 6407 |
ma_allocation_callbacks allocationCallbacks; |
| 6408 |
} ma_encoder_config; |
| 6409 |
|
| 6410 |
MA_API ma_encoder_config ma_encoder_config_init(ma_encoding_format encodingFormat, ma_format format, ma_uint32 channels, ma_uint32 sampleRate); |
| 6411 |
|
| 6412 |
struct ma_encoder |
| 6413 |
{ |
| 6414 |
ma_encoder_config config; |
| 6415 |
ma_encoder_write_proc onWrite; |
| 6416 |
ma_encoder_seek_proc onSeek; |
| 6417 |
ma_encoder_init_proc onInit; |
| 6418 |
ma_encoder_uninit_proc onUninit; |
| 6419 |
ma_encoder_write_pcm_frames_proc onWritePCMFrames; |
| 6420 |
void* pUserData; |
| 6421 |
void* pInternalEncoder; |
| 6422 |
union |
| 6423 |
{ |
| 6424 |
struct |
| 6425 |
{ |
| 6426 |
ma_vfs* pVFS; |
| 6427 |
ma_vfs_file file; |
| 6428 |
} vfs; |
| 6429 |
} data; |
| 6430 |
}; |
| 6431 |
|
| 6432 |
MA_API ma_result ma_encoder_init(ma_encoder_write_proc onWrite, ma_encoder_seek_proc onSeek, void* pUserData, const ma_encoder_config* pConfig, ma_encoder* pEncoder); |
| 6433 |
MA_API ma_result ma_encoder_init_vfs(ma_vfs* pVFS, const char* pFilePath, const ma_encoder_config* pConfig, ma_encoder* pEncoder); |
| 6434 |
MA_API ma_result ma_encoder_init_vfs_w(ma_vfs* pVFS, const wchar_t* pFilePath, const ma_encoder_config* pConfig, ma_encoder* pEncoder); |
| 6435 |
MA_API ma_result ma_encoder_init_file(const char* pFilePath, const ma_encoder_config* pConfig, ma_encoder* pEncoder); |
| 6436 |
MA_API ma_result ma_encoder_init_file_w(const wchar_t* pFilePath, const ma_encoder_config* pConfig, ma_encoder* pEncoder); |
| 6437 |
MA_API void ma_encoder_uninit(ma_encoder* pEncoder); |
| 6438 |
MA_API ma_result ma_encoder_write_pcm_frames(ma_encoder* pEncoder, const void* pFramesIn, ma_uint64 frameCount, ma_uint64* pFramesWritten); |
| 6439 |
|
| 6440 |
#endif |
| 6441 |
|
| 6442 |
|
| 6443 |
|
| 6444 |
|
| 6445 |
|
| 6446 |
|
| 6447 |
|
| 6448 |
#ifndef MA_NO_GENERATION |
| 6449 |
typedef enum |
| 6450 |
{ |
| 6451 |
ma_waveform_type_sine, |
| 6452 |
ma_waveform_type_square, |
| 6453 |
ma_waveform_type_triangle, |
| 6454 |
ma_waveform_type_sawtooth |
| 6455 |
} ma_waveform_type; |
| 6456 |
|
| 6457 |
typedef struct |
| 6458 |
{ |
| 6459 |
ma_format format; |
| 6460 |
ma_uint32 channels; |
| 6461 |
ma_uint32 sampleRate; |
| 6462 |
ma_waveform_type type; |
| 6463 |
double amplitude; |
| 6464 |
double frequency; |
| 6465 |
} ma_waveform_config; |
| 6466 |
|
| 6467 |
MA_API ma_waveform_config ma_waveform_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_waveform_type type, double amplitude, double frequency); |
| 6468 |
|
| 6469 |
typedef struct |
| 6470 |
{ |
| 6471 |
ma_data_source_base ds; |
| 6472 |
ma_waveform_config config; |
| 6473 |
double advance; |
| 6474 |
double time; |
| 6475 |
} ma_waveform; |
| 6476 |
|
| 6477 |
MA_API ma_result ma_waveform_init(const ma_waveform_config* pConfig, ma_waveform* pWaveform); |
| 6478 |
MA_API void ma_waveform_uninit(ma_waveform* pWaveform); |
| 6479 |
MA_API ma_result ma_waveform_read_pcm_frames(ma_waveform* pWaveform, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 6480 |
MA_API ma_result ma_waveform_seek_to_pcm_frame(ma_waveform* pWaveform, ma_uint64 frameIndex); |
| 6481 |
MA_API ma_result ma_waveform_set_amplitude(ma_waveform* pWaveform, double amplitude); |
| 6482 |
MA_API ma_result ma_waveform_set_frequency(ma_waveform* pWaveform, double frequency); |
| 6483 |
MA_API ma_result ma_waveform_set_type(ma_waveform* pWaveform, ma_waveform_type type); |
| 6484 |
MA_API ma_result ma_waveform_set_sample_rate(ma_waveform* pWaveform, ma_uint32 sampleRate); |
| 6485 |
|
| 6486 |
typedef struct |
| 6487 |
{ |
| 6488 |
ma_format format; |
| 6489 |
ma_uint32 channels; |
| 6490 |
ma_uint32 sampleRate; |
| 6491 |
double dutyCycle; |
| 6492 |
double amplitude; |
| 6493 |
double frequency; |
| 6494 |
} ma_pulsewave_config; |
| 6495 |
|
| 6496 |
MA_API ma_pulsewave_config ma_pulsewave_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double dutyCycle, double amplitude, double frequency); |
| 6497 |
|
| 6498 |
typedef struct |
| 6499 |
{ |
| 6500 |
ma_waveform waveform; |
| 6501 |
ma_pulsewave_config config; |
| 6502 |
} ma_pulsewave; |
| 6503 |
|
| 6504 |
MA_API ma_result ma_pulsewave_init(const ma_pulsewave_config* pConfig, ma_pulsewave* pWaveform); |
| 6505 |
MA_API void ma_pulsewave_uninit(ma_pulsewave* pWaveform); |
| 6506 |
MA_API ma_result ma_pulsewave_read_pcm_frames(ma_pulsewave* pWaveform, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 6507 |
MA_API ma_result ma_pulsewave_seek_to_pcm_frame(ma_pulsewave* pWaveform, ma_uint64 frameIndex); |
| 6508 |
MA_API ma_result ma_pulsewave_set_amplitude(ma_pulsewave* pWaveform, double amplitude); |
| 6509 |
MA_API ma_result ma_pulsewave_set_frequency(ma_pulsewave* pWaveform, double frequency); |
| 6510 |
MA_API ma_result ma_pulsewave_set_sample_rate(ma_pulsewave* pWaveform, ma_uint32 sampleRate); |
| 6511 |
MA_API ma_result ma_pulsewave_set_duty_cycle(ma_pulsewave* pWaveform, double dutyCycle); |
| 6512 |
|
| 6513 |
typedef enum |
| 6514 |
{ |
| 6515 |
ma_noise_type_white, |
| 6516 |
ma_noise_type_pink, |
| 6517 |
ma_noise_type_brownian |
| 6518 |
} ma_noise_type; |
| 6519 |
|
| 6520 |
|
| 6521 |
typedef struct |
| 6522 |
{ |
| 6523 |
ma_format format; |
| 6524 |
ma_uint32 channels; |
| 6525 |
ma_noise_type type; |
| 6526 |
ma_int32 seed; |
| 6527 |
double amplitude; |
| 6528 |
ma_bool32 duplicateChannels; |
| 6529 |
} ma_noise_config; |
| 6530 |
|
| 6531 |
MA_API ma_noise_config ma_noise_config_init(ma_format format, ma_uint32 channels, ma_noise_type type, ma_int32 seed, double amplitude); |
| 6532 |
|
| 6533 |
typedef struct |
| 6534 |
{ |
| 6535 |
ma_data_source_base ds; |
| 6536 |
ma_noise_config config; |
| 6537 |
ma_lcg lcg; |
| 6538 |
union |
| 6539 |
{ |
| 6540 |
struct |
| 6541 |
{ |
| 6542 |
double** bin; |
| 6543 |
double* accumulation; |
| 6544 |
ma_uint32* counter; |
| 6545 |
} pink; |
| 6546 |
struct |
| 6547 |
{ |
| 6548 |
double* accumulation; |
| 6549 |
} brownian; |
| 6550 |
} state; |
| 6551 |
|
| 6552 |
|
| 6553 |
void* _pHeap; |
| 6554 |
ma_bool32 _ownsHeap; |
| 6555 |
} ma_noise; |
| 6556 |
|
| 6557 |
MA_API ma_result ma_noise_get_heap_size(const ma_noise_config* pConfig, size_t* pHeapSizeInBytes); |
| 6558 |
MA_API ma_result ma_noise_init_preallocated(const ma_noise_config* pConfig, void* pHeap, ma_noise* pNoise); |
| 6559 |
MA_API ma_result ma_noise_init(const ma_noise_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_noise* pNoise); |
| 6560 |
MA_API void ma_noise_uninit(ma_noise* pNoise, const ma_allocation_callbacks* pAllocationCallbacks); |
| 6561 |
MA_API ma_result ma_noise_read_pcm_frames(ma_noise* pNoise, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 6562 |
MA_API ma_result ma_noise_set_amplitude(ma_noise* pNoise, double amplitude); |
| 6563 |
MA_API ma_result ma_noise_set_seed(ma_noise* pNoise, ma_int32 seed); |
| 6564 |
MA_API ma_result ma_noise_set_type(ma_noise* pNoise, ma_noise_type type); |
| 6565 |
|
| 6566 |
#endif |
| 6567 |
|
| 6568 |
|
| 6569 |
|
| 6570 |
|
| 6571 |
|
| 6572 |
|
| 6573 |
|
| 6574 |
|
| 6575 |
|
| 6576 |
#if !defined(MA_NO_RESOURCE_MANAGER) && defined(MA_NO_DECODING) |
| 6577 |
#define MA_NO_RESOURCE_MANAGER |
| 6578 |
#endif |
| 6579 |
|
| 6580 |
#ifndef MA_NO_RESOURCE_MANAGER |
| 6581 |
typedef struct ma_resource_manager ma_resource_manager; |
| 6582 |
typedef struct ma_resource_manager_data_buffer_node ma_resource_manager_data_buffer_node; |
| 6583 |
typedef struct ma_resource_manager_data_buffer ma_resource_manager_data_buffer; |
| 6584 |
typedef struct ma_resource_manager_data_stream ma_resource_manager_data_stream; |
| 6585 |
typedef struct ma_resource_manager_data_source ma_resource_manager_data_source; |
| 6586 |
|
| 6587 |
typedef enum |
| 6588 |
{ |
| 6589 |
MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_STREAM = 0x00000001, |
| 6590 |
MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_DECODE = 0x00000002, |
| 6591 |
MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_ASYNC = 0x00000004, |
| 6592 |
MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_WAIT_INIT = 0x00000008, |
| 6593 |
MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_UNKNOWN_LENGTH = 0x00000010, |
| 6594 |
MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_LOOPING = 0x00000020 |
| 6595 |
} ma_resource_manager_data_source_flags; |
| 6596 |
|
| 6597 |
|
| 6598 |
|
| 6599 |
|
| 6600 |
|
| 6601 |
typedef struct |
| 6602 |
{ |
| 6603 |
ma_async_notification* pNotification; |
| 6604 |
ma_fence* pFence; |
| 6605 |
} ma_resource_manager_pipeline_stage_notification; |
| 6606 |
|
| 6607 |
typedef struct |
| 6608 |
{ |
| 6609 |
ma_resource_manager_pipeline_stage_notification init; |
| 6610 |
ma_resource_manager_pipeline_stage_notification done; |
| 6611 |
} ma_resource_manager_pipeline_notifications; |
| 6612 |
|
| 6613 |
MA_API ma_resource_manager_pipeline_notifications ma_resource_manager_pipeline_notifications_init(void); |
| 6614 |
|
| 6615 |
|
| 6616 |
|
| 6617 |
|
| 6618 |
|
| 6619 |
#if 1 |
| 6620 |
#define ma_resource_manager_job ma_job |
| 6621 |
#define ma_resource_manager_job_init ma_job_init |
| 6622 |
#define MA_JOB_TYPE_RESOURCE_MANAGER_QUEUE_FLAG_NON_BLOCKING MA_JOB_QUEUE_FLAG_NON_BLOCKING |
| 6623 |
#define ma_resource_manager_job_queue_config ma_job_queue_config |
| 6624 |
#define ma_resource_manager_job_queue_config_init ma_job_queue_config_init |
| 6625 |
#define ma_resource_manager_job_queue ma_job_queue |
| 6626 |
#define ma_resource_manager_job_queue_get_heap_size ma_job_queue_get_heap_size |
| 6627 |
#define ma_resource_manager_job_queue_init_preallocated ma_job_queue_init_preallocated |
| 6628 |
#define ma_resource_manager_job_queue_init ma_job_queue_init |
| 6629 |
#define ma_resource_manager_job_queue_uninit ma_job_queue_uninit |
| 6630 |
#define ma_resource_manager_job_queue_post ma_job_queue_post |
| 6631 |
#define ma_resource_manager_job_queue_next ma_job_queue_next |
| 6632 |
#endif |
| 6633 |
|
| 6634 |
|
| 6635 |
|
| 6636 |
|
| 6637 |
|
| 6638 |
|
| 6639 |
#ifndef MA_RESOURCE_MANAGER_MAX_JOB_THREAD_COUNT |
| 6640 |
#define MA_RESOURCE_MANAGER_MAX_JOB_THREAD_COUNT 64 |
| 6641 |
#endif |
| 6642 |
|
| 6643 |
typedef enum |
| 6644 |
{ |
| 6645 |
|
| 6646 |
MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING = 0x00000001, |
| 6647 |
|
| 6648 |
|
| 6649 |
MA_RESOURCE_MANAGER_FLAG_NO_THREADING = 0x00000002 |
| 6650 |
} ma_resource_manager_flags; |
| 6651 |
|
| 6652 |
typedef struct |
| 6653 |
{ |
| 6654 |
const char* pFilePath; |
| 6655 |
const wchar_t* pFilePathW; |
| 6656 |
const ma_resource_manager_pipeline_notifications* pNotifications; |
| 6657 |
ma_uint64 initialSeekPointInPCMFrames; |
| 6658 |
ma_uint64 rangeBegInPCMFrames; |
| 6659 |
ma_uint64 rangeEndInPCMFrames; |
| 6660 |
ma_uint64 loopPointBegInPCMFrames; |
| 6661 |
ma_uint64 loopPointEndInPCMFrames; |
| 6662 |
ma_uint32 flags; |
| 6663 |
ma_bool32 isLooping; |
| 6664 |
} ma_resource_manager_data_source_config; |
| 6665 |
|
| 6666 |
MA_API ma_resource_manager_data_source_config ma_resource_manager_data_source_config_init(void); |
| 6667 |
|
| 6668 |
|
| 6669 |
typedef enum |
| 6670 |
{ |
| 6671 |
ma_resource_manager_data_supply_type_unknown = 0, |
| 6672 |
ma_resource_manager_data_supply_type_encoded, |
| 6673 |
ma_resource_manager_data_supply_type_decoded, |
| 6674 |
ma_resource_manager_data_supply_type_decoded_paged |
| 6675 |
} ma_resource_manager_data_supply_type; |
| 6676 |
|
| 6677 |
typedef struct |
| 6678 |
{ |
| 6679 |
MA_ATOMIC(4, ma_resource_manager_data_supply_type) type; |
| 6680 |
union |
| 6681 |
{ |
| 6682 |
struct |
| 6683 |
{ |
| 6684 |
const void* pData; |
| 6685 |
size_t sizeInBytes; |
| 6686 |
} encoded; |
| 6687 |
struct |
| 6688 |
{ |
| 6689 |
const void* pData; |
| 6690 |
ma_uint64 totalFrameCount; |
| 6691 |
ma_uint64 decodedFrameCount; |
| 6692 |
ma_format format; |
| 6693 |
ma_uint32 channels; |
| 6694 |
ma_uint32 sampleRate; |
| 6695 |
} decoded; |
| 6696 |
struct |
| 6697 |
{ |
| 6698 |
ma_paged_audio_buffer_data data; |
| 6699 |
ma_uint64 decodedFrameCount; |
| 6700 |
ma_uint32 sampleRate; |
| 6701 |
} decodedPaged; |
| 6702 |
} backend; |
| 6703 |
} ma_resource_manager_data_supply; |
| 6704 |
|
| 6705 |
struct ma_resource_manager_data_buffer_node |
| 6706 |
{ |
| 6707 |
ma_uint32 hashedName32; |
| 6708 |
ma_uint32 refCount; |
| 6709 |
MA_ATOMIC(4, ma_result) result; |
| 6710 |
MA_ATOMIC(4, ma_uint32) executionCounter; |
| 6711 |
MA_ATOMIC(4, ma_uint32) executionPointer; |
| 6712 |
ma_bool32 isDataOwnedByResourceManager; |
| 6713 |
ma_resource_manager_data_supply data; |
| 6714 |
ma_resource_manager_data_buffer_node* pParent; |
| 6715 |
ma_resource_manager_data_buffer_node* pChildLo; |
| 6716 |
ma_resource_manager_data_buffer_node* pChildHi; |
| 6717 |
}; |
| 6718 |
|
| 6719 |
struct ma_resource_manager_data_buffer |
| 6720 |
{ |
| 6721 |
ma_data_source_base ds; |
| 6722 |
ma_resource_manager* pResourceManager; |
| 6723 |
ma_resource_manager_data_buffer_node* pNode; |
| 6724 |
ma_uint32 flags; |
| 6725 |
MA_ATOMIC(4, ma_uint32) executionCounter; |
| 6726 |
MA_ATOMIC(4, ma_uint32) executionPointer; |
| 6727 |
ma_uint64 seekTargetInPCMFrames; |
| 6728 |
ma_bool32 seekToCursorOnNextRead; |
| 6729 |
MA_ATOMIC(4, ma_result) result; |
| 6730 |
MA_ATOMIC(4, ma_bool32) isLooping; |
| 6731 |
ma_atomic_bool32 isConnectorInitialized; |
| 6732 |
union |
| 6733 |
{ |
| 6734 |
ma_decoder decoder; |
| 6735 |
ma_audio_buffer buffer; |
| 6736 |
ma_paged_audio_buffer pagedBuffer; |
| 6737 |
} connector; |
| 6738 |
}; |
| 6739 |
|
| 6740 |
struct ma_resource_manager_data_stream |
| 6741 |
{ |
| 6742 |
ma_data_source_base ds; |
| 6743 |
ma_resource_manager* pResourceManager; |
| 6744 |
ma_uint32 flags; |
| 6745 |
ma_decoder decoder; |
| 6746 |
ma_bool32 isDecoderInitialized; |
| 6747 |
ma_uint64 totalLengthInPCMFrames; |
| 6748 |
ma_uint32 relativeCursor; |
| 6749 |
MA_ATOMIC(8, ma_uint64) absoluteCursor; |
| 6750 |
ma_uint32 currentPageIndex; |
| 6751 |
MA_ATOMIC(4, ma_uint32) executionCounter; |
| 6752 |
MA_ATOMIC(4, ma_uint32) executionPointer; |
| 6753 |
|
| 6754 |
|
| 6755 |
MA_ATOMIC(4, ma_bool32) isLooping; |
| 6756 |
|
| 6757 |
|
| 6758 |
void* pPageData; |
| 6759 |
MA_ATOMIC(4, ma_uint32) pageFrameCount[2]; |
| 6760 |
|
| 6761 |
|
| 6762 |
MA_ATOMIC(4, ma_result) result; |
| 6763 |
MA_ATOMIC(4, ma_bool32) isDecoderAtEnd; |
| 6764 |
MA_ATOMIC(4, ma_bool32) isPageValid[2]; |
| 6765 |
MA_ATOMIC(4, ma_bool32) seekCounter; |
| 6766 |
}; |
| 6767 |
|
| 6768 |
struct ma_resource_manager_data_source |
| 6769 |
{ |
| 6770 |
union |
| 6771 |
{ |
| 6772 |
ma_resource_manager_data_buffer buffer; |
| 6773 |
ma_resource_manager_data_stream stream; |
| 6774 |
} backend; |
| 6775 |
|
| 6776 |
ma_uint32 flags; |
| 6777 |
MA_ATOMIC(4, ma_uint32) executionCounter; |
| 6778 |
MA_ATOMIC(4, ma_uint32) executionPointer; |
| 6779 |
}; |
| 6780 |
|
| 6781 |
typedef struct |
| 6782 |
{ |
| 6783 |
ma_allocation_callbacks allocationCallbacks; |
| 6784 |
ma_log* pLog; |
| 6785 |
ma_format decodedFormat; |
| 6786 |
ma_uint32 decodedChannels; |
| 6787 |
ma_uint32 decodedSampleRate; |
| 6788 |
ma_uint32 jobThreadCount; |
| 6789 |
size_t jobThreadStackSize; |
| 6790 |
ma_uint32 jobQueueCapacity; |
| 6791 |
ma_uint32 flags; |
| 6792 |
ma_vfs* pVFS; |
| 6793 |
ma_decoding_backend_vtable** ppCustomDecodingBackendVTables; |
| 6794 |
ma_uint32 customDecodingBackendCount; |
| 6795 |
void* pCustomDecodingBackendUserData; |
| 6796 |
ma_resampler_config resampling; |
| 6797 |
} ma_resource_manager_config; |
| 6798 |
|
| 6799 |
MA_API ma_resource_manager_config ma_resource_manager_config_init(void); |
| 6800 |
|
| 6801 |
struct ma_resource_manager |
| 6802 |
{ |
| 6803 |
ma_resource_manager_config config; |
| 6804 |
ma_resource_manager_data_buffer_node* pRootDataBufferNode; |
| 6805 |
#ifndef MA_NO_THREADING |
| 6806 |
ma_mutex dataBufferBSTLock; |
| 6807 |
ma_thread jobThreads[MA_RESOURCE_MANAGER_MAX_JOB_THREAD_COUNT]; |
| 6808 |
#endif |
| 6809 |
ma_job_queue jobQueue; |
| 6810 |
ma_default_vfs defaultVFS; |
| 6811 |
ma_log log; |
| 6812 |
}; |
| 6813 |
|
| 6814 |
|
| 6815 |
MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pConfig, ma_resource_manager* pResourceManager); |
| 6816 |
MA_API void ma_resource_manager_uninit(ma_resource_manager* pResourceManager); |
| 6817 |
MA_API ma_log* ma_resource_manager_get_log(ma_resource_manager* pResourceManager); |
| 6818 |
|
| 6819 |
|
| 6820 |
MA_API ma_result ma_resource_manager_register_file(ma_resource_manager* pResourceManager, const char* pFilePath, ma_uint32 flags); |
| 6821 |
MA_API ma_result ma_resource_manager_register_file_w(ma_resource_manager* pResourceManager, const wchar_t* pFilePath, ma_uint32 flags); |
| 6822 |
MA_API ma_result ma_resource_manager_register_decoded_data(ma_resource_manager* pResourceManager, const char* pName, const void* pData, ma_uint64 frameCount, ma_format format, ma_uint32 channels, ma_uint32 sampleRate); |
| 6823 |
MA_API ma_result ma_resource_manager_register_decoded_data_w(ma_resource_manager* pResourceManager, const wchar_t* pName, const void* pData, ma_uint64 frameCount, ma_format format, ma_uint32 channels, ma_uint32 sampleRate); |
| 6824 |
MA_API ma_result ma_resource_manager_register_encoded_data(ma_resource_manager* pResourceManager, const char* pName, const void* pData, size_t sizeInBytes); |
| 6825 |
MA_API ma_result ma_resource_manager_register_encoded_data_w(ma_resource_manager* pResourceManager, const wchar_t* pName, const void* pData, size_t sizeInBytes); |
| 6826 |
MA_API ma_result ma_resource_manager_unregister_file(ma_resource_manager* pResourceManager, const char* pFilePath); |
| 6827 |
MA_API ma_result ma_resource_manager_unregister_file_w(ma_resource_manager* pResourceManager, const wchar_t* pFilePath); |
| 6828 |
MA_API ma_result ma_resource_manager_unregister_data(ma_resource_manager* pResourceManager, const char* pName); |
| 6829 |
MA_API ma_result ma_resource_manager_unregister_data_w(ma_resource_manager* pResourceManager, const wchar_t* pName); |
| 6830 |
|
| 6831 |
|
| 6832 |
MA_API ma_result ma_resource_manager_data_buffer_init_ex(ma_resource_manager* pResourceManager, const ma_resource_manager_data_source_config* pConfig, ma_resource_manager_data_buffer* pDataBuffer); |
| 6833 |
MA_API ma_result ma_resource_manager_data_buffer_init(ma_resource_manager* pResourceManager, const char* pFilePath, ma_uint32 flags, const ma_resource_manager_pipeline_notifications* pNotifications, ma_resource_manager_data_buffer* pDataBuffer); |
| 6834 |
MA_API ma_result ma_resource_manager_data_buffer_init_w(ma_resource_manager* pResourceManager, const wchar_t* pFilePath, ma_uint32 flags, const ma_resource_manager_pipeline_notifications* pNotifications, ma_resource_manager_data_buffer* pDataBuffer); |
| 6835 |
MA_API ma_result ma_resource_manager_data_buffer_init_copy(ma_resource_manager* pResourceManager, const ma_resource_manager_data_buffer* pExistingDataBuffer, ma_resource_manager_data_buffer* pDataBuffer); |
| 6836 |
MA_API ma_result ma_resource_manager_data_buffer_uninit(ma_resource_manager_data_buffer* pDataBuffer); |
| 6837 |
MA_API ma_result ma_resource_manager_data_buffer_read_pcm_frames(ma_resource_manager_data_buffer* pDataBuffer, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 6838 |
MA_API ma_result ma_resource_manager_data_buffer_seek_to_pcm_frame(ma_resource_manager_data_buffer* pDataBuffer, ma_uint64 frameIndex); |
| 6839 |
MA_API ma_result ma_resource_manager_data_buffer_get_data_format(ma_resource_manager_data_buffer* pDataBuffer, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap); |
| 6840 |
MA_API ma_result ma_resource_manager_data_buffer_get_cursor_in_pcm_frames(ma_resource_manager_data_buffer* pDataBuffer, ma_uint64* pCursor); |
| 6841 |
MA_API ma_result ma_resource_manager_data_buffer_get_length_in_pcm_frames(ma_resource_manager_data_buffer* pDataBuffer, ma_uint64* pLength); |
| 6842 |
MA_API ma_result ma_resource_manager_data_buffer_result(const ma_resource_manager_data_buffer* pDataBuffer); |
| 6843 |
MA_API ma_result ma_resource_manager_data_buffer_set_looping(ma_resource_manager_data_buffer* pDataBuffer, ma_bool32 isLooping); |
| 6844 |
MA_API ma_bool32 ma_resource_manager_data_buffer_is_looping(const ma_resource_manager_data_buffer* pDataBuffer); |
| 6845 |
MA_API ma_result ma_resource_manager_data_buffer_get_available_frames(ma_resource_manager_data_buffer* pDataBuffer, ma_uint64* pAvailableFrames); |
| 6846 |
|
| 6847 |
|
| 6848 |
MA_API ma_result ma_resource_manager_data_stream_init_ex(ma_resource_manager* pResourceManager, const ma_resource_manager_data_source_config* pConfig, ma_resource_manager_data_stream* pDataStream); |
| 6849 |
MA_API ma_result ma_resource_manager_data_stream_init(ma_resource_manager* pResourceManager, const char* pFilePath, ma_uint32 flags, const ma_resource_manager_pipeline_notifications* pNotifications, ma_resource_manager_data_stream* pDataStream); |
| 6850 |
MA_API ma_result ma_resource_manager_data_stream_init_w(ma_resource_manager* pResourceManager, const wchar_t* pFilePath, ma_uint32 flags, const ma_resource_manager_pipeline_notifications* pNotifications, ma_resource_manager_data_stream* pDataStream); |
| 6851 |
MA_API ma_result ma_resource_manager_data_stream_uninit(ma_resource_manager_data_stream* pDataStream); |
| 6852 |
MA_API ma_result ma_resource_manager_data_stream_read_pcm_frames(ma_resource_manager_data_stream* pDataStream, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 6853 |
MA_API ma_result ma_resource_manager_data_stream_seek_to_pcm_frame(ma_resource_manager_data_stream* pDataStream, ma_uint64 frameIndex); |
| 6854 |
MA_API ma_result ma_resource_manager_data_stream_get_data_format(ma_resource_manager_data_stream* pDataStream, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap); |
| 6855 |
MA_API ma_result ma_resource_manager_data_stream_get_cursor_in_pcm_frames(ma_resource_manager_data_stream* pDataStream, ma_uint64* pCursor); |
| 6856 |
MA_API ma_result ma_resource_manager_data_stream_get_length_in_pcm_frames(ma_resource_manager_data_stream* pDataStream, ma_uint64* pLength); |
| 6857 |
MA_API ma_result ma_resource_manager_data_stream_result(const ma_resource_manager_data_stream* pDataStream); |
| 6858 |
MA_API ma_result ma_resource_manager_data_stream_set_looping(ma_resource_manager_data_stream* pDataStream, ma_bool32 isLooping); |
| 6859 |
MA_API ma_bool32 ma_resource_manager_data_stream_is_looping(const ma_resource_manager_data_stream* pDataStream); |
| 6860 |
MA_API ma_result ma_resource_manager_data_stream_get_available_frames(ma_resource_manager_data_stream* pDataStream, ma_uint64* pAvailableFrames); |
| 6861 |
|
| 6862 |
|
| 6863 |
MA_API ma_result ma_resource_manager_data_source_init_ex(ma_resource_manager* pResourceManager, const ma_resource_manager_data_source_config* pConfig, ma_resource_manager_data_source* pDataSource); |
| 6864 |
MA_API ma_result ma_resource_manager_data_source_init(ma_resource_manager* pResourceManager, const char* pName, ma_uint32 flags, const ma_resource_manager_pipeline_notifications* pNotifications, ma_resource_manager_data_source* pDataSource); |
| 6865 |
MA_API ma_result ma_resource_manager_data_source_init_w(ma_resource_manager* pResourceManager, const wchar_t* pName, ma_uint32 flags, const ma_resource_manager_pipeline_notifications* pNotifications, ma_resource_manager_data_source* pDataSource); |
| 6866 |
MA_API ma_result ma_resource_manager_data_source_init_copy(ma_resource_manager* pResourceManager, const ma_resource_manager_data_source* pExistingDataSource, ma_resource_manager_data_source* pDataSource); |
| 6867 |
MA_API ma_result ma_resource_manager_data_source_uninit(ma_resource_manager_data_source* pDataSource); |
| 6868 |
MA_API ma_result ma_resource_manager_data_source_read_pcm_frames(ma_resource_manager_data_source* pDataSource, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 6869 |
MA_API ma_result ma_resource_manager_data_source_seek_to_pcm_frame(ma_resource_manager_data_source* pDataSource, ma_uint64 frameIndex); |
| 6870 |
MA_API ma_result ma_resource_manager_data_source_get_data_format(ma_resource_manager_data_source* pDataSource, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap); |
| 6871 |
MA_API ma_result ma_resource_manager_data_source_get_cursor_in_pcm_frames(ma_resource_manager_data_source* pDataSource, ma_uint64* pCursor); |
| 6872 |
MA_API ma_result ma_resource_manager_data_source_get_length_in_pcm_frames(ma_resource_manager_data_source* pDataSource, ma_uint64* pLength); |
| 6873 |
MA_API ma_result ma_resource_manager_data_source_result(const ma_resource_manager_data_source* pDataSource); |
| 6874 |
MA_API ma_result ma_resource_manager_data_source_set_looping(ma_resource_manager_data_source* pDataSource, ma_bool32 isLooping); |
| 6875 |
MA_API ma_bool32 ma_resource_manager_data_source_is_looping(const ma_resource_manager_data_source* pDataSource); |
| 6876 |
MA_API ma_result ma_resource_manager_data_source_get_available_frames(ma_resource_manager_data_source* pDataSource, ma_uint64* pAvailableFrames); |
| 6877 |
|
| 6878 |
|
| 6879 |
MA_API ma_result ma_resource_manager_post_job(ma_resource_manager* pResourceManager, const ma_job* pJob); |
| 6880 |
MA_API ma_result ma_resource_manager_post_job_quit(ma_resource_manager* pResourceManager); |
| 6881 |
MA_API ma_result ma_resource_manager_next_job(ma_resource_manager* pResourceManager, ma_job* pJob); |
| 6882 |
MA_API ma_result ma_resource_manager_process_job(ma_resource_manager* pResourceManager, ma_job* pJob); |
| 6883 |
MA_API ma_result ma_resource_manager_process_next_job(ma_resource_manager* pResourceManager); |
| 6884 |
#endif |
| 6885 |
|
| 6886 |
|
| 6887 |
|
| 6888 |
|
| 6889 |
|
| 6890 |
|
| 6891 |
|
| 6892 |
|
| 6893 |
#ifndef MA_NO_NODE_GRAPH |
| 6894 |
|
| 6895 |
#ifndef MA_MAX_NODE_BUS_COUNT |
| 6896 |
#define MA_MAX_NODE_BUS_COUNT 254 |
| 6897 |
#endif |
| 6898 |
|
| 6899 |
|
| 6900 |
#ifndef MA_MAX_NODE_LOCAL_BUS_COUNT |
| 6901 |
#define MA_MAX_NODE_LOCAL_BUS_COUNT 2 |
| 6902 |
#endif |
| 6903 |
|
| 6904 |
|
| 6905 |
#define MA_NODE_BUS_COUNT_UNKNOWN 255 |
| 6906 |
|
| 6907 |
|
| 6908 |
|
| 6909 |
typedef struct |
| 6910 |
{ |
| 6911 |
size_t offset; |
| 6912 |
size_t sizeInBytes; |
| 6913 |
unsigned char _data[1]; |
| 6914 |
} ma_stack; |
| 6915 |
|
| 6916 |
|
| 6917 |
typedef struct ma_node_graph ma_node_graph; |
| 6918 |
typedef void ma_node; |
| 6919 |
|
| 6920 |
|
| 6921 |
|
| 6922 |
typedef enum |
| 6923 |
{ |
| 6924 |
MA_NODE_FLAG_PASSTHROUGH = 0x00000001, |
| 6925 |
MA_NODE_FLAG_CONTINUOUS_PROCESSING = 0x00000002, |
| 6926 |
MA_NODE_FLAG_ALLOW_NULL_INPUT = 0x00000004, |
| 6927 |
MA_NODE_FLAG_DIFFERENT_PROCESSING_RATES = 0x00000008, |
| 6928 |
MA_NODE_FLAG_SILENT_OUTPUT = 0x00000010 |
| 6929 |
} ma_node_flags; |
| 6930 |
|
| 6931 |
|
| 6932 |
|
| 6933 |
typedef enum |
| 6934 |
{ |
| 6935 |
ma_node_state_started = 0, |
| 6936 |
ma_node_state_stopped = 1 |
| 6937 |
} ma_node_state; |
| 6938 |
|
| 6939 |
|
| 6940 |
typedef struct |
| 6941 |
{ |
| 6942 |
|
| 6943 |
|
| 6944 |
|
| 6945 |
|
| 6946 |
|
| 6947 |
|
| 6948 |
|
| 6949 |
|
| 6950 |
|
| 6951 |
|
| 6952 |
|
| 6953 |
void (* onProcess)(ma_node* pNode, const float** ppFramesIn, ma_uint32* pFrameCountIn, float** ppFramesOut, ma_uint32* pFrameCountOut); |
| 6954 |
|
| 6955 |
|
| 6956 |
|
| 6957 |
|
| 6958 |
|
| 6959 |
|
| 6960 |
|
| 6961 |
|
| 6962 |
ma_result (* onGetRequiredInputFrameCount)(ma_node* pNode, ma_uint32 outputFrameCount, ma_uint32* pInputFrameCount); |
| 6963 |
|
| 6964 |
|
| 6965 |
|
| 6966 |
|
| 6967 |
|
| 6968 |
ma_uint8 inputBusCount; |
| 6969 |
|
| 6970 |
|
| 6971 |
|
| 6972 |
|
| 6973 |
|
| 6974 |
ma_uint8 outputBusCount; |
| 6975 |
|
| 6976 |
|
| 6977 |
|
| 6978 |
|
| 6979 |
|
| 6980 |
ma_uint32 flags; |
| 6981 |
} ma_node_vtable; |
| 6982 |
|
| 6983 |
typedef struct |
| 6984 |
{ |
| 6985 |
const ma_node_vtable* vtable; |
| 6986 |
ma_node_state initialState; |
| 6987 |
ma_uint32 inputBusCount; |
| 6988 |
ma_uint32 outputBusCount; |
| 6989 |
const ma_uint32* pInputChannels; |
| 6990 |
const ma_uint32* pOutputChannels; |
| 6991 |
} ma_node_config; |
| 6992 |
|
| 6993 |
MA_API ma_node_config ma_node_config_init(void); |
| 6994 |
|
| 6995 |
|
| 6996 |
|
| 6997 |
|
| 6998 |
|
| 6999 |
|
| 7000 |
typedef struct ma_node_output_bus ma_node_output_bus; |
| 7001 |
struct ma_node_output_bus |
| 7002 |
{ |
| 7003 |
|
| 7004 |
ma_node* pNode; |
| 7005 |
ma_uint8 outputBusIndex; |
| 7006 |
ma_uint8 channels; |
| 7007 |
|
| 7008 |
|
| 7009 |
ma_uint8 inputNodeInputBusIndex; |
| 7010 |
MA_ATOMIC(4, ma_uint32) flags; |
| 7011 |
MA_ATOMIC(4, ma_uint32) refCount; |
| 7012 |
MA_ATOMIC(4, ma_bool32) isAttached; |
| 7013 |
MA_ATOMIC(4, ma_spinlock) lock; |
| 7014 |
MA_ATOMIC(4, float) volume; |
| 7015 |
MA_ATOMIC(MA_SIZEOF_PTR, ma_node_output_bus*) pNext; |
| 7016 |
MA_ATOMIC(MA_SIZEOF_PTR, ma_node_output_bus*) pPrev; |
| 7017 |
MA_ATOMIC(MA_SIZEOF_PTR, ma_node*) pInputNode; |
| 7018 |
}; |
| 7019 |
|
| 7020 |
|
| 7021 |
|
| 7022 |
|
| 7023 |
|
| 7024 |
typedef struct ma_node_input_bus ma_node_input_bus; |
| 7025 |
struct ma_node_input_bus |
| 7026 |
{ |
| 7027 |
|
| 7028 |
ma_node_output_bus head; |
| 7029 |
MA_ATOMIC(4, ma_uint32) nextCounter; |
| 7030 |
MA_ATOMIC(4, ma_spinlock) lock; |
| 7031 |
|
| 7032 |
|
| 7033 |
ma_uint8 channels; |
| 7034 |
}; |
| 7035 |
|
| 7036 |
|
| 7037 |
typedef struct ma_node_base ma_node_base; |
| 7038 |
struct ma_node_base |
| 7039 |
{ |
| 7040 |
|
| 7041 |
ma_node_graph* pNodeGraph; |
| 7042 |
const ma_node_vtable* vtable; |
| 7043 |
ma_uint32 inputBusCount; |
| 7044 |
ma_uint32 outputBusCount; |
| 7045 |
ma_node_input_bus* pInputBuses; |
| 7046 |
ma_node_output_bus* pOutputBuses; |
| 7047 |
float* pCachedData; |
| 7048 |
ma_uint16 cachedDataCapInFramesPerBus; |
| 7049 |
|
| 7050 |
|
| 7051 |
ma_uint16 cachedFrameCountOut; |
| 7052 |
ma_uint16 cachedFrameCountIn; |
| 7053 |
ma_uint16 consumedFrameCountIn; |
| 7054 |
|
| 7055 |
|
| 7056 |
MA_ATOMIC(4, ma_node_state) state; |
| 7057 |
MA_ATOMIC(8, ma_uint64) stateTimes[2]; |
| 7058 |
MA_ATOMIC(8, ma_uint64) localTime; |
| 7059 |
|
| 7060 |
|
| 7061 |
ma_node_input_bus _inputBuses[MA_MAX_NODE_LOCAL_BUS_COUNT]; |
| 7062 |
ma_node_output_bus _outputBuses[MA_MAX_NODE_LOCAL_BUS_COUNT]; |
| 7063 |
void* _pHeap; |
| 7064 |
ma_bool32 _ownsHeap; |
| 7065 |
}; |
| 7066 |
|
| 7067 |
MA_API ma_result ma_node_get_heap_size(ma_node_graph* pNodeGraph, const ma_node_config* pConfig, size_t* pHeapSizeInBytes); |
| 7068 |
MA_API ma_result ma_node_init_preallocated(ma_node_graph* pNodeGraph, const ma_node_config* pConfig, void* pHeap, ma_node* pNode); |
| 7069 |
MA_API ma_result ma_node_init(ma_node_graph* pNodeGraph, const ma_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_node* pNode); |
| 7070 |
MA_API void ma_node_uninit(ma_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7071 |
MA_API ma_node_graph* ma_node_get_node_graph(const ma_node* pNode); |
| 7072 |
MA_API ma_uint32 ma_node_get_input_bus_count(const ma_node* pNode); |
| 7073 |
MA_API ma_uint32 ma_node_get_output_bus_count(const ma_node* pNode); |
| 7074 |
MA_API ma_uint32 ma_node_get_input_channels(const ma_node* pNode, ma_uint32 inputBusIndex); |
| 7075 |
MA_API ma_uint32 ma_node_get_output_channels(const ma_node* pNode, ma_uint32 outputBusIndex); |
| 7076 |
MA_API ma_result ma_node_attach_output_bus(ma_node* pNode, ma_uint32 outputBusIndex, ma_node* pOtherNode, ma_uint32 otherNodeInputBusIndex); |
| 7077 |
MA_API ma_result ma_node_detach_output_bus(ma_node* pNode, ma_uint32 outputBusIndex); |
| 7078 |
MA_API ma_result ma_node_detach_all_output_buses(ma_node* pNode); |
| 7079 |
MA_API ma_result ma_node_set_output_bus_volume(ma_node* pNode, ma_uint32 outputBusIndex, float volume); |
| 7080 |
MA_API float ma_node_get_output_bus_volume(const ma_node* pNode, ma_uint32 outputBusIndex); |
| 7081 |
MA_API ma_result ma_node_set_state(ma_node* pNode, ma_node_state state); |
| 7082 |
MA_API ma_node_state ma_node_get_state(const ma_node* pNode); |
| 7083 |
MA_API ma_result ma_node_set_state_time(ma_node* pNode, ma_node_state state, ma_uint64 globalTime); |
| 7084 |
MA_API ma_uint64 ma_node_get_state_time(const ma_node* pNode, ma_node_state state); |
| 7085 |
MA_API ma_node_state ma_node_get_state_by_time(const ma_node* pNode, ma_uint64 globalTime); |
| 7086 |
MA_API ma_node_state ma_node_get_state_by_time_range(const ma_node* pNode, ma_uint64 globalTimeBeg, ma_uint64 globalTimeEnd); |
| 7087 |
MA_API ma_uint64 ma_node_get_time(const ma_node* pNode); |
| 7088 |
MA_API ma_result ma_node_set_time(ma_node* pNode, ma_uint64 localTime); |
| 7089 |
|
| 7090 |
|
| 7091 |
typedef struct |
| 7092 |
{ |
| 7093 |
ma_uint32 channels; |
| 7094 |
ma_uint32 processingSizeInFrames; |
| 7095 |
size_t preMixStackSizeInBytes; |
| 7096 |
} ma_node_graph_config; |
| 7097 |
|
| 7098 |
MA_API ma_node_graph_config ma_node_graph_config_init(ma_uint32 channels); |
| 7099 |
|
| 7100 |
|
| 7101 |
struct ma_node_graph |
| 7102 |
{ |
| 7103 |
|
| 7104 |
ma_node_base base; |
| 7105 |
ma_node_base endpoint; |
| 7106 |
float* pProcessingCache; |
| 7107 |
ma_uint32 processingCacheFramesRemaining; |
| 7108 |
ma_uint32 processingSizeInFrames; |
| 7109 |
|
| 7110 |
|
| 7111 |
MA_ATOMIC(4, ma_bool32) isReading; |
| 7112 |
|
| 7113 |
|
| 7114 |
ma_stack* pPreMixStack; |
| 7115 |
}; |
| 7116 |
|
| 7117 |
MA_API ma_result ma_node_graph_init(const ma_node_graph_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_node_graph* pNodeGraph); |
| 7118 |
MA_API void ma_node_graph_uninit(ma_node_graph* pNodeGraph, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7119 |
MA_API ma_node* ma_node_graph_get_endpoint(ma_node_graph* pNodeGraph); |
| 7120 |
MA_API ma_result ma_node_graph_read_pcm_frames(ma_node_graph* pNodeGraph, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 7121 |
MA_API ma_uint32 ma_node_graph_get_channels(const ma_node_graph* pNodeGraph); |
| 7122 |
MA_API ma_uint64 ma_node_graph_get_time(const ma_node_graph* pNodeGraph); |
| 7123 |
MA_API ma_result ma_node_graph_set_time(ma_node_graph* pNodeGraph, ma_uint64 globalTime); |
| 7124 |
MA_API ma_uint32 ma_node_graph_get_processing_size_in_frames(const ma_node_graph* pNodeGraph); |
| 7125 |
|
| 7126 |
|
| 7127 |
|
| 7128 |
|
| 7129 |
typedef struct |
| 7130 |
{ |
| 7131 |
ma_node_config nodeConfig; |
| 7132 |
ma_data_source* pDataSource; |
| 7133 |
} ma_data_source_node_config; |
| 7134 |
|
| 7135 |
MA_API ma_data_source_node_config ma_data_source_node_config_init(ma_data_source* pDataSource); |
| 7136 |
|
| 7137 |
|
| 7138 |
typedef struct |
| 7139 |
{ |
| 7140 |
ma_node_base base; |
| 7141 |
ma_data_source* pDataSource; |
| 7142 |
} ma_data_source_node; |
| 7143 |
|
| 7144 |
MA_API ma_result ma_data_source_node_init(ma_node_graph* pNodeGraph, const ma_data_source_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_data_source_node* pDataSourceNode); |
| 7145 |
MA_API void ma_data_source_node_uninit(ma_data_source_node* pDataSourceNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7146 |
MA_API ma_result ma_data_source_node_set_looping(ma_data_source_node* pDataSourceNode, ma_bool32 isLooping); |
| 7147 |
MA_API ma_bool32 ma_data_source_node_is_looping(ma_data_source_node* pDataSourceNode); |
| 7148 |
|
| 7149 |
|
| 7150 |
|
| 7151 |
typedef struct |
| 7152 |
{ |
| 7153 |
ma_node_config nodeConfig; |
| 7154 |
ma_uint32 channels; |
| 7155 |
ma_uint32 outputBusCount; |
| 7156 |
} ma_splitter_node_config; |
| 7157 |
|
| 7158 |
MA_API ma_splitter_node_config ma_splitter_node_config_init(ma_uint32 channels); |
| 7159 |
|
| 7160 |
|
| 7161 |
typedef struct |
| 7162 |
{ |
| 7163 |
ma_node_base base; |
| 7164 |
} ma_splitter_node; |
| 7165 |
|
| 7166 |
MA_API ma_result ma_splitter_node_init(ma_node_graph* pNodeGraph, const ma_splitter_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_splitter_node* pSplitterNode); |
| 7167 |
MA_API void ma_splitter_node_uninit(ma_splitter_node* pSplitterNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7168 |
|
| 7169 |
|
| 7170 |
|
| 7171 |
|
| 7172 |
|
| 7173 |
typedef struct |
| 7174 |
{ |
| 7175 |
ma_node_config nodeConfig; |
| 7176 |
ma_biquad_config biquad; |
| 7177 |
} ma_biquad_node_config; |
| 7178 |
|
| 7179 |
MA_API ma_biquad_node_config ma_biquad_node_config_init(ma_uint32 channels, float b0, float b1, float b2, float a0, float a1, float a2); |
| 7180 |
|
| 7181 |
|
| 7182 |
typedef struct |
| 7183 |
{ |
| 7184 |
ma_node_base baseNode; |
| 7185 |
ma_biquad biquad; |
| 7186 |
} ma_biquad_node; |
| 7187 |
|
| 7188 |
MA_API ma_result ma_biquad_node_init(ma_node_graph* pNodeGraph, const ma_biquad_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_biquad_node* pNode); |
| 7189 |
MA_API ma_result ma_biquad_node_reinit(const ma_biquad_config* pConfig, ma_biquad_node* pNode); |
| 7190 |
MA_API void ma_biquad_node_uninit(ma_biquad_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7191 |
|
| 7192 |
|
| 7193 |
|
| 7194 |
|
| 7195 |
|
| 7196 |
typedef struct |
| 7197 |
{ |
| 7198 |
ma_node_config nodeConfig; |
| 7199 |
ma_lpf_config lpf; |
| 7200 |
} ma_lpf_node_config; |
| 7201 |
|
| 7202 |
MA_API ma_lpf_node_config ma_lpf_node_config_init(ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order); |
| 7203 |
|
| 7204 |
|
| 7205 |
typedef struct |
| 7206 |
{ |
| 7207 |
ma_node_base baseNode; |
| 7208 |
ma_lpf lpf; |
| 7209 |
} ma_lpf_node; |
| 7210 |
|
| 7211 |
MA_API ma_result ma_lpf_node_init(ma_node_graph* pNodeGraph, const ma_lpf_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf_node* pNode); |
| 7212 |
MA_API ma_result ma_lpf_node_reinit(const ma_lpf_config* pConfig, ma_lpf_node* pNode); |
| 7213 |
MA_API void ma_lpf_node_uninit(ma_lpf_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7214 |
|
| 7215 |
|
| 7216 |
|
| 7217 |
|
| 7218 |
|
| 7219 |
typedef struct |
| 7220 |
{ |
| 7221 |
ma_node_config nodeConfig; |
| 7222 |
ma_hpf_config hpf; |
| 7223 |
} ma_hpf_node_config; |
| 7224 |
|
| 7225 |
MA_API ma_hpf_node_config ma_hpf_node_config_init(ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order); |
| 7226 |
|
| 7227 |
|
| 7228 |
typedef struct |
| 7229 |
{ |
| 7230 |
ma_node_base baseNode; |
| 7231 |
ma_hpf hpf; |
| 7232 |
} ma_hpf_node; |
| 7233 |
|
| 7234 |
MA_API ma_result ma_hpf_node_init(ma_node_graph* pNodeGraph, const ma_hpf_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hpf_node* pNode); |
| 7235 |
MA_API ma_result ma_hpf_node_reinit(const ma_hpf_config* pConfig, ma_hpf_node* pNode); |
| 7236 |
MA_API void ma_hpf_node_uninit(ma_hpf_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7237 |
|
| 7238 |
|
| 7239 |
|
| 7240 |
|
| 7241 |
|
| 7242 |
typedef struct |
| 7243 |
{ |
| 7244 |
ma_node_config nodeConfig; |
| 7245 |
ma_bpf_config bpf; |
| 7246 |
} ma_bpf_node_config; |
| 7247 |
|
| 7248 |
MA_API ma_bpf_node_config ma_bpf_node_config_init(ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order); |
| 7249 |
|
| 7250 |
|
| 7251 |
typedef struct |
| 7252 |
{ |
| 7253 |
ma_node_base baseNode; |
| 7254 |
ma_bpf bpf; |
| 7255 |
} ma_bpf_node; |
| 7256 |
|
| 7257 |
MA_API ma_result ma_bpf_node_init(ma_node_graph* pNodeGraph, const ma_bpf_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_bpf_node* pNode); |
| 7258 |
MA_API ma_result ma_bpf_node_reinit(const ma_bpf_config* pConfig, ma_bpf_node* pNode); |
| 7259 |
MA_API void ma_bpf_node_uninit(ma_bpf_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7260 |
|
| 7261 |
|
| 7262 |
|
| 7263 |
|
| 7264 |
|
| 7265 |
typedef struct |
| 7266 |
{ |
| 7267 |
ma_node_config nodeConfig; |
| 7268 |
ma_notch_config notch; |
| 7269 |
} ma_notch_node_config; |
| 7270 |
|
| 7271 |
MA_API ma_notch_node_config ma_notch_node_config_init(ma_uint32 channels, ma_uint32 sampleRate, double q, double frequency); |
| 7272 |
|
| 7273 |
|
| 7274 |
typedef struct |
| 7275 |
{ |
| 7276 |
ma_node_base baseNode; |
| 7277 |
ma_notch2 notch; |
| 7278 |
} ma_notch_node; |
| 7279 |
|
| 7280 |
MA_API ma_result ma_notch_node_init(ma_node_graph* pNodeGraph, const ma_notch_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_notch_node* pNode); |
| 7281 |
MA_API ma_result ma_notch_node_reinit(const ma_notch_config* pConfig, ma_notch_node* pNode); |
| 7282 |
MA_API void ma_notch_node_uninit(ma_notch_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7283 |
|
| 7284 |
|
| 7285 |
|
| 7286 |
|
| 7287 |
|
| 7288 |
typedef struct |
| 7289 |
{ |
| 7290 |
ma_node_config nodeConfig; |
| 7291 |
ma_peak_config peak; |
| 7292 |
} ma_peak_node_config; |
| 7293 |
|
| 7294 |
MA_API ma_peak_node_config ma_peak_node_config_init(ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double q, double frequency); |
| 7295 |
|
| 7296 |
|
| 7297 |
typedef struct |
| 7298 |
{ |
| 7299 |
ma_node_base baseNode; |
| 7300 |
ma_peak2 peak; |
| 7301 |
} ma_peak_node; |
| 7302 |
|
| 7303 |
MA_API ma_result ma_peak_node_init(ma_node_graph* pNodeGraph, const ma_peak_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_peak_node* pNode); |
| 7304 |
MA_API ma_result ma_peak_node_reinit(const ma_peak_config* pConfig, ma_peak_node* pNode); |
| 7305 |
MA_API void ma_peak_node_uninit(ma_peak_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7306 |
|
| 7307 |
|
| 7308 |
|
| 7309 |
|
| 7310 |
|
| 7311 |
typedef struct |
| 7312 |
{ |
| 7313 |
ma_node_config nodeConfig; |
| 7314 |
ma_loshelf_config loshelf; |
| 7315 |
} ma_loshelf_node_config; |
| 7316 |
|
| 7317 |
MA_API ma_loshelf_node_config ma_loshelf_node_config_init(ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double q, double frequency); |
| 7318 |
|
| 7319 |
|
| 7320 |
typedef struct |
| 7321 |
{ |
| 7322 |
ma_node_base baseNode; |
| 7323 |
ma_loshelf2 loshelf; |
| 7324 |
} ma_loshelf_node; |
| 7325 |
|
| 7326 |
MA_API ma_result ma_loshelf_node_init(ma_node_graph* pNodeGraph, const ma_loshelf_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_loshelf_node* pNode); |
| 7327 |
MA_API ma_result ma_loshelf_node_reinit(const ma_loshelf_config* pConfig, ma_loshelf_node* pNode); |
| 7328 |
MA_API void ma_loshelf_node_uninit(ma_loshelf_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7329 |
|
| 7330 |
|
| 7331 |
|
| 7332 |
|
| 7333 |
|
| 7334 |
typedef struct |
| 7335 |
{ |
| 7336 |
ma_node_config nodeConfig; |
| 7337 |
ma_hishelf_config hishelf; |
| 7338 |
} ma_hishelf_node_config; |
| 7339 |
|
| 7340 |
MA_API ma_hishelf_node_config ma_hishelf_node_config_init(ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double q, double frequency); |
| 7341 |
|
| 7342 |
|
| 7343 |
typedef struct |
| 7344 |
{ |
| 7345 |
ma_node_base baseNode; |
| 7346 |
ma_hishelf2 hishelf; |
| 7347 |
} ma_hishelf_node; |
| 7348 |
|
| 7349 |
MA_API ma_result ma_hishelf_node_init(ma_node_graph* pNodeGraph, const ma_hishelf_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hishelf_node* pNode); |
| 7350 |
MA_API ma_result ma_hishelf_node_reinit(const ma_hishelf_config* pConfig, ma_hishelf_node* pNode); |
| 7351 |
MA_API void ma_hishelf_node_uninit(ma_hishelf_node* pNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7352 |
|
| 7353 |
|
| 7354 |
typedef struct |
| 7355 |
{ |
| 7356 |
ma_node_config nodeConfig; |
| 7357 |
ma_delay_config delay; |
| 7358 |
} ma_delay_node_config; |
| 7359 |
|
| 7360 |
MA_API ma_delay_node_config ma_delay_node_config_init(ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 delayInFrames, float decay); |
| 7361 |
|
| 7362 |
|
| 7363 |
typedef struct |
| 7364 |
{ |
| 7365 |
ma_node_base baseNode; |
| 7366 |
ma_delay delay; |
| 7367 |
} ma_delay_node; |
| 7368 |
|
| 7369 |
MA_API ma_result ma_delay_node_init(ma_node_graph* pNodeGraph, const ma_delay_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_delay_node* pDelayNode); |
| 7370 |
MA_API void ma_delay_node_uninit(ma_delay_node* pDelayNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7371 |
MA_API void ma_delay_node_set_wet(ma_delay_node* pDelayNode, float value); |
| 7372 |
MA_API float ma_delay_node_get_wet(const ma_delay_node* pDelayNode); |
| 7373 |
MA_API void ma_delay_node_set_dry(ma_delay_node* pDelayNode, float value); |
| 7374 |
MA_API float ma_delay_node_get_dry(const ma_delay_node* pDelayNode); |
| 7375 |
MA_API void ma_delay_node_set_decay(ma_delay_node* pDelayNode, float value); |
| 7376 |
MA_API float ma_delay_node_get_decay(const ma_delay_node* pDelayNode); |
| 7377 |
#endif |
| 7378 |
|
| 7379 |
|
| 7380 |
|
| 7381 |
|
| 7382 |
|
| 7383 |
|
| 7384 |
|
| 7385 |
|
| 7386 |
#if !defined(MA_NO_ENGINE) && !defined(MA_NO_NODE_GRAPH) |
| 7387 |
typedef struct ma_engine ma_engine; |
| 7388 |
typedef struct ma_sound ma_sound; |
| 7389 |
|
| 7390 |
|
| 7391 |
|
| 7392 |
typedef enum |
| 7393 |
{ |
| 7394 |
|
| 7395 |
MA_SOUND_FLAG_STREAM = 0x00000001, |
| 7396 |
MA_SOUND_FLAG_DECODE = 0x00000002, |
| 7397 |
MA_SOUND_FLAG_ASYNC = 0x00000004, |
| 7398 |
MA_SOUND_FLAG_WAIT_INIT = 0x00000008, |
| 7399 |
MA_SOUND_FLAG_UNKNOWN_LENGTH = 0x00000010, |
| 7400 |
MA_SOUND_FLAG_LOOPING = 0x00000020, |
| 7401 |
|
| 7402 |
|
| 7403 |
MA_SOUND_FLAG_NO_DEFAULT_ATTACHMENT = 0x00001000, |
| 7404 |
MA_SOUND_FLAG_NO_PITCH = 0x00002000, |
| 7405 |
MA_SOUND_FLAG_NO_SPATIALIZATION = 0x00004000 |
| 7406 |
} ma_sound_flags; |
| 7407 |
|
| 7408 |
#ifndef MA_ENGINE_MAX_LISTENERS |
| 7409 |
#define MA_ENGINE_MAX_LISTENERS 4 |
| 7410 |
#endif |
| 7411 |
|
| 7412 |
#define MA_LISTENER_INDEX_CLOSEST ((ma_uint8)-1) |
| 7413 |
|
| 7414 |
typedef enum |
| 7415 |
{ |
| 7416 |
ma_engine_node_type_sound, |
| 7417 |
ma_engine_node_type_group |
| 7418 |
} ma_engine_node_type; |
| 7419 |
|
| 7420 |
typedef struct |
| 7421 |
{ |
| 7422 |
ma_engine* pEngine; |
| 7423 |
ma_engine_node_type type; |
| 7424 |
ma_uint32 channelsIn; |
| 7425 |
ma_uint32 channelsOut; |
| 7426 |
ma_uint32 sampleRate; |
| 7427 |
ma_uint32 volumeSmoothTimeInPCMFrames; |
| 7428 |
ma_mono_expansion_mode monoExpansionMode; |
| 7429 |
ma_bool8 isPitchDisabled; |
| 7430 |
ma_bool8 isSpatializationDisabled; |
| 7431 |
ma_uint8 pinnedListenerIndex; |
| 7432 |
ma_resampler_config resampling; |
| 7433 |
} ma_engine_node_config; |
| 7434 |
|
| 7435 |
MA_API ma_engine_node_config ma_engine_node_config_init(ma_engine* pEngine, ma_engine_node_type type, ma_uint32 flags); |
| 7436 |
|
| 7437 |
|
| 7438 |
|
| 7439 |
typedef struct |
| 7440 |
{ |
| 7441 |
ma_node_base baseNode; |
| 7442 |
ma_engine* pEngine; |
| 7443 |
ma_uint32 sampleRate; |
| 7444 |
ma_uint32 volumeSmoothTimeInPCMFrames; |
| 7445 |
ma_mono_expansion_mode monoExpansionMode; |
| 7446 |
ma_fader fader; |
| 7447 |
ma_resampler resampler; |
| 7448 |
ma_spatializer spatializer; |
| 7449 |
ma_panner panner; |
| 7450 |
ma_gainer volumeGainer; |
| 7451 |
ma_atomic_float volume; |
| 7452 |
MA_ATOMIC(4, float) pitch; |
| 7453 |
float oldPitch; |
| 7454 |
float oldDopplerPitch; |
| 7455 |
MA_ATOMIC(4, ma_bool32) isPitchDisabled; |
| 7456 |
MA_ATOMIC(4, ma_bool32) isSpatializationDisabled; |
| 7457 |
MA_ATOMIC(4, ma_uint32) pinnedListenerIndex; |
| 7458 |
|
| 7459 |
|
| 7460 |
struct |
| 7461 |
{ |
| 7462 |
ma_atomic_float volumeBeg; |
| 7463 |
ma_atomic_float volumeEnd; |
| 7464 |
ma_atomic_uint64 fadeLengthInFrames; |
| 7465 |
ma_atomic_uint64 absoluteGlobalTimeInFrames; |
| 7466 |
} fadeSettings; |
| 7467 |
|
| 7468 |
|
| 7469 |
ma_bool8 _ownsHeap; |
| 7470 |
void* _pHeap; |
| 7471 |
} ma_engine_node; |
| 7472 |
|
| 7473 |
MA_API ma_result ma_engine_node_get_heap_size(const ma_engine_node_config* pConfig, size_t* pHeapSizeInBytes); |
| 7474 |
MA_API ma_result ma_engine_node_init_preallocated(const ma_engine_node_config* pConfig, void* pHeap, ma_engine_node* pEngineNode); |
| 7475 |
MA_API ma_result ma_engine_node_init(const ma_engine_node_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_engine_node* pEngineNode); |
| 7476 |
MA_API void ma_engine_node_uninit(ma_engine_node* pEngineNode, const ma_allocation_callbacks* pAllocationCallbacks); |
| 7477 |
|
| 7478 |
|
| 7479 |
#define MA_SOUND_SOURCE_CHANNEL_COUNT 0xFFFFFFFF |
| 7480 |
|
| 7481 |
|
| 7482 |
typedef void (* ma_sound_end_proc)(void* pUserData, ma_sound* pSound); |
| 7483 |
|
| 7484 |
typedef struct |
| 7485 |
{ |
| 7486 |
const char* pFilePath; |
| 7487 |
const wchar_t* pFilePathW; |
| 7488 |
ma_data_source* pDataSource; |
| 7489 |
ma_node* pInitialAttachment; |
| 7490 |
ma_uint32 initialAttachmentInputBusIndex; |
| 7491 |
ma_uint32 channelsIn; |
| 7492 |
ma_uint32 channelsOut; |
| 7493 |
ma_mono_expansion_mode monoExpansionMode; |
| 7494 |
ma_uint32 flags; |
| 7495 |
ma_uint32 volumeSmoothTimeInPCMFrames; |
| 7496 |
ma_uint64 initialSeekPointInPCMFrames; |
| 7497 |
ma_uint64 rangeBegInPCMFrames; |
| 7498 |
ma_uint64 rangeEndInPCMFrames; |
| 7499 |
ma_uint64 loopPointBegInPCMFrames; |
| 7500 |
ma_uint64 loopPointEndInPCMFrames; |
| 7501 |
ma_sound_end_proc endCallback; |
| 7502 |
void* pEndCallbackUserData; |
| 7503 |
ma_resampler_config pitchResampling; |
| 7504 |
#ifndef MA_NO_RESOURCE_MANAGER |
| 7505 |
ma_resource_manager_pipeline_notifications initNotifications; |
| 7506 |
#endif |
| 7507 |
ma_fence* pDoneFence; |
| 7508 |
ma_bool32 isLooping; |
| 7509 |
} ma_sound_config; |
| 7510 |
|
| 7511 |
MA_API ma_sound_config ma_sound_config_init(void); |
| 7512 |
MA_API ma_sound_config ma_sound_config_init_2(ma_engine* pEngine); |
| 7513 |
|
| 7514 |
struct ma_sound |
| 7515 |
{ |
| 7516 |
ma_engine_node engineNode; |
| 7517 |
ma_data_source* pDataSource; |
| 7518 |
MA_ATOMIC(8, ma_uint64) seekTarget; |
| 7519 |
MA_ATOMIC(4, ma_bool32) atEnd; |
| 7520 |
ma_sound_end_proc endCallback; |
| 7521 |
void* pEndCallbackUserData; |
| 7522 |
float* pProcessingCache; |
| 7523 |
ma_uint32 processingCacheFramesRemaining; |
| 7524 |
ma_uint32 processingCacheCap; |
| 7525 |
ma_bool8 ownsDataSource; |
| 7526 |
|
| 7527 |
|
| 7528 |
|
| 7529 |
|
| 7530 |
|
| 7531 |
#ifndef MA_NO_RESOURCE_MANAGER |
| 7532 |
ma_resource_manager_data_source* pResourceManagerDataSource; |
| 7533 |
#endif |
| 7534 |
}; |
| 7535 |
|
| 7536 |
|
| 7537 |
typedef struct ma_sound_inlined ma_sound_inlined; |
| 7538 |
struct ma_sound_inlined |
| 7539 |
{ |
| 7540 |
ma_sound sound; |
| 7541 |
ma_sound_inlined* pNext; |
| 7542 |
ma_sound_inlined* pPrev; |
| 7543 |
}; |
| 7544 |
|
| 7545 |
|
| 7546 |
typedef ma_sound_config ma_sound_group_config; |
| 7547 |
typedef ma_sound ma_sound_group; |
| 7548 |
|
| 7549 |
MA_API ma_sound_group_config ma_sound_group_config_init(void); |
| 7550 |
MA_API ma_sound_group_config ma_sound_group_config_init_2(ma_engine* pEngine); |
| 7551 |
|
| 7552 |
typedef void (* ma_engine_process_proc)(void* pUserData, float* pFramesOut, ma_uint64 frameCount); |
| 7553 |
|
| 7554 |
typedef struct |
| 7555 |
{ |
| 7556 |
#if !defined(MA_NO_RESOURCE_MANAGER) |
| 7557 |
ma_resource_manager* pResourceManager; |
| 7558 |
#endif |
| 7559 |
#if !defined(MA_NO_DEVICE_IO) |
| 7560 |
ma_context* pContext; |
| 7561 |
ma_device* pDevice; |
| 7562 |
ma_device_id* pPlaybackDeviceID; |
| 7563 |
ma_device_data_proc dataCallback; |
| 7564 |
ma_device_notification_proc notificationCallback; |
| 7565 |
#endif |
| 7566 |
ma_log* pLog; |
| 7567 |
ma_uint32 listenerCount; |
| 7568 |
ma_uint32 channels; |
| 7569 |
ma_uint32 sampleRate; |
| 7570 |
ma_uint32 periodSizeInFrames; |
| 7571 |
ma_uint32 periodSizeInMilliseconds; |
| 7572 |
ma_uint32 gainSmoothTimeInFrames; |
| 7573 |
ma_uint32 gainSmoothTimeInMilliseconds; |
| 7574 |
ma_uint32 defaultVolumeSmoothTimeInPCMFrames; |
| 7575 |
ma_uint32 preMixStackSizeInBytes; |
| 7576 |
ma_allocation_callbacks allocationCallbacks; |
| 7577 |
ma_bool32 noAutoStart; |
| 7578 |
ma_bool32 noDevice; |
| 7579 |
ma_mono_expansion_mode monoExpansionMode; |
| 7580 |
ma_vfs* pResourceManagerVFS; |
| 7581 |
ma_engine_process_proc onProcess; |
| 7582 |
void* pProcessUserData; |
| 7583 |
ma_resampler_config resourceManagerResampling; |
| 7584 |
ma_resampler_config pitchResampling; |
| 7585 |
} ma_engine_config; |
| 7586 |
|
| 7587 |
MA_API ma_engine_config ma_engine_config_init(void); |
| 7588 |
|
| 7589 |
|
| 7590 |
struct ma_engine |
| 7591 |
{ |
| 7592 |
ma_node_graph nodeGraph; |
| 7593 |
#if !defined(MA_NO_RESOURCE_MANAGER) |
| 7594 |
ma_resource_manager* pResourceManager; |
| 7595 |
#endif |
| 7596 |
#if !defined(MA_NO_DEVICE_IO) |
| 7597 |
ma_device* pDevice; |
| 7598 |
#endif |
| 7599 |
ma_log* pLog; |
| 7600 |
ma_uint32 sampleRate; |
| 7601 |
ma_uint32 listenerCount; |
| 7602 |
ma_spatializer_listener listeners[MA_ENGINE_MAX_LISTENERS]; |
| 7603 |
ma_allocation_callbacks allocationCallbacks; |
| 7604 |
ma_bool8 ownsResourceManager; |
| 7605 |
ma_bool8 ownsDevice; |
| 7606 |
ma_spinlock inlinedSoundLock; |
| 7607 |
ma_sound_inlined* pInlinedSoundHead; |
| 7608 |
MA_ATOMIC(4, ma_uint32) inlinedSoundCount; |
| 7609 |
ma_uint32 gainSmoothTimeInFrames; |
| 7610 |
ma_uint32 defaultVolumeSmoothTimeInPCMFrames; |
| 7611 |
ma_mono_expansion_mode monoExpansionMode; |
| 7612 |
ma_engine_process_proc onProcess; |
| 7613 |
void* pProcessUserData; |
| 7614 |
ma_resampler_config pitchResamplingConfig; |
| 7615 |
}; |
| 7616 |
|
| 7617 |
MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEngine); |
| 7618 |
MA_API void ma_engine_uninit(ma_engine* pEngine); |
| 7619 |
MA_API ma_result ma_engine_read_pcm_frames(ma_engine* pEngine, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 7620 |
MA_API ma_node_graph* ma_engine_get_node_graph(ma_engine* pEngine); |
| 7621 |
#if !defined(MA_NO_RESOURCE_MANAGER) |
| 7622 |
MA_API ma_resource_manager* ma_engine_get_resource_manager(ma_engine* pEngine); |
| 7623 |
#endif |
| 7624 |
MA_API ma_device* ma_engine_get_device(ma_engine* pEngine); |
| 7625 |
MA_API ma_log* ma_engine_get_log(ma_engine* pEngine); |
| 7626 |
MA_API ma_node* ma_engine_get_endpoint(ma_engine* pEngine); |
| 7627 |
MA_API ma_uint64 ma_engine_get_time_in_pcm_frames(const ma_engine* pEngine); |
| 7628 |
MA_API ma_uint64 ma_engine_get_time_in_milliseconds(const ma_engine* pEngine); |
| 7629 |
MA_API ma_result ma_engine_set_time_in_pcm_frames(ma_engine* pEngine, ma_uint64 globalTime); |
| 7630 |
MA_API ma_result ma_engine_set_time_in_milliseconds(ma_engine* pEngine, ma_uint64 globalTime); |
| 7631 |
MA_API ma_uint64 ma_engine_get_time(const ma_engine* pEngine); |
| 7632 |
MA_API ma_result ma_engine_set_time(ma_engine* pEngine, ma_uint64 globalTime); |
| 7633 |
MA_API ma_uint32 ma_engine_get_channels(const ma_engine* pEngine); |
| 7634 |
MA_API ma_uint32 ma_engine_get_sample_rate(const ma_engine* pEngine); |
| 7635 |
|
| 7636 |
MA_API ma_result ma_engine_start(ma_engine* pEngine); |
| 7637 |
MA_API ma_result ma_engine_stop(ma_engine* pEngine); |
| 7638 |
MA_API ma_result ma_engine_set_volume(ma_engine* pEngine, float volume); |
| 7639 |
MA_API float ma_engine_get_volume(ma_engine* pEngine); |
| 7640 |
MA_API ma_result ma_engine_set_gain_db(ma_engine* pEngine, float gainDB); |
| 7641 |
MA_API float ma_engine_get_gain_db(ma_engine* pEngine); |
| 7642 |
|
| 7643 |
MA_API ma_uint32 ma_engine_get_listener_count(const ma_engine* pEngine); |
| 7644 |
MA_API ma_uint32 ma_engine_find_closest_listener(const ma_engine* pEngine, float absolutePosX, float absolutePosY, float absolutePosZ); |
| 7645 |
MA_API void ma_engine_listener_set_position(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z); |
| 7646 |
MA_API ma_vec3f ma_engine_listener_get_position(const ma_engine* pEngine, ma_uint32 listenerIndex); |
| 7647 |
MA_API void ma_engine_listener_set_direction(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z); |
| 7648 |
MA_API ma_vec3f ma_engine_listener_get_direction(const ma_engine* pEngine, ma_uint32 listenerIndex); |
| 7649 |
MA_API void ma_engine_listener_set_velocity(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z); |
| 7650 |
MA_API ma_vec3f ma_engine_listener_get_velocity(const ma_engine* pEngine, ma_uint32 listenerIndex); |
| 7651 |
MA_API void ma_engine_listener_set_cone(ma_engine* pEngine, ma_uint32 listenerIndex, float innerAngleInRadians, float outerAngleInRadians, float outerGain); |
| 7652 |
MA_API void ma_engine_listener_get_cone(const ma_engine* pEngine, ma_uint32 listenerIndex, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain); |
| 7653 |
MA_API void ma_engine_listener_set_world_up(ma_engine* pEngine, ma_uint32 listenerIndex, float x, float y, float z); |
| 7654 |
MA_API ma_vec3f ma_engine_listener_get_world_up(const ma_engine* pEngine, ma_uint32 listenerIndex); |
| 7655 |
MA_API void ma_engine_listener_set_enabled(ma_engine* pEngine, ma_uint32 listenerIndex, ma_bool32 isEnabled); |
| 7656 |
MA_API ma_bool32 ma_engine_listener_is_enabled(const ma_engine* pEngine, ma_uint32 listenerIndex); |
| 7657 |
|
| 7658 |
#ifndef MA_NO_RESOURCE_MANAGER |
| 7659 |
MA_API ma_result ma_engine_play_sound_ex(ma_engine* pEngine, const char* pFilePath, ma_node* pNode, ma_uint32 nodeInputBusIndex); |
| 7660 |
MA_API ma_result ma_engine_play_sound(ma_engine* pEngine, const char* pFilePath, ma_sound_group* pGroup); |
| 7661 |
#endif |
| 7662 |
|
| 7663 |
#ifndef MA_NO_RESOURCE_MANAGER |
| 7664 |
MA_API ma_result ma_sound_init_from_file(ma_engine* pEngine, const char* pFilePath, ma_uint32 flags, ma_sound_group* pGroup, ma_fence* pDoneFence, ma_sound* pSound); |
| 7665 |
MA_API ma_result ma_sound_init_from_file_w(ma_engine* pEngine, const wchar_t* pFilePath, ma_uint32 flags, ma_sound_group* pGroup, ma_fence* pDoneFence, ma_sound* pSound); |
| 7666 |
MA_API ma_result ma_sound_init_copy(ma_engine* pEngine, const ma_sound* pExistingSound, ma_uint32 flags, ma_sound_group* pGroup, ma_sound* pSound); |
| 7667 |
#endif |
| 7668 |
MA_API ma_result ma_sound_init_from_data_source(ma_engine* pEngine, ma_data_source* pDataSource, ma_uint32 flags, ma_sound_group* pGroup, ma_sound* pSound); |
| 7669 |
MA_API ma_result ma_sound_init_ex(ma_engine* pEngine, const ma_sound_config* pConfig, ma_sound* pSound); |
| 7670 |
MA_API void ma_sound_uninit(ma_sound* pSound); |
| 7671 |
MA_API ma_engine* ma_sound_get_engine(const ma_sound* pSound); |
| 7672 |
MA_API ma_data_source* ma_sound_get_data_source(const ma_sound* pSound); |
| 7673 |
MA_API ma_result ma_sound_start(ma_sound* pSound); |
| 7674 |
MA_API ma_result ma_sound_stop(ma_sound* pSound); |
| 7675 |
MA_API ma_result ma_sound_stop_with_fade_in_pcm_frames(ma_sound* pSound, ma_uint64 fadeLengthInFrames); |
| 7676 |
MA_API ma_result ma_sound_stop_with_fade_in_milliseconds(ma_sound* pSound, ma_uint64 fadeLengthInFrames); |
| 7677 |
MA_API void ma_sound_reset_start_time(ma_sound* pSound); |
| 7678 |
MA_API void ma_sound_reset_stop_time(ma_sound* pSound); |
| 7679 |
MA_API void ma_sound_reset_fade(ma_sound* pSound); |
| 7680 |
MA_API void ma_sound_reset_stop_time_and_fade(ma_sound* pSound); |
| 7681 |
MA_API void ma_sound_set_volume(ma_sound* pSound, float volume); |
| 7682 |
MA_API float ma_sound_get_volume(const ma_sound* pSound); |
| 7683 |
MA_API void ma_sound_set_pan(ma_sound* pSound, float pan); |
| 7684 |
MA_API float ma_sound_get_pan(const ma_sound* pSound); |
| 7685 |
MA_API void ma_sound_set_pan_mode(ma_sound* pSound, ma_pan_mode panMode); |
| 7686 |
MA_API ma_pan_mode ma_sound_get_pan_mode(const ma_sound* pSound); |
| 7687 |
MA_API void ma_sound_set_pitch(ma_sound* pSound, float pitch); |
| 7688 |
MA_API float ma_sound_get_pitch(const ma_sound* pSound); |
| 7689 |
MA_API void ma_sound_set_spatialization_enabled(ma_sound* pSound, ma_bool32 enabled); |
| 7690 |
MA_API ma_bool32 ma_sound_is_spatialization_enabled(const ma_sound* pSound); |
| 7691 |
MA_API void ma_sound_set_pinned_listener_index(ma_sound* pSound, ma_uint32 listenerIndex); |
| 7692 |
MA_API ma_uint32 ma_sound_get_pinned_listener_index(const ma_sound* pSound); |
| 7693 |
MA_API ma_uint32 ma_sound_get_listener_index(const ma_sound* pSound); |
| 7694 |
MA_API ma_vec3f ma_sound_get_direction_to_listener(const ma_sound* pSound); |
| 7695 |
MA_API void ma_sound_set_position(ma_sound* pSound, float x, float y, float z); |
| 7696 |
MA_API ma_vec3f ma_sound_get_position(const ma_sound* pSound); |
| 7697 |
MA_API void ma_sound_set_direction(ma_sound* pSound, float x, float y, float z); |
| 7698 |
MA_API ma_vec3f ma_sound_get_direction(const ma_sound* pSound); |
| 7699 |
MA_API void ma_sound_set_velocity(ma_sound* pSound, float x, float y, float z); |
| 7700 |
MA_API ma_vec3f ma_sound_get_velocity(const ma_sound* pSound); |
| 7701 |
MA_API void ma_sound_set_attenuation_model(ma_sound* pSound, ma_attenuation_model attenuationModel); |
| 7702 |
MA_API ma_attenuation_model ma_sound_get_attenuation_model(const ma_sound* pSound); |
| 7703 |
MA_API void ma_sound_set_positioning(ma_sound* pSound, ma_positioning positioning); |
| 7704 |
MA_API ma_positioning ma_sound_get_positioning(const ma_sound* pSound); |
| 7705 |
MA_API void ma_sound_set_rolloff(ma_sound* pSound, float rolloff); |
| 7706 |
MA_API float ma_sound_get_rolloff(const ma_sound* pSound); |
| 7707 |
MA_API void ma_sound_set_min_gain(ma_sound* pSound, float minGain); |
| 7708 |
MA_API float ma_sound_get_min_gain(const ma_sound* pSound); |
| 7709 |
MA_API void ma_sound_set_max_gain(ma_sound* pSound, float maxGain); |
| 7710 |
MA_API float ma_sound_get_max_gain(const ma_sound* pSound); |
| 7711 |
MA_API void ma_sound_set_min_distance(ma_sound* pSound, float minDistance); |
| 7712 |
MA_API float ma_sound_get_min_distance(const ma_sound* pSound); |
| 7713 |
MA_API void ma_sound_set_max_distance(ma_sound* pSound, float maxDistance); |
| 7714 |
MA_API float ma_sound_get_max_distance(const ma_sound* pSound); |
| 7715 |
MA_API void ma_sound_set_cone(ma_sound* pSound, float innerAngleInRadians, float outerAngleInRadians, float outerGain); |
| 7716 |
MA_API void ma_sound_get_cone(const ma_sound* pSound, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain); |
| 7717 |
MA_API void ma_sound_set_doppler_factor(ma_sound* pSound, float dopplerFactor); |
| 7718 |
MA_API float ma_sound_get_doppler_factor(const ma_sound* pSound); |
| 7719 |
MA_API void ma_sound_set_directional_attenuation_factor(ma_sound* pSound, float directionalAttenuationFactor); |
| 7720 |
MA_API float ma_sound_get_directional_attenuation_factor(const ma_sound* pSound); |
| 7721 |
MA_API void ma_sound_set_fade_in_pcm_frames(ma_sound* pSound, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInFrames); |
| 7722 |
MA_API void ma_sound_set_fade_in_milliseconds(ma_sound* pSound, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInMilliseconds); |
| 7723 |
MA_API void ma_sound_set_fade_start_in_pcm_frames(ma_sound* pSound, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInFrames, ma_uint64 absoluteGlobalTimeInFrames); |
| 7724 |
MA_API void ma_sound_set_fade_start_in_milliseconds(ma_sound* pSound, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInMilliseconds, ma_uint64 absoluteGlobalTimeInMilliseconds); |
| 7725 |
MA_API float ma_sound_get_current_fade_volume(const ma_sound* pSound); |
| 7726 |
MA_API void ma_sound_set_start_time_in_pcm_frames(ma_sound* pSound, ma_uint64 absoluteGlobalTimeInFrames); |
| 7727 |
MA_API void ma_sound_set_start_time_in_milliseconds(ma_sound* pSound, ma_uint64 absoluteGlobalTimeInMilliseconds); |
| 7728 |
MA_API void ma_sound_set_stop_time_in_pcm_frames(ma_sound* pSound, ma_uint64 absoluteGlobalTimeInFrames); |
| 7729 |
MA_API void ma_sound_set_stop_time_in_milliseconds(ma_sound* pSound, ma_uint64 absoluteGlobalTimeInMilliseconds); |
| 7730 |
MA_API void ma_sound_set_stop_time_with_fade_in_pcm_frames(ma_sound* pSound, ma_uint64 stopAbsoluteGlobalTimeInFrames, ma_uint64 fadeLengthInFrames); |
| 7731 |
MA_API void ma_sound_set_stop_time_with_fade_in_milliseconds(ma_sound* pSound, ma_uint64 stopAbsoluteGlobalTimeInMilliseconds, ma_uint64 fadeLengthInMilliseconds); |
| 7732 |
MA_API ma_bool32 ma_sound_is_playing(const ma_sound* pSound); |
| 7733 |
MA_API ma_uint64 ma_sound_get_time_in_pcm_frames(const ma_sound* pSound); |
| 7734 |
MA_API ma_uint64 ma_sound_get_time_in_milliseconds(const ma_sound* pSound); |
| 7735 |
MA_API void ma_sound_set_looping(ma_sound* pSound, ma_bool32 isLooping); |
| 7736 |
MA_API ma_bool32 ma_sound_is_looping(const ma_sound* pSound); |
| 7737 |
MA_API ma_bool32 ma_sound_at_end(const ma_sound* pSound); |
| 7738 |
MA_API ma_result ma_sound_seek_to_pcm_frame(ma_sound* pSound, ma_uint64 frameIndex); |
| 7739 |
MA_API ma_result ma_sound_seek_to_second(ma_sound* pSound, float seekPointInSeconds); |
| 7740 |
MA_API ma_result ma_sound_get_data_format(const ma_sound* pSound, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap); |
| 7741 |
MA_API ma_result ma_sound_get_cursor_in_pcm_frames(const ma_sound* pSound, ma_uint64* pCursor); |
| 7742 |
MA_API ma_result ma_sound_get_length_in_pcm_frames(const ma_sound* pSound, ma_uint64* pLength); |
| 7743 |
MA_API ma_result ma_sound_get_cursor_in_seconds(const ma_sound* pSound, float* pCursor); |
| 7744 |
MA_API ma_result ma_sound_get_length_in_seconds(const ma_sound* pSound, float* pLength); |
| 7745 |
MA_API ma_result ma_sound_set_end_callback(ma_sound* pSound, ma_sound_end_proc callback, void* pUserData); |
| 7746 |
|
| 7747 |
MA_API ma_result ma_sound_group_init(ma_engine* pEngine, ma_uint32 flags, ma_sound_group* pParentGroup, ma_sound_group* pGroup); |
| 7748 |
MA_API ma_result ma_sound_group_init_ex(ma_engine* pEngine, const ma_sound_group_config* pConfig, ma_sound_group* pGroup); |
| 7749 |
MA_API void ma_sound_group_uninit(ma_sound_group* pGroup); |
| 7750 |
MA_API ma_engine* ma_sound_group_get_engine(const ma_sound_group* pGroup); |
| 7751 |
MA_API ma_result ma_sound_group_start(ma_sound_group* pGroup); |
| 7752 |
MA_API ma_result ma_sound_group_stop(ma_sound_group* pGroup); |
| 7753 |
MA_API void ma_sound_group_set_volume(ma_sound_group* pGroup, float volume); |
| 7754 |
MA_API float ma_sound_group_get_volume(const ma_sound_group* pGroup); |
| 7755 |
MA_API void ma_sound_group_set_pan(ma_sound_group* pGroup, float pan); |
| 7756 |
MA_API float ma_sound_group_get_pan(const ma_sound_group* pGroup); |
| 7757 |
MA_API void ma_sound_group_set_pan_mode(ma_sound_group* pGroup, ma_pan_mode panMode); |
| 7758 |
MA_API ma_pan_mode ma_sound_group_get_pan_mode(const ma_sound_group* pGroup); |
| 7759 |
MA_API void ma_sound_group_set_pitch(ma_sound_group* pGroup, float pitch); |
| 7760 |
MA_API float ma_sound_group_get_pitch(const ma_sound_group* pGroup); |
| 7761 |
MA_API void ma_sound_group_set_spatialization_enabled(ma_sound_group* pGroup, ma_bool32 enabled); |
| 7762 |
MA_API ma_bool32 ma_sound_group_is_spatialization_enabled(const ma_sound_group* pGroup); |
| 7763 |
MA_API void ma_sound_group_set_pinned_listener_index(ma_sound_group* pGroup, ma_uint32 listenerIndex); |
| 7764 |
MA_API ma_uint32 ma_sound_group_get_pinned_listener_index(const ma_sound_group* pGroup); |
| 7765 |
MA_API ma_uint32 ma_sound_group_get_listener_index(const ma_sound_group* pGroup); |
| 7766 |
MA_API ma_vec3f ma_sound_group_get_direction_to_listener(const ma_sound_group* pGroup); |
| 7767 |
MA_API void ma_sound_group_set_position(ma_sound_group* pGroup, float x, float y, float z); |
| 7768 |
MA_API ma_vec3f ma_sound_group_get_position(const ma_sound_group* pGroup); |
| 7769 |
MA_API void ma_sound_group_set_direction(ma_sound_group* pGroup, float x, float y, float z); |
| 7770 |
MA_API ma_vec3f ma_sound_group_get_direction(const ma_sound_group* pGroup); |
| 7771 |
MA_API void ma_sound_group_set_velocity(ma_sound_group* pGroup, float x, float y, float z); |
| 7772 |
MA_API ma_vec3f ma_sound_group_get_velocity(const ma_sound_group* pGroup); |
| 7773 |
MA_API void ma_sound_group_set_attenuation_model(ma_sound_group* pGroup, ma_attenuation_model attenuationModel); |
| 7774 |
MA_API ma_attenuation_model ma_sound_group_get_attenuation_model(const ma_sound_group* pGroup); |
| 7775 |
MA_API void ma_sound_group_set_positioning(ma_sound_group* pGroup, ma_positioning positioning); |
| 7776 |
MA_API ma_positioning ma_sound_group_get_positioning(const ma_sound_group* pGroup); |
| 7777 |
MA_API void ma_sound_group_set_rolloff(ma_sound_group* pGroup, float rolloff); |
| 7778 |
MA_API float ma_sound_group_get_rolloff(const ma_sound_group* pGroup); |
| 7779 |
MA_API void ma_sound_group_set_min_gain(ma_sound_group* pGroup, float minGain); |
| 7780 |
MA_API float ma_sound_group_get_min_gain(const ma_sound_group* pGroup); |
| 7781 |
MA_API void ma_sound_group_set_max_gain(ma_sound_group* pGroup, float maxGain); |
| 7782 |
MA_API float ma_sound_group_get_max_gain(const ma_sound_group* pGroup); |
| 7783 |
MA_API void ma_sound_group_set_min_distance(ma_sound_group* pGroup, float minDistance); |
| 7784 |
MA_API float ma_sound_group_get_min_distance(const ma_sound_group* pGroup); |
| 7785 |
MA_API void ma_sound_group_set_max_distance(ma_sound_group* pGroup, float maxDistance); |
| 7786 |
MA_API float ma_sound_group_get_max_distance(const ma_sound_group* pGroup); |
| 7787 |
MA_API void ma_sound_group_set_cone(ma_sound_group* pGroup, float innerAngleInRadians, float outerAngleInRadians, float outerGain); |
| 7788 |
MA_API void ma_sound_group_get_cone(const ma_sound_group* pGroup, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain); |
| 7789 |
MA_API void ma_sound_group_set_doppler_factor(ma_sound_group* pGroup, float dopplerFactor); |
| 7790 |
MA_API float ma_sound_group_get_doppler_factor(const ma_sound_group* pGroup); |
| 7791 |
MA_API void ma_sound_group_set_directional_attenuation_factor(ma_sound_group* pGroup, float directionalAttenuationFactor); |
| 7792 |
MA_API float ma_sound_group_get_directional_attenuation_factor(const ma_sound_group* pGroup); |
| 7793 |
MA_API void ma_sound_group_set_fade_in_pcm_frames(ma_sound_group* pGroup, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInFrames); |
| 7794 |
MA_API void ma_sound_group_set_fade_in_milliseconds(ma_sound_group* pGroup, float volumeBeg, float volumeEnd, ma_uint64 fadeLengthInMilliseconds); |
| 7795 |
MA_API float ma_sound_group_get_current_fade_volume(ma_sound_group* pGroup); |
| 7796 |
MA_API void ma_sound_group_set_start_time_in_pcm_frames(ma_sound_group* pGroup, ma_uint64 absoluteGlobalTimeInFrames); |
| 7797 |
MA_API void ma_sound_group_set_start_time_in_milliseconds(ma_sound_group* pGroup, ma_uint64 absoluteGlobalTimeInMilliseconds); |
| 7798 |
MA_API void ma_sound_group_set_stop_time_in_pcm_frames(ma_sound_group* pGroup, ma_uint64 absoluteGlobalTimeInFrames); |
| 7799 |
MA_API void ma_sound_group_set_stop_time_in_milliseconds(ma_sound_group* pGroup, ma_uint64 absoluteGlobalTimeInMilliseconds); |
| 7800 |
MA_API ma_bool32 ma_sound_group_is_playing(const ma_sound_group* pGroup); |
| 7801 |
MA_API ma_uint64 ma_sound_group_get_time_in_pcm_frames(const ma_sound_group* pGroup); |
| 7802 |
#endif |
| 7803 |
|
| 7804 |
|
| 7805 |
#ifdef __cplusplus |
| 7806 |
} |
| 7807 |
#endif |
| 7808 |
#endif |
| 7809 |
|
| 7810 |
|
| 7811 |
|
| 7812 |
|
| 7813 |
|
| 7814 |
|
| 7815 |
|
| 7816 |
|
| 7817 |
|
| 7818 |
|
| 7819 |
|
| 7820 |
|
| 7821 |
|
| 7822 |
|
| 7823 |
|
| 7824 |
|
| 7825 |
|
| 7826 |
|
| 7827 |
|
| 7828 |
|
| 7829 |
|
| 7830 |
|
| 7831 |
|
| 7832 |
|
| 7833 |
|
| 7834 |
|
| 7835 |
|
| 7836 |
|
| 7837 |
|
| 7838 |
|
| 7839 |
|
| 7840 |
|
| 7841 |
|
| 7842 |
|
| 7843 |
|
| 7844 |
|
| 7845 |
|
| 7846 |
|
| 7847 |
|
| 7848 |
|
| 7849 |
|
| 7850 |
|
| 7851 |
|
| 7852 |
|
| 7853 |
|
| 7854 |
|
| 7855 |
|
| 7856 |
|
| 7857 |
|
| 7858 |
|