-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibminiaudio.pxd
3529 lines (2820 loc) · 165 KB
/
libminiaudio.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
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
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
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
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from libc.stddef cimport wchar_t
cdef extern from "<pthread.h>" nogil:
# see: https://github.com/python-llfuse/python-llfuse/blob/master/Include/pthread.pxd
ctypedef unsigned long int pthread_t
ctypedef union pthread_mutex_t:
pass
ctypedef union pthread_cond_t:
pass
cdef extern from "miniaudio.h":
"""
#define MA_NO_RUNTIME_LINKING
#define MA_ENABLE_ONLY_SPECIFIC_BACKENDS
#define MA_ENABLE_COREAUDIO
#define MINIAUDIO_IMPLEMENTATION
"""
# DEF MA_SUCCESS = 0
DEF MA_MAX_CHANNELS = 32
ctypedef signed char ma_int8
ctypedef unsigned char ma_uint8
ctypedef signed short ma_int16
ctypedef unsigned short ma_uint16
ctypedef signed int ma_int32
ctypedef unsigned int ma_uint32
ctypedef signed long long ma_int64
ctypedef unsigned long long ma_uint64
ctypedef ma_uint64 ma_uintptr
ctypedef ma_uint8 ma_bool8
ctypedef ma_uint32 ma_bool32
# cdef int MA_TRUE = 1
# cdef int MA_TRUE = 0
# cdef int MA_SIZE_MAX = 0xFFFFFFFF
ctypedef float ma_float
ctypedef double ma_double
ctypedef void* ma_handle
ctypedef void* ma_ptr
ctypedef void* ma_proc
ctypedef struct ma_atomic_uint32:
ma_uint32 value
ctypedef struct ma_atomic_int32:
ma_int32 value
ctypedef struct ma_atomic_uint64:
ma_uint64 value
ctypedef struct ma_atomic_float:
ma_float value
ctypedef struct ma_atomic_bool32:
ma_bool32 value
# --------------------------------------------------------
# Prelims
ctypedef struct ma_context
ctypedef struct ma_device
ctypedef ma_uint8 ma_channel
ctypedef enum ma_result:
MA_SUCCESS = 0
MA_ERROR = -1 # A generic error.
MA_INVALID_ARGS = -2
MA_INVALID_OPERATION = -3
MA_OUT_OF_MEMORY = -4
MA_OUT_OF_RANGE = -5
MA_ACCESS_DENIED = -6
MA_DOES_NOT_EXIST = -7
MA_ALREADY_EXISTS = -8
MA_TOO_MANY_OPEN_FILES = -9
MA_INVALID_FILE = -10
MA_TOO_BIG = -11
MA_PATH_TOO_LONG = -12
MA_NAME_TOO_LONG = -13
MA_NOT_DIRECTORY = -14
MA_IS_DIRECTORY = -15
MA_DIRECTORY_NOT_EMPTY = -16
MA_AT_END = -17
MA_NO_SPACE = -18
MA_BUSY = -19
MA_IO_ERROR = -20
MA_INTERRUPT = -21
MA_UNAVAILABLE = -22
MA_ALREADY_IN_USE = -23
MA_BAD_ADDRESS = -24
MA_BAD_SEEK = -25
MA_BAD_PIPE = -26
MA_DEADLOCK = -27
MA_TOO_MANY_LINKS = -28
MA_NOT_IMPLEMENTED = -29
MA_NO_MESSAGE = -30
MA_BAD_MESSAGE = -31
MA_NO_DATA_AVAILABLE = -32
MA_INVALID_DATA = -33
MA_TIMEOUT = -34
MA_NO_NETWORK = -35
MA_NOT_UNIQUE = -36
MA_NOT_SOCKET = -37
MA_NO_ADDRESS = -38
MA_BAD_PROTOCOL = -39
MA_PROTOCOL_UNAVAILABLE = -40
MA_PROTOCOL_NOT_SUPPORTED = -41
MA_PROTOCOL_FAMILY_NOT_SUPPORTED = -42
MA_ADDRESS_FAMILY_NOT_SUPPORTED = -43
MA_SOCKET_NOT_SUPPORTED = -44
MA_CONNECTION_RESET = -45
MA_ALREADY_CONNECTED = -46
MA_NOT_CONNECTED = -47
MA_CONNECTION_REFUSED = -48
MA_NO_HOST = -49
MA_IN_PROGRESS = -50
MA_CANCELLED = -51
MA_MEMORY_ALREADY_MAPPED = -52
# General non-standard errors.
MA_CRC_MISMATCH = -100
# General miniaudio-specific errors.
MA_FORMAT_NOT_SUPPORTED = -200
MA_DEVICE_TYPE_NOT_SUPPORTED = -201
MA_SHARE_MODE_NOT_SUPPORTED = -202
MA_NO_BACKEND = -203
MA_NO_DEVICE = -204
MA_API_NOT_FOUND = -205
MA_INVALID_DEVICE_CONFIG = -206
MA_LOOP = -207
MA_BACKEND_NOT_ENABLED = -208
# State errors.
MA_DEVICE_NOT_INITIALIZED = -300
MA_DEVICE_ALREADY_INITIALIZED = -301
MA_DEVICE_NOT_STARTED = -302
MA_DEVICE_NOT_STOPPED = -303
# Operation errors.
MA_FAILED_TO_INIT_BACKEND = -400
MA_FAILED_TO_OPEN_BACKEND_DEVICE = -401
MA_FAILED_TO_START_BACKEND_DEVICE = -402
MA_FAILED_TO_STOP_BACKEND_DEVICE = -403
ctypedef enum ma_stream_format:
ma_stream_format_pcm = 0
ctypedef enum ma_stream_layout:
ma_stream_layout_interleaved = 0
ma_stream_layout_deinterleaved = 1
ctypedef enum ma_dither_mode:
ma_dither_mode_none = 0
ma_dither_mode_rectangle = 1
ma_dither_mode_triangle = 2
ctypedef enum ma_format:
ma_format_unknown = 0
ma_format_u8 = 1
ma_format_s16 = 2
ma_format_s24 = 3
ma_format_s32 = 4
ma_format_f32 = 5
ma_format_count = 6
ctypedef enum ma_standard_sample_rate:
ma_standard_sample_rate_48000 = 48000
ma_standard_sample_rate_44100 = 44100
ma_standard_sample_rate_32000 = 32000
ma_standard_sample_rate_24000 = 24000
ma_standard_sample_rate_22050 = 22050
ma_standard_sample_rate_88200 = 88200
ma_standard_sample_rate_96000 = 96000
ma_standard_sample_rate_176400 = 176400
ma_standard_sample_rate_192000 = 192000
ma_standard_sample_rate_16000 = 16000
ma_standard_sample_rate_11025 = 11250
ma_standard_sample_rate_8000 = 8000
ma_standard_sample_rate_352800 = 352800
ma_standard_sample_rate_384000 = 384000
ma_standard_sample_rate_min = ma_standard_sample_rate_8000,
ma_standard_sample_rate_max = ma_standard_sample_rate_384000,
ma_standard_sample_rate_count = 14
ctypedef enum ma_channel_mix_mode:
ma_channel_mix_mode_rectangular = 0
ma_channel_mix_mode_simple
ma_channel_mix_mode_custom_weights
ma_channel_mix_mode_default = ma_channel_mix_mode_rectangular
ctypedef enum ma_standard_channel_map:
ma_standard_channel_map_microsoft
ma_standard_channel_map_alsa
ma_standard_channel_map_rfc3551
ma_standard_channel_map_flac
ma_standard_channel_map_vorbis
ma_standard_channel_map_sound4
ma_standard_channel_map_sndio
ma_standard_channel_map_webaudio = ma_standard_channel_map_flac
ma_standard_channel_map_default = ma_standard_channel_map_microsoft
ctypedef enum ma_performance_profile:
ma_performance_profile_low_latency = 0
ma_performance_profile_conservative
ctypedef struct ma_allocation_callbacks:
void *pUserData
void *(*onMalloc)(size_t sz, void *pUserData)
void *(*onRealloc)(void *p, size_t sz, void *pUserData)
void (*onFree)(void *p, void *pUserData)
ctypedef struct ma_lcg:
ma_int32 state
ctypedef enum ma_thread_priority:
ma_thread_priority_idle = -5
ma_thread_priority_lowest = -4
ma_thread_priority_low = -3
ma_thread_priority_normal = -2
ma_thread_priority_high = -1
ma_thread_priority_highest = 0
ma_thread_priority_realtime = 1
ma_thread_priority_default = 0
ctypedef ma_uint32 ma_spinlock
ctypedef pthread_t ma_thread
ctypedef pthread_mutex_t ma_mutex
ctypedef struct ma_event:
ma_uint32 value
pthread_mutex_t lock
pthread_cond_t cond
ctypedef struct ma_semaphore:
int value
pthread_mutex_t lock
pthread_cond_t cond
# -----------------------------------------------------------
# get version funcs
void ma_version(ma_uint32* pMajor, ma_uint32* pMinor, ma_uint32* pRevision)
char* ma_version_string()
# -----------------------------------------------------------
# logging
ctypedef enum ma_log_level:
MA_LOG_LEVEL_DEBUG = 4
MA_LOG_LEVEL_INFO = 3
MA_LOG_LEVEL_WARNING = 2
MA_LOG_LEVEL_ERROR = 1
# The callback for handling log messages.
ctypedef void (* ma_log_callback_proc)(void* pUserData, ma_uint32 level, const char* pMessage)
ctypedef struct ma_log_callback:
ma_log_callback_proc onLog
void* pUserData
ma_log_callback ma_log_callback_init(ma_log_callback_proc onLog, void* pUserData)
ctypedef struct ma_log:
ma_log_callback callbacks[4]
ma_uint32 callbackCount
ma_allocation_callbacks allocationCallbacks
ma_mutex lock
ma_result ma_log_init(const ma_allocation_callbacks* pAllocationCallbacks, ma_log* pLog)
void ma_log_uninit(ma_log* pLog)
ma_result ma_log_register_callback(ma_log* pLog, ma_log_callback callback)
ma_result ma_log_unregister_callback(ma_log* pLog, ma_log_callback callback)
ma_result ma_log_post(ma_log* pLog, ma_uint32 level, const char* pMessage)
# ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat, va_list args)
# ma_result ma_log_postf(ma_log* pLog, ma_uint32 level, const char* pFormat, ...) __attribute__((format(printf, 3, 4)))
# -----------------------------------------------------------
# Biquad Filtering
ctypedef union ma_biquad_coefficient:
float f32
ma_int32 s32
ctypedef struct ma_biquad_config:
ma_format format
ma_uint32 channels
double b0
double b1
double b2
double a0
double a1
double a2
# 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)
ctypedef struct ma_biquad:
ma_format format
ma_uint32 channels
ma_biquad_coefficient b0
ma_biquad_coefficient b1
ma_biquad_coefficient b2
ma_biquad_coefficient a1
ma_biquad_coefficient a2
ma_biquad_coefficient* pR1
ma_biquad_coefficient* pR2
# API
ma_result ma_biquad_get_heap_size(const ma_biquad_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_biquad_init_preallocated(const ma_biquad_config* pConfig, void* pHeap, ma_biquad* pBQ)
ma_result ma_biquad_init(const ma_biquad_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_biquad* pBQ)
void ma_biquad_uninit(ma_biquad* pBQ, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_biquad_reinit(const ma_biquad_config* pConfig, ma_biquad* pBQ)
ma_result ma_biquad_clear_cache(ma_biquad* pBQ)
ma_result ma_biquad_process_pcm_frames(ma_biquad* pBQ, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_biquad_get_latency(const ma_biquad* pBQ)
# -----------------------------------------------------------
# Low-Pass Filtering
ctypedef struct ma_lpf1_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double cutoffFrequency
double q
ctypedef ma_lpf1_config ma_lpf2_config
# API
ma_lpf1_config ma_lpf1_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency)
ma_lpf2_config ma_lpf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, double q)
ctypedef struct ma_lpf1:
ma_format format
ma_uint32 channels
ma_biquad_coefficient a
ma_biquad_coefficient* pR1
# API
ma_result ma_lpf1_get_heap_size(const ma_lpf1_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_lpf1_init_preallocated(const ma_lpf1_config* pConfig, void* pHeap, ma_lpf1* pLPF)
ma_result ma_lpf1_init(const ma_lpf1_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf1* pLPF)
void ma_lpf1_uninit(ma_lpf1* pLPF, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_lpf1_reinit(const ma_lpf1_config* pConfig, ma_lpf1* pLPF)
ma_result ma_lpf1_clear_cache(ma_lpf1* pLPF)
ma_result ma_lpf1_process_pcm_frames(ma_lpf1* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_lpf1_get_latency(const ma_lpf1* pLPF)
ctypedef struct ma_lpf2:
ma_biquad bq
# API
ma_result ma_lpf2_get_heap_size(const ma_lpf2_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_lpf2_init_preallocated(const ma_lpf2_config* pConfig, void* pHeap, ma_lpf2* pHPF)
ma_result ma_lpf2_init(const ma_lpf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf2* pLPF)
void ma_lpf2_uninit(ma_lpf2* pLPF, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_lpf2_reinit(const ma_lpf2_config* pConfig, ma_lpf2* pLPF)
ma_result ma_lpf2_clear_cache(ma_lpf2* pLPF)
ma_result ma_lpf2_process_pcm_frames(ma_lpf2* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_lpf2_get_latency(const ma_lpf2* pLPF)
ctypedef struct ma_lpf_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double cutoffFrequency
ma_uint32 order
# API
ma_lpf_config ma_lpf_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order)
ctypedef struct ma_lpf:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
ma_uint32 lpf1Count
ma_uint32 lpf2Count
ma_lpf1* pLPF1
ma_lpf2* pLPF2
# API
ma_result ma_lpf_get_heap_size(const ma_lpf_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_lpf_init_preallocated(const ma_lpf_config* pConfig, void* pHeap, ma_lpf* pLPF)
ma_result ma_lpf_init(const ma_lpf_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf* pLPF)
void ma_lpf_uninit(ma_lpf* pLPF, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_lpf_reinit(const ma_lpf_config* pConfig, ma_lpf* pLPF)
ma_result ma_lpf_clear_cache(ma_lpf* pLPF)
ma_result ma_lpf_process_pcm_frames(ma_lpf* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_lpf_get_latency(const ma_lpf* pLPF)
# -----------------------------------------------------------
# High-Pass Filtering
ctypedef struct ma_hpf1_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double cutoffFrequency
double q
ctypedef ma_hpf1_config ma_hpf2_config
# API
ma_hpf1_config ma_hpf1_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency)
ma_hpf2_config ma_hpf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, double q)
ctypedef struct ma_hpf1:
ma_format format
ma_uint32 channels
ma_biquad_coefficient a
ma_biquad_coefficient* pR1
# API
ma_result ma_hpf1_get_heap_size(const ma_hpf1_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_hpf1_init_preallocated(const ma_hpf1_config* pConfig, void* pHeap, ma_hpf1* pLPF)
ma_result ma_hpf1_init(const ma_hpf1_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hpf1* pHPF)
void ma_hpf1_uninit(ma_hpf1* pHPF, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_hpf1_reinit(const ma_hpf1_config* pConfig, ma_hpf1* pHPF)
ma_result ma_hpf1_process_pcm_frames(ma_hpf1* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_hpf1_get_latency(const ma_hpf1* pHPF)
ctypedef struct ma_hpf2:
ma_biquad bq
# API
ma_result ma_hpf2_get_heap_size(const ma_hpf2_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_hpf2_init_preallocated(const ma_hpf2_config* pConfig, void* pHeap, ma_hpf2* pHPF)
ma_result ma_hpf2_init(const ma_hpf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hpf2* pHPF)
void ma_hpf2_uninit(ma_hpf2* pHPF, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_hpf2_reinit(const ma_hpf2_config* pConfig, ma_hpf2* pHPF)
ma_result ma_hpf2_process_pcm_frames(ma_hpf2* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_hpf2_get_latency(const ma_hpf2* pHPF)
ctypedef struct ma_hpf_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double cutoffFrequency
ma_uint32 order
ma_hpf_config ma_hpf_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order)
ctypedef struct ma_hpf:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
ma_uint32 hpf1Count
ma_uint32 hpf2Count
ma_hpf1* pHPF1
ma_hpf2* pHPF2
# API
ma_result ma_hpf_get_heap_size(const ma_hpf_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_hpf_init_preallocated(const ma_hpf_config* pConfig, void* pHeap, ma_hpf* pLPF)
ma_result ma_hpf_init(const ma_hpf_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hpf* pHPF)
void ma_hpf_uninit(ma_hpf* pHPF, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_hpf_reinit(const ma_hpf_config* pConfig, ma_hpf* pHPF)
ma_result ma_hpf_process_pcm_frames(ma_hpf* pHPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_hpf_get_latency(const ma_hpf* pHPF)
# -----------------------------------------------------------
# Band-Pass Filtering
ctypedef struct ma_bpf2_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double cutoffFrequency
double q
# API
ma_bpf2_config ma_bpf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, double q)
ctypedef struct ma_bpf2:
ma_biquad bq
# API
ma_result ma_bpf2_get_heap_size(const ma_bpf2_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_bpf2_init_preallocated(const ma_bpf2_config* pConfig, void* pHeap, ma_bpf2* pBPF)
ma_result ma_bpf2_init(const ma_bpf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_bpf2* pBPF)
void ma_bpf2_uninit(ma_bpf2* pBPF, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_bpf2_reinit(const ma_bpf2_config* pConfig, ma_bpf2* pBPF)
ma_result ma_bpf2_process_pcm_frames(ma_bpf2* pBPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_bpf2_get_latency(const ma_bpf2* pBPF)
ctypedef struct ma_bpf_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double cutoffFrequency
ma_uint32 order
# API
ma_bpf_config ma_bpf_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order)
ctypedef struct ma_bpf:
ma_format format
ma_uint32 channels
ma_uint32 bpf2Count
ma_bpf2* pBPF2
# API
ma_result ma_bpf_get_heap_size(const ma_bpf_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_bpf_init_preallocated(const ma_bpf_config* pConfig, void* pHeap, ma_bpf* pBPF)
ma_result ma_bpf_init(const ma_bpf_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_bpf* pBPF)
void ma_bpf_uninit(ma_bpf* pBPF, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_bpf_reinit(const ma_bpf_config* pConfig, ma_bpf* pBPF)
ma_result ma_bpf_process_pcm_frames(ma_bpf* pBPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_bpf_get_latency(const ma_bpf* pBPF)
# -----------------------------------------------------------
# Notch Filter
ctypedef struct ma_notch2_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double q
double frequency
ctypedef ma_notch2_config ma_notch_config
# API
ma_notch2_config ma_notch2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double q, double frequency)
ctypedef struct ma_notch2:
ma_biquad bq
# API
ma_result ma_notch2_get_heap_size(const ma_notch2_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_notch2_init_preallocated(const ma_notch2_config* pConfig, void* pHeap, ma_notch2* pFilter)
ma_result ma_notch2_init(const ma_notch2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_notch2* pFilter)
void ma_notch2_uninit(ma_notch2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_notch2_reinit(const ma_notch2_config* pConfig, ma_notch2* pFilter)
ma_result ma_notch2_process_pcm_frames(ma_notch2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_notch2_get_latency(const ma_notch2* pFilter)
# -----------------------------------------------------------
# Peaking EQ Filter
ctypedef struct ma_peak2_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double gainDB
double q
double frequency
ctypedef ma_peak2_config ma_peak_config
# API
ma_peak2_config ma_peak2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double q, double frequency)
ctypedef struct ma_peak2:
ma_biquad bq
# API
ma_result ma_peak2_get_heap_size(const ma_peak2_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_peak2_init_preallocated(const ma_peak2_config* pConfig, void* pHeap, ma_peak2* pFilter)
ma_result ma_peak2_init(const ma_peak2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_peak2* pFilter)
void ma_peak2_uninit(ma_peak2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_peak2_reinit(const ma_peak2_config* pConfig, ma_peak2* pFilter)
ma_result ma_peak2_process_pcm_frames(ma_peak2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_peak2_get_latency(const ma_peak2* pFilter)
# -----------------------------------------------------------
# Low Shelf Filter
ctypedef struct ma_loshelf2_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double gainDB
double shelfSlope
double frequency
ctypedef ma_loshelf2_config ma_loshelf_config
# API
ma_loshelf2_config ma_loshelf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double shelfSlope, double frequency)
ctypedef struct ma_loshelf2:
ma_biquad bq
# API
ma_result ma_loshelf2_get_heap_size(const ma_loshelf2_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_loshelf2_init_preallocated(const ma_loshelf2_config* pConfig, void* pHeap, ma_loshelf2* pFilter)
ma_result ma_loshelf2_init(const ma_loshelf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_loshelf2* pFilter)
void ma_loshelf2_uninit(ma_loshelf2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_loshelf2_reinit(const ma_loshelf2_config* pConfig, ma_loshelf2* pFilter)
ma_result ma_loshelf2_process_pcm_frames(ma_loshelf2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_loshelf2_get_latency(const ma_loshelf2* pFilter)
# -----------------------------------------------------------
# High Shelf Filter
ctypedef struct ma_hishelf2_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
double gainDB
double shelfSlope
double frequency
ctypedef ma_hishelf2_config ma_hishelf_config
# API
ma_hishelf2_config ma_hishelf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double gainDB, double shelfSlope, double frequency)
ctypedef struct ma_hishelf2:
ma_biquad bq
# API
ma_result ma_hishelf2_get_heap_size(const ma_hishelf2_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_hishelf2_init_preallocated(const ma_hishelf2_config* pConfig, void* pHeap, ma_hishelf2* pFilter)
ma_result ma_hishelf2_init(const ma_hishelf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_hishelf2* pFilter)
void ma_hishelf2_uninit(ma_hishelf2* pFilter, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_hishelf2_reinit(const ma_hishelf2_config* pConfig, ma_hishelf2* pFilter)
ma_result ma_hishelf2_process_pcm_frames(ma_hishelf2* pFilter, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_uint32 ma_hishelf2_get_latency(const ma_hishelf2* pFilter)
# -----------------------------------------------------------
# Delay
ctypedef struct ma_delay_config:
ma_uint32 channels
ma_uint32 sampleRate
ma_uint32 delayInFrames
ma_bool32 delayStart
float wet
float dry
float decay
# API
ma_delay_config ma_delay_config_init(ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 delayInFrames, float decay)
ctypedef struct ma_delay:
ma_delay_config config
ma_uint32 cursor
ma_uint32 bufferSizeInFrames
float* pBuffer
# API
ma_result ma_delay_init(const ma_delay_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_delay* pDelay)
void ma_delay_uninit(ma_delay* pDelay, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_delay_process_pcm_frames(ma_delay* pDelay, void* pFramesOut, const void* pFramesIn, ma_uint32 frameCount)
void ma_delay_set_wet(ma_delay* pDelay, float value)
float ma_delay_get_wet(const ma_delay* pDelay)
void ma_delay_set_dry(ma_delay* pDelay, float value)
float ma_delay_get_dry(const ma_delay* pDelay)
void ma_delay_set_decay(ma_delay* pDelay, float value)
float ma_delay_get_decay(const ma_delay* pDelay)
# -----------------------------------------------------------
# Gainer for smooth volume changes
ctypedef struct ma_gainer_config:
ma_uint32 channels
ma_uint32 smoothTimeInFrames
# API
ma_gainer_config ma_gainer_config_init(ma_uint32 channels, ma_uint32 smoothTimeInFrames)
ctypedef struct ma_gainer:
ma_gainer_config config
ma_uint32 t
float masterVolume
float* pOldGains
float* pNewGains
# API
ma_result ma_gainer_get_heap_size(const ma_gainer_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_gainer_init_preallocated(const ma_gainer_config* pConfig, void* pHeap, ma_gainer* pGainer)
ma_result ma_gainer_init(const ma_gainer_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_gainer* pGainer)
void ma_gainer_uninit(ma_gainer* pGainer, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_gainer_process_pcm_frames(ma_gainer* pGainer, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_result ma_gainer_set_gain(ma_gainer* pGainer, float newGain)
ma_result ma_gainer_set_gains(ma_gainer* pGainer, float* pNewGains)
ma_result ma_gainer_set_master_volume(ma_gainer* pGainer, float volume)
ma_result ma_gainer_get_master_volume(const ma_gainer* pGainer, float* pVolume)
# -----------------------------------------------------------
# Stereo Panner
ctypedef enum ma_pan_mode :
ma_pan_mode_balance = 0
ma_pan_mode_pan
ctypedef struct ma_panner_config:
ma_format format
ma_uint32 channels
ma_pan_mode mode
float pan
# API
ma_panner_config ma_panner_config_init(ma_format format, ma_uint32 channels)
ctypedef struct ma_panner:
ma_format format
ma_uint32 channels
ma_pan_mode mode
float pan
# API
ma_result ma_panner_init(const ma_panner_config* pConfig, ma_panner* pPanner)
ma_result ma_panner_process_pcm_frames(ma_panner* pPanner, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
void ma_panner_set_mode(ma_panner* pPanner, ma_pan_mode mode)
ma_pan_mode ma_panner_get_mode(const ma_panner* pPanner)
void ma_panner_set_pan(ma_panner* pPanner, float pan)
float ma_panner_get_pan(const ma_panner* pPanner)
# -----------------------------------------------------------
# Fader
ctypedef struct ma_fader_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRate
# API
ma_fader_config ma_fader_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate)
ctypedef struct ma_fader:
ma_fader_config config
float volumeBeg
float volumeEnd
ma_uint64 lengthInFrames
ma_int64 cursorInFrames
# API
ma_result ma_fader_init(const ma_fader_config* pConfig, ma_fader* pFader)
ma_result ma_fader_process_pcm_frames(ma_fader* pFader, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
void ma_fader_get_data_format(const ma_fader* pFader, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate)
void ma_fader_set_fade(ma_fader* pFader, float volumeBeg, float volumeEnd, ma_uint64 lengthInFrames)
void ma_fader_set_fade_ex(ma_fader* pFader, float volumeBeg, float volumeEnd, ma_uint64 lengthInFrames, ma_int64 startOffsetInFrames)
float ma_fader_get_current_volume(const ma_fader* pFader)
# -----------------------------------------------------------
# Spatializer
ctypedef struct ma_vec3f:
float x
float y
float z
ctypedef struct ma_atomic_vec3f:
ma_vec3f v
ma_spinlock lock
ctypedef enum ma_attenuation_model:
ma_attenuation_model_none
ma_attenuation_model_inverse
ma_attenuation_model_linear
ma_attenuation_model_exponential
ctypedef enum ma_positioning:
ma_positioning_absolute
ma_positioning_relative
ctypedef enum ma_handedness:
ma_handedness_right
ma_handedness_left
ctypedef struct ma_spatializer_listener_config:
ma_uint32 channelsOut
ma_channel* pChannelMapOut
ma_handedness handedness
float coneInnerAngleInRadians
float coneOuterAngleInRadians
float coneOuterGain
float speedOfSound
ma_vec3f worldUp
# API
ma_spatializer_listener_config ma_spatializer_listener_config_init(ma_uint32 channelsOut)
ctypedef struct ma_spatializer_listener:
ma_spatializer_listener_config config
ma_atomic_vec3f position
ma_atomic_vec3f direction
ma_atomic_vec3f velocity
ma_bool32 isEnabled
ma_bool32 _ownsHeap
void* _pHeap
# API
ma_result ma_spatializer_listener_get_heap_size(const ma_spatializer_listener_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_spatializer_listener_init_preallocated(const ma_spatializer_listener_config* pConfig, void* pHeap, ma_spatializer_listener* pListener)
ma_result ma_spatializer_listener_init(const ma_spatializer_listener_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_spatializer_listener* pListener)
void ma_spatializer_listener_uninit(ma_spatializer_listener* pListener, const ma_allocation_callbacks* pAllocationCallbacks)
ma_channel* ma_spatializer_listener_get_channel_map(ma_spatializer_listener* pListener)
void ma_spatializer_listener_set_cone(ma_spatializer_listener* pListener, float innerAngleInRadians, float outerAngleInRadians, float outerGain)
void ma_spatializer_listener_get_cone(const ma_spatializer_listener* pListener, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain)
void ma_spatializer_listener_set_position(ma_spatializer_listener* pListener, float x, float y, float z)
ma_vec3f ma_spatializer_listener_get_position(const ma_spatializer_listener* pListener)
void ma_spatializer_listener_set_direction(ma_spatializer_listener* pListener, float x, float y, float z)
ma_vec3f ma_spatializer_listener_get_direction(const ma_spatializer_listener* pListener)
void ma_spatializer_listener_set_velocity(ma_spatializer_listener* pListener, float x, float y, float z)
ma_vec3f ma_spatializer_listener_get_velocity(const ma_spatializer_listener* pListener)
void ma_spatializer_listener_set_speed_of_sound(ma_spatializer_listener* pListener, float speedOfSound)
float ma_spatializer_listener_get_speed_of_sound(const ma_spatializer_listener* pListener)
void ma_spatializer_listener_set_world_up(ma_spatializer_listener* pListener, float x, float y, float z)
ma_vec3f ma_spatializer_listener_get_world_up(const ma_spatializer_listener* pListener)
void ma_spatializer_listener_set_enabled(ma_spatializer_listener* pListener, ma_bool32 isEnabled)
ma_bool32 ma_spatializer_listener_is_enabled(const ma_spatializer_listener* pListener)
ctypedef struct ma_spatializer_config:
ma_uint32 channelsIn
ma_uint32 channelsOut
ma_channel* pChannelMapIn
ma_attenuation_model attenuationModel
ma_positioning positioning
ma_handedness handedness
float minGain
float maxGain
float minDistance
float maxDistance
float rolloff
float coneInnerAngleInRadians
float coneOuterAngleInRadians
float coneOuterGain
float dopplerFactor
float directionalAttenuationFactor
float minSpatializationChannelGain
ma_uint32 gainSmoothTimeInFrames
# API
ma_spatializer_config ma_spatializer_config_init(ma_uint32 channelsIn, ma_uint32 channelsOut)
ctypedef struct ma_spatializer:
ma_uint32 channelsIn
ma_uint32 channelsOut
ma_channel* pChannelMapIn
ma_attenuation_model attenuationModel
ma_positioning positioning
ma_handedness handedness
float minGain
float maxGain
float minDistance
float maxDistance
float rolloff
float coneInnerAngleInRadians
float coneOuterAngleInRadians
float coneOuterGain
float dopplerFactor
float directionalAttenuationFactor
ma_uint32 gainSmoothTimeInFrames
ma_atomic_vec3f position
ma_atomic_vec3f direction
ma_atomic_vec3f velocity
float dopplerPitch
float minSpatializationChannelGain
ma_gainer gainer
float* pNewChannelGainsOut
void* _pHeap
ma_bool32 _ownsHeap
# API
ma_result ma_spatializer_get_heap_size(const ma_spatializer_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_spatializer_init_preallocated(const ma_spatializer_config* pConfig, void* pHeap, ma_spatializer* pSpatializer)
ma_result ma_spatializer_init(const ma_spatializer_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_spatializer* pSpatializer)
void ma_spatializer_uninit(ma_spatializer* pSpatializer, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_spatializer_process_pcm_frames(ma_spatializer* pSpatializer, ma_spatializer_listener* pListener, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)
ma_result ma_spatializer_set_master_volume(ma_spatializer* pSpatializer, float volume)
ma_result ma_spatializer_get_master_volume(const ma_spatializer* pSpatializer, float* pVolume)
ma_uint32 ma_spatializer_get_input_channels(const ma_spatializer* pSpatializer)
ma_uint32 ma_spatializer_get_output_channels(const ma_spatializer* pSpatializer)
void ma_spatializer_set_attenuation_model(ma_spatializer* pSpatializer, ma_attenuation_model attenuationModel)
ma_attenuation_model ma_spatializer_get_attenuation_model(const ma_spatializer* pSpatializer)
void ma_spatializer_set_positioning(ma_spatializer* pSpatializer, ma_positioning positioning)
ma_positioning ma_spatializer_get_positioning(const ma_spatializer* pSpatializer)
void ma_spatializer_set_rolloff(ma_spatializer* pSpatializer, float rolloff)
float ma_spatializer_get_rolloff(const ma_spatializer* pSpatializer)
void ma_spatializer_set_min_gain(ma_spatializer* pSpatializer, float minGain)
float ma_spatializer_get_min_gain(const ma_spatializer* pSpatializer)
void ma_spatializer_set_max_gain(ma_spatializer* pSpatializer, float maxGain)
float ma_spatializer_get_max_gain(const ma_spatializer* pSpatializer)
void ma_spatializer_set_min_distance(ma_spatializer* pSpatializer, float minDistance)
float ma_spatializer_get_min_distance(const ma_spatializer* pSpatializer)
void ma_spatializer_set_max_distance(ma_spatializer* pSpatializer, float maxDistance)
float ma_spatializer_get_max_distance(const ma_spatializer* pSpatializer)
void ma_spatializer_set_cone(ma_spatializer* pSpatializer, float innerAngleInRadians, float outerAngleInRadians, float outerGain)
void ma_spatializer_get_cone(const ma_spatializer* pSpatializer, float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain)
void ma_spatializer_set_doppler_factor(ma_spatializer* pSpatializer, float dopplerFactor)
float ma_spatializer_get_doppler_factor(const ma_spatializer* pSpatializer)
void ma_spatializer_set_directional_attenuation_factor(ma_spatializer* pSpatializer, float directionalAttenuationFactor)
float ma_spatializer_get_directional_attenuation_factor(const ma_spatializer* pSpatializer)
void ma_spatializer_set_position(ma_spatializer* pSpatializer, float x, float y, float z)
ma_vec3f ma_spatializer_get_position(const ma_spatializer* pSpatializer)
void ma_spatializer_set_direction(ma_spatializer* pSpatializer, float x, float y, float z)
ma_vec3f ma_spatializer_get_direction(const ma_spatializer* pSpatializer)
void ma_spatializer_set_velocity(ma_spatializer* pSpatializer, float x, float y, float z)
ma_vec3f ma_spatializer_get_velocity(const ma_spatializer* pSpatializer)
void ma_spatializer_get_relative_position_and_direction(const ma_spatializer* pSpatializer, const ma_spatializer_listener* pListener, ma_vec3f* pRelativePos, ma_vec3f* pRelativeDir)
# ===========================================================
# DATA CONVERSION SECTION
# -----------------------------------------------------------
# Resampling
ctypedef struct ma_linear_resampler_config:
ma_format format
ma_uint32 channels
ma_uint32 sampleRateIn
ma_uint32 sampleRateOut
ma_uint32 lpfOrder
double lpfNyquistFactor
# API
ma_linear_resampler_config ma_linear_resampler_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut)
cdef union ma_linear_resampler__x0:
float *f32
ma_int16 *s16
cdef union ma_linear_resampler__x1:
float *f32
ma_int16 *s16
ctypedef struct ma_linear_resampler:
ma_linear_resampler_config config
ma_uint32 inAdvanceInt
ma_uint32 inAdvanceFrac
ma_uint32 inTimeInt
ma_uint32 inTimeFrac
ma_linear_resampler__x0 x0
ma_linear_resampler__x1 x1
ma_lpf lpf
# API
ma_result ma_linear_resampler_get_heap_size(const ma_linear_resampler_config* pConfig, size_t* pHeapSizeInBytes)
ma_result ma_linear_resampler_init_preallocated(const ma_linear_resampler_config* pConfig, void* pHeap, ma_linear_resampler* pResampler)
ma_result ma_linear_resampler_init(const ma_linear_resampler_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_linear_resampler* pResampler)
void ma_linear_resampler_uninit(ma_linear_resampler* pResampler, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result ma_linear_resampler_process_pcm_frames(ma_linear_resampler* pResampler, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut)
ma_result ma_linear_resampler_set_rate(ma_linear_resampler* pResampler, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut)
ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResampler, float ratioInOut)
ma_uint64 ma_linear_resampler_get_input_latency(const ma_linear_resampler* pResampler)
ma_uint64 ma_linear_resampler_get_output_latency(const ma_linear_resampler* pResampler)
ma_result ma_linear_resampler_get_required_input_frame_count(const ma_linear_resampler* pResampler, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount)
ma_result ma_linear_resampler_get_expected_output_frame_count(const ma_linear_resampler* pResampler, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount)
ma_result ma_linear_resampler_reset(ma_linear_resampler* pResampler)
ctypedef struct ma_resampler_config
ctypedef void ma_resampling_backend
ctypedef struct ma_resampling_backend_vtable:
ma_result (* onGetHeapSize )(void* pUserData, const ma_resampler_config* pConfig, size_t* pHeapSizeInBytes)
ma_result (* onInit )(void* pUserData, const ma_resampler_config* pConfig, void* pHeap, ma_resampling_backend** ppBackend)
void (* onUninit )(void* pUserData, ma_resampling_backend* pBackend, const ma_allocation_callbacks* pAllocationCallbacks)
ma_result (* onProcess )(void* pUserData, ma_resampling_backend* pBackend, const void* pFramesIn, ma_uint64* pFrameCountIn, void* pFramesOut, ma_uint64* pFrameCountOut)
ma_result (* onSetRate )(void* pUserData, ma_resampling_backend* pBackend, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut)
ma_uint64 (* onGetInputLatency )(void* pUserData, const ma_resampling_backend* pBackend)
ma_uint64 (* onGetOutputLatency )(void* pUserData, const ma_resampling_backend* pBackend)
ma_result (* onGetRequiredInputFrameCount )(void* pUserData, const ma_resampling_backend* pBackend, ma_uint64 outputFrameCount, ma_uint64* pInputFrameCount)
ma_result (* onGetExpectedOutputFrameCount)(void* pUserData, const ma_resampling_backend* pBackend, ma_uint64 inputFrameCount, ma_uint64* pOutputFrameCount)
ma_result (* onReset )(void* pUserData, ma_resampling_backend* pBackend)
ctypedef enum ma_resample_algorithm:
ma_resample_algorithm_linear = 0
ma_resample_algorithm_custom