-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathminiaudio.auto.c.v
11878 lines (9669 loc) · 565 KB
/
miniaudio.auto.c.v
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
// NOTE this file is auto-generated by chew
module miniaudio
import miniaudio.c
pub const used_import = c.used_import
//
// miniaudio.h
//
// C typedef aliases used
// ma_bool8 -> ma_uint8 -> u8
pub type C.ma_bool8 = u8 // C.ma_uint8
// ma_bool32 -> ma_uint32 -> u32
pub type C.ma_bool32 = u32 // C.ma_uint32
// ma_handle -> void* -> voidptr
pub type C.ma_handle = voidptr
// ma_ptr -> void* -> voidptr
// wchar_t -> ma_uint16 -> u16
// ma_channel -> ma_uint8 -> u8
pub type C.ma_channel = u8
pub type Channel = u8
// ma_spinlock -> ma_uint32 -> u32
// ma_thread -> ma_pthread_t -> C.ma_pthread_t
pub type C.ma_thread = voidptr // C.ma_pthread_t -> C.ma_handle
// ma_event -> ma_handle -> C.ma_handle
// ma_semaphore -> ma_handle -> C.ma_handle
// ma_resampling_backend -> void ->
// ma_async_notification -> void ->
// ma_data_source -> void ->
// ma_vfs -> void ->
// ma_vfs_file -> ma_handle -> C.ma_handle
pub type C.ma_vfs_file = voidptr // C.ma_handle
// ma_node -> void ->
// ma_sound_group_config -> ma_sound_config -> SoundConfig
pub type C.ma_sound_group_config = C.ma_sound_config
// ma_sound_group -> ma_sound -> Sound
pub type C.ma_sound_group = C.ma_sound
// va_list
@[typedef]
pub struct C.va_list {}
@[typedef]
pub struct C.ma_data_source {}
pub type DataSource = C.ma_data_source
struct C.playback {
pub mut:
pDeviceID &DeviceId
format Format
channels u32
pChannelMap &Channel
channelMixMode ChannelMixMode
shareMode ShareMode
}
pub type Playback = C.playback
struct C.capture {
pub mut:
pDeviceID &DeviceId
format Format
channels u32
pChannelMap &Channel
channelMixMode ChannelMixMode
shareMode ShareMode
}
pub type Capture = C.capture
/*
TODO Non-numerical: #define miniaudio_h
*/
/*
TODO Non-numerical: #define MA_STRINGIFY(x) #x
*/
/*
TODO Function: #define MA_XSTRINGIFY(x) MA_STRINGIFY(x)
*/
pub const version_major = 0
pub const version_minor = 11
pub const version_revision = 11
pub const version_string = '${version_major}.${version_minor}.${version_revision}'
pub const @true = 1
pub const @false = 0
// Proc is currently undocumented
// C: typedef void (* ma_proc)(void);
pub type Proc = fn ()
// Define NULL for some compilers.
pub const null = unsafe { nil }
// SIMD alignment in bytes. Currently set to 32 bytes in preparation for future AVX optimizations.
pub const simd_alignment = 32
// LogLevel is C.ma_log_level
pub enum LogLevel {
debug = C.MA_LOG_LEVEL_DEBUG // 4,
info = C.MA_LOG_LEVEL_INFO // 3,
warning = C.MA_LOG_LEVEL_WARNING // 2,
error = C.MA_LOG_LEVEL_ERROR // 1,
}
// ChannelPosition is C._ma_channel_position
pub enum ChannelPosition {
@none = C.MA_CHANNEL_NONE // 0,
mono = C.MA_CHANNEL_MONO // 1,
front_left = C.MA_CHANNEL_FRONT_LEFT // 2,
front_right = C.MA_CHANNEL_FRONT_RIGHT // 3,
front_center = C.MA_CHANNEL_FRONT_CENTER // 4,
lfe = C.MA_CHANNEL_LFE // 5,
back_left = C.MA_CHANNEL_BACK_LEFT // 6,
back_right = C.MA_CHANNEL_BACK_RIGHT // 7,
front_left_center = C.MA_CHANNEL_FRONT_LEFT_CENTER // 8,
front_right_center = C.MA_CHANNEL_FRONT_RIGHT_CENTER // 9,
back_center = C.MA_CHANNEL_BACK_CENTER // 10,
side_left = C.MA_CHANNEL_SIDE_LEFT // 11,
side_right = C.MA_CHANNEL_SIDE_RIGHT // 12,
top_center = C.MA_CHANNEL_TOP_CENTER // 13,
top_front_left = C.MA_CHANNEL_TOP_FRONT_LEFT // 14,
top_front_center = C.MA_CHANNEL_TOP_FRONT_CENTER // 15,
top_front_right = C.MA_CHANNEL_TOP_FRONT_RIGHT // 16,
top_back_left = C.MA_CHANNEL_TOP_BACK_LEFT // 17,
top_back_center = C.MA_CHANNEL_TOP_BACK_CENTER // 18,
top_back_right = C.MA_CHANNEL_TOP_BACK_RIGHT // 19,
aux_0 = C.MA_CHANNEL_AUX_0 // 20,
aux_1 = C.MA_CHANNEL_AUX_1 // 21,
aux_2 = C.MA_CHANNEL_AUX_2 // 22,
aux_3 = C.MA_CHANNEL_AUX_3 // 23,
aux_4 = C.MA_CHANNEL_AUX_4 // 24,
aux_5 = C.MA_CHANNEL_AUX_5 // 25,
aux_6 = C.MA_CHANNEL_AUX_6 // 26,
aux_7 = C.MA_CHANNEL_AUX_7 // 27,
aux_8 = C.MA_CHANNEL_AUX_8 // 28,
aux_9 = C.MA_CHANNEL_AUX_9 // 29,
aux_10 = C.MA_CHANNEL_AUX_10 // 30,
aux_11 = C.MA_CHANNEL_AUX_11 // 31,
aux_12 = C.MA_CHANNEL_AUX_12 // 32,
aux_13 = C.MA_CHANNEL_AUX_13 // 33,
aux_14 = C.MA_CHANNEL_AUX_14 // 34,
aux_15 = C.MA_CHANNEL_AUX_15 // 35,
aux_16 = C.MA_CHANNEL_AUX_16 // 36,
aux_17 = C.MA_CHANNEL_AUX_17 // 37,
aux_18 = C.MA_CHANNEL_AUX_18 // 38,
aux_19 = C.MA_CHANNEL_AUX_19 // 39,
aux_20 = C.MA_CHANNEL_AUX_20 // 40,
aux_21 = C.MA_CHANNEL_AUX_21 // 41,
aux_22 = C.MA_CHANNEL_AUX_22 // 42,
aux_23 = C.MA_CHANNEL_AUX_23 // 43,
aux_24 = C.MA_CHANNEL_AUX_24 // 44,
aux_25 = C.MA_CHANNEL_AUX_25 // 45,
aux_26 = C.MA_CHANNEL_AUX_26 // 46,
aux_27 = C.MA_CHANNEL_AUX_27 // 47,
aux_28 = C.MA_CHANNEL_AUX_28 // 48,
aux_29 = C.MA_CHANNEL_AUX_29 // 49,
aux_30 = C.MA_CHANNEL_AUX_30 // 50,
aux_31 = C.MA_CHANNEL_AUX_31 // 51,
left = C.MA_CHANNEL_LEFT // MA_CHANNEL_FRONT_LEFT,
right = C.MA_CHANNEL_RIGHT // MA_CHANNEL_FRONT_RIGHT,
position_count = C.MA_CHANNEL_POSITION_COUNT // (MA_CHANNEL_AUX_31 + 1),
}
// Result is C.ma_result
pub enum Result {
success = C.MA_SUCCESS // 0,
error = C.MA_ERROR // -1, A generic error.
invalid_args = C.MA_INVALID_ARGS // -2,
invalid_operation = C.MA_INVALID_OPERATION // -3,
out_of_memory = C.MA_OUT_OF_MEMORY // -4,
out_of_range = C.MA_OUT_OF_RANGE // -5,
access_denied = C.MA_ACCESS_DENIED // -6,
does_not_exist = C.MA_DOES_NOT_EXIST // -7,
already_exists = C.MA_ALREADY_EXISTS // -8,
too_many_open_files = C.MA_TOO_MANY_OPEN_FILES // -9,
invalid_file = C.MA_INVALID_FILE // -10,
too_big = C.MA_TOO_BIG // -11,
path_too_long = C.MA_PATH_TOO_LONG // -12,
name_too_long = C.MA_NAME_TOO_LONG // -13,
not_directory = C.MA_NOT_DIRECTORY // -14,
is_directory = C.MA_IS_DIRECTORY // -15,
directory_not_empty = C.MA_DIRECTORY_NOT_EMPTY // -16,
at_end = C.MA_AT_END // -17,
no_space = C.MA_NO_SPACE // -18,
busy = C.MA_BUSY // -19,
io_error = C.MA_IO_ERROR // -20,
interrupt = C.MA_INTERRUPT // -21,
unavailable = C.MA_UNAVAILABLE // -22,
already_in_use = C.MA_ALREADY_IN_USE // -23,
bad_address = C.MA_BAD_ADDRESS // -24,
bad_seek = C.MA_BAD_SEEK // -25,
bad_pipe = C.MA_BAD_PIPE // -26,
deadlock = C.MA_DEADLOCK // -27,
too_many_links = C.MA_TOO_MANY_LINKS // -28,
not_implemented = C.MA_NOT_IMPLEMENTED // -29,
no_message = C.MA_NO_MESSAGE // -30,
bad_message = C.MA_BAD_MESSAGE // -31,
no_data_available = C.MA_NO_DATA_AVAILABLE // -32,
invalid_data = C.MA_INVALID_DATA // -33,
timeout = C.MA_TIMEOUT // -34,
no_network = C.MA_NO_NETWORK // -35,
not_unique = C.MA_NOT_UNIQUE // -36,
not_socket = C.MA_NOT_SOCKET // -37,
no_address = C.MA_NO_ADDRESS // -38,
bad_protocol = C.MA_BAD_PROTOCOL // -39,
protocol_unavailable = C.MA_PROTOCOL_UNAVAILABLE // -40,
protocol_not_supported = C.MA_PROTOCOL_NOT_SUPPORTED // -41,
protocol_family_not_supported = C.MA_PROTOCOL_FAMILY_NOT_SUPPORTED // -42,
address_family_not_supported = C.MA_ADDRESS_FAMILY_NOT_SUPPORTED // -43,
socket_not_supported = C.MA_SOCKET_NOT_SUPPORTED // -44,
connection_reset = C.MA_CONNECTION_RESET // -45,
already_connected = C.MA_ALREADY_CONNECTED // -46,
not_connected = C.MA_NOT_CONNECTED // -47,
connection_refused = C.MA_CONNECTION_REFUSED // -48,
no_host = C.MA_NO_HOST // -49,
in_progress = C.MA_IN_PROGRESS // -50,
cancelled = C.MA_CANCELLED // -51,
memory_already_mapped = C.MA_MEMORY_ALREADY_MAPPED // -52,
// -100, General miniaudio-specific errors.
format_not_supported = C.MA_FORMAT_NOT_SUPPORTED
device_type_not_supported = C.MA_DEVICE_TYPE_NOT_SUPPORTED // -101,
share_mode_not_supported = C.MA_SHARE_MODE_NOT_SUPPORTED // -102,
no_backend = C.MA_NO_BACKEND // -103,
no_device = C.MA_NO_DEVICE // -104,
api_not_found = C.MA_API_NOT_FOUND // -105,
invalid_device_config = C.MA_INVALID_DEVICE_CONFIG // -106,
loop = C.MA_LOOP // -107,
// -200, State errors.
device_not_initialized = C.MA_DEVICE_NOT_INITIALIZED
device_already_initialized = C.MA_DEVICE_ALREADY_INITIALIZED // -201,
device_not_started = C.MA_DEVICE_NOT_STARTED // -202,
device_not_stopped = C.MA_DEVICE_NOT_STOPPED // -203,
// -300, Operation errors.
failed_to_init_backend = C.MA_FAILED_TO_INIT_BACKEND
failed_to_open_backend_device = C.MA_FAILED_TO_OPEN_BACKEND_DEVICE // -301,
failed_to_start_backend_device = C.MA_FAILED_TO_START_BACKEND_DEVICE // -302,
failed_to_stop_backend_device = C.MA_FAILED_TO_STOP_BACKEND_DEVICE // -303,
}
pub const min_channels = 1
pub const max_channels = 254
pub const max_filter_order = 8
// StreamFormat is C.ma_stream_format
pub enum StreamFormat {
pcm = C.ma_stream_format_pcm // 0,
}
// StreamLayout is C.ma_stream_layout
pub enum StreamLayout {
interleaved = C.ma_stream_layout_interleaved // 0,
deinterleaved = C.ma_stream_layout_deinterleaved
}
// DitherMode is C.ma_dither_mode
pub enum DitherMode {
@none = C.ma_dither_mode_none // 0,
rectangle = C.ma_dither_mode_rectangle
triangle = C.ma_dither_mode_triangle
}
// Format is C.ma_format
pub enum Format {
unknown = C.ma_format_unknown // 0, Mainly used for indicating an error, but also used as the default for the output format for decoders.
u8 = C.ma_format_u8 // 1,
s16 = C.ma_format_s16 // 2, Seems to be the most widely supported format.
s24 = C.ma_format_s24 // 3, Tightly packed. 3 bytes per sample.
s32 = C.ma_format_s32 // 4,
f32 = C.ma_format_f32 // 5,
count = C.ma_format_count
}
// StandardSampleRate is C.ma_standard_sample_rate
pub enum StandardSampleRate {
_48000 = C.ma_standard_sample_rate_48000 // 48000, Most common
_44100 = C.ma_standard_sample_rate_44100 // 44100,
_32000 = C.ma_standard_sample_rate_32000 // 32000, Lows
_24000 = C.ma_standard_sample_rate_24000 // 24000,
_22050 = C.ma_standard_sample_rate_22050 // 22050,
_88200 = C.ma_standard_sample_rate_88200 // 88200, Highs
_96000 = C.ma_standard_sample_rate_96000 // 96000,
_176400 = C.ma_standard_sample_rate_176400 // 176400,
_192000 = C.ma_standard_sample_rate_192000 // 192000,
_16000 = C.ma_standard_sample_rate_16000 // 16000, Extreme lows
_11025 = C.ma_standard_sample_rate_11025 // 11250,
_8000 = C.ma_standard_sample_rate_8000 // 8000,
_352800 = C.ma_standard_sample_rate_352800 // 352800, Extreme highs
_384000 = C.ma_standard_sample_rate_384000 // 384000,
min = C.ma_standard_sample_rate_min // ma_standard_sample_rate_8000,
max = C.ma_standard_sample_rate_max // ma_standard_sample_rate_384000,
count = C.ma_standard_sample_rate_count // 14, Need to maintain the count manually. Make sure this is updated if items are added to enum.
}
// ChannelMixMode is C.ma_channel_mix_mode
pub enum ChannelMixMode {
rectangular = C.ma_channel_mix_mode_rectangular // 0, Simple averaging based on the plane(s) the channel is sitting on.
simple = C.ma_channel_mix_mode_simple // Drop excess channels; zeroed out extra channels.
custom_weights = C.ma_channel_mix_mode_custom_weights // Use custom weights specified in ma_channel_converter_config.
default = C.ma_channel_mix_mode_default // ma_channel_mix_mode_rectangular,
}
// StandardChannelMap is C.ma_standard_channel_map
pub enum StandardChannelMap {
microsoft = C.ma_standard_channel_map_microsoft
alsa = C.ma_standard_channel_map_alsa
rfc3551 = C.ma_standard_channel_map_rfc3551 // Based off AIFF.
flac = C.ma_standard_channel_map_flac
vorbis = C.ma_standard_channel_map_vorbis
sound4 = C.ma_standard_channel_map_sound4 // FreeBSD's sound(4).
sndio = C.ma_standard_channel_map_sndio // www.sndio.org/tips.html
webaudio = C.ma_standard_channel_map_webaudio // ma_standard_channel_map_flac, https://webaudio.github.io/web-audio-api/#ChannelOrdering. Only 1, 2, 4 and 6 channels are defined, but can fill in the gaps with logical assumptions.
default = C.ma_standard_channel_map_default // ma_standard_channel_map_microsoft,
}
// PerformanceProfile is C.ma_performance_profile
pub enum PerformanceProfile {
low_latency = C.ma_performance_profile_low_latency // 0,
conservative = C.ma_performance_profile_conservative
}
@[typedef]
struct C.ma_allocation_callbacks {
pub mut:
pUserData voidptr
onMalloc fn (sz usize, p_user_data voidptr) voidptr // onMalloc)(size_t
onRealloc fn (p voidptr, sz usize, p_user_data voidptr) voidptr // onRealloc)(void*
onFree fn (p voidptr, p_user_data voidptr) // onFree)(void*
}
pub type AllocationCallbacks = C.ma_allocation_callbacks
@[typedef]
struct C.ma_lcg {
pub mut:
state int
}
pub type Lcg = C.ma_lcg
// ThreadPriority is C.ma_thread_priority
pub enum ThreadPriority {
idle = C.ma_thread_priority_idle // -5,
lowest = C.ma_thread_priority_lowest // -4,
low = C.ma_thread_priority_low // -3,
normal = C.ma_thread_priority_normal // -2,
high = C.ma_thread_priority_high // -1,
highest = C.ma_thread_priority_highest // 0,
realtime = C.ma_thread_priority_realtime // 1,
default = C.ma_thread_priority_default // 0,
}
/*
See miniaudio_default.c.v and miniaudio_windows.c.v
[typedef]
struct C.ma_event {
pub mut:
value u32
@lock C.ma_pthread_mutex_t
cond C.ma_pthread_cond_t
}
*/
pub type Event = C.ma_event
/*
See miniaudio_default.c.v and miniaudio_windows.c.v
[typedef]
struct C.ma_semaphore {
pub mut:
value int
@lock C.ma_pthread_mutex_t
cond C.ma_pthread_cond_t
}
*/
pub type Semaphore = C.ma_semaphore
// C: `MA_API void ma_version(ma_uint32* pMajor, ma_uint32* pMinor, ma_uint32* pRevision)`
fn C.ma_version(p_major &u32, p_minor &u32, p_revision &u32)
// version retrieves the version of miniaudio as separated integers. Each component can be NULL if it's not required.
pub fn version(p_major &u32, p_minor &u32, p_revision &u32) {
C.ma_version(p_major, p_minor, p_revision)
}
// C: `MA_API const char* ma_version_string(void)`
fn C.ma_version_string() &char
// version_string retrieves the version of miniaudio as a string which can be useful for logging purposes.
pub fn version_string() &char {
return C.ma_version_string()
}
/*
TODO Function: #define MA_ATTRIBUTE_FORMAT(fmt,va)
*/
pub const max_log_callbacks = 4
// LogCallbackProc thes callback for handling log messages.
//
//
// Parameters
//----------
// pUserData (in)
// The user data pointer that was passed into ma_log_register_callback().
//
// logLevel (in)
// The log level. This can be one of the following:
//
// +----------------------+
// | Log Level |
// +----------------------+
// | MA_LOG_LEVEL_DEBUG |
// | MA_LOG_LEVEL_INFO |
// | MA_LOG_LEVEL_WARNING |
// | MA_LOG_LEVEL_ERROR |
// +----------------------+
//
// pMessage (in)
// The log message.
//
//
// Remarks
//-------
// Do not modify the state of the device from inside the callback.
// C: typedef void (* ma_log_callback_proc)(void* pUserData, ma_uint32 level, const char* pMessage);
pub type LogCallbackProc = fn (p_user_data voidptr, level u32, const_p_message &char)
@[typedef]
struct C.ma_log_callback {
pub mut:
onLog LogCallbackProc
pUserData voidptr
}
pub type LogCallback = C.ma_log_callback
// C: `MA_API ma_log_callback ma_log_callback_init(ma_log_callback_proc onLog, void* pUserData)`
fn C.ma_log_callback_init(on_log LogCallbackProc, p_user_data voidptr) LogCallback
// log_callback_init is currently undocumented
pub fn log_callback_init(on_log LogCallbackProc, p_user_data voidptr) LogCallback {
return C.ma_log_callback_init(on_log, p_user_data)
}
@[typedef]
struct C.ma_log {
pub mut:
// TODO callbacks [MA_MAX_LOG_CALLBACKS]LogCallback
callbackCount u32
allocationCallbacks AllocationCallbacks // Need to store these persistently because ma_log_postv() might need to allocate a buffer on the heap.
// TODO MA_NO_THREADING C.#ifndef // ma_mutex For thread safety just to make it easier and safer for the logging implementation.
}
pub type Log = C.ma_log
// C: `MA_API ma_result ma_log_init(const ma_allocation_callbacks* pAllocationCallbacks, ma_log* pLog)`
fn C.ma_log_init(const_p_allocation_callbacks &AllocationCallbacks, p_log &Log) Result
// log_init is currently undocumented
pub fn log_init(const_p_allocation_callbacks &AllocationCallbacks, p_log &Log) Result {
return C.ma_log_init(const_p_allocation_callbacks, p_log)
}
// C: `MA_API void ma_log_uninit(ma_log* pLog)`
fn C.ma_log_uninit(p_log &Log)
// log_uninit is currently undocumented
pub fn log_uninit(p_log &Log) {
C.ma_log_uninit(p_log)
}
// C: `MA_API ma_result ma_log_register_callback(ma_log* pLog, ma_log_callback callback)`
fn C.ma_log_register_callback(p_log &Log, callback LogCallback) Result
// log_register_callback is currently undocumented
pub fn log_register_callback(p_log &Log, callback LogCallback) Result {
return C.ma_log_register_callback(p_log, callback)
}
// C: `MA_API ma_result ma_log_unregister_callback(ma_log* pLog, ma_log_callback callback)`
fn C.ma_log_unregister_callback(p_log &Log, callback LogCallback) Result
// log_unregister_callback is currently undocumented
pub fn log_unregister_callback(p_log &Log, callback LogCallback) Result {
return C.ma_log_unregister_callback(p_log, callback)
}
// C: `MA_API ma_result ma_log_post(ma_log* pLog, ma_uint32 level, const char* pMessage)`
fn C.ma_log_post(p_log &Log, level u32, const_p_message &char) Result
// log_post is currently undocumented
pub fn log_post(p_log &Log, level u32, const_p_message &char) Result {
return C.ma_log_post(p_log, level, const_p_message)
}
// C: `MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat, va_list args)`
fn C.ma_log_postv(p_log &Log, level u32, const_p_format &char, args C.va_list) Result
// log_postv is currently undocumented
pub fn log_postv(p_log &Log, level u32, const_p_format &char, args C.va_list) Result {
return C.ma_log_postv(p_log, level, const_p_format, args)
}
// Skipped:
/*
MA_API ma_result ma_log_postf(ma_log* pLog, ma_uint32 level, const char* pFormat, ...) MA_ATTRIBUTE_FORMAT(3, 4);
*/
@[typedef]
union C.ma_biquad_coefficient {
pub mut:
f32 f32
s32 int
}
pub type BiquadCoefficient = C.ma_biquad_coefficient
@[typedef]
struct C.ma_biquad_config {
pub mut:
format Format
channels u32
b0 f64
b1 f64
b2 f64
a0 f64
a1 f64
a2 f64
}
pub type BiquadConfig = C.ma_biquad_config
// C: `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)`
fn C.ma_biquad_config_init(format Format, channels u32, b0 f64, b1 f64, b2 f64, a0 f64, a1 f64, a2 f64) BiquadConfig
// biquad_config_init is currently undocumented
pub fn biquad_config_init(format Format, channels u32, b0 f64, b1 f64, b2 f64, a0 f64, a1 f64, a2 f64) BiquadConfig {
return C.ma_biquad_config_init(format, channels, b0, b1, b2, a0, a1, a2)
}
@[typedef]
struct C.ma_biquad {
pub mut:
format Format
channels u32
b0 BiquadCoefficient
b1 BiquadCoefficient
b2 BiquadCoefficient
a1 BiquadCoefficient
a2 BiquadCoefficient
pR1 &BiquadCoefficient = unsafe { nil }
pR2 &BiquadCoefficient = unsafe { nil } // Memory management.
_pHeap voidptr
_ownsHeap u32
}
pub type Biquad = C.ma_biquad
// C: `MA_API ma_result ma_biquad_get_heap_size(const ma_biquad_config* pConfig, size_t* pHeapSizeInBytes)`
fn C.ma_biquad_get_heap_size(const_p_config &BiquadConfig, p_heap_size_in_bytes &usize) Result
// biquad_get_heap_size is currently undocumented
pub fn biquad_get_heap_size(const_p_config &BiquadConfig, p_heap_size_in_bytes &usize) Result {
return C.ma_biquad_get_heap_size(const_p_config, p_heap_size_in_bytes)
}
// C: `MA_API ma_result ma_biquad_init_preallocated(const ma_biquad_config* pConfig, void* pHeap, ma_biquad* pBQ)`
fn C.ma_biquad_init_preallocated(const_p_config &BiquadConfig, p_heap voidptr, p_bq &Biquad) Result
// biquad_init_preallocated is currently undocumented
pub fn biquad_init_preallocated(const_p_config &BiquadConfig, p_heap voidptr, p_bq &Biquad) Result {
return C.ma_biquad_init_preallocated(const_p_config, p_heap, p_bq)
}
// C: `MA_API ma_result ma_biquad_init(const ma_biquad_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_biquad* pBQ)`
fn C.ma_biquad_init(const_p_config &BiquadConfig, const_p_allocation_callbacks &AllocationCallbacks, p_bq &Biquad) Result
// biquad_init is currently undocumented
pub fn biquad_init(const_p_config &BiquadConfig, const_p_allocation_callbacks &AllocationCallbacks, p_bq &Biquad) Result {
return C.ma_biquad_init(const_p_config, const_p_allocation_callbacks, p_bq)
}
// C: `MA_API void ma_biquad_uninit(ma_biquad* pBQ, const ma_allocation_callbacks* pAllocationCallbacks)`
fn C.ma_biquad_uninit(p_bq &Biquad, const_p_allocation_callbacks &AllocationCallbacks)
// biquad_uninit is currently undocumented
pub fn biquad_uninit(p_bq &Biquad, const_p_allocation_callbacks &AllocationCallbacks) {
C.ma_biquad_uninit(p_bq, const_p_allocation_callbacks)
}
// C: `MA_API ma_result ma_biquad_reinit(const ma_biquad_config* pConfig, ma_biquad* pBQ)`
fn C.ma_biquad_reinit(const_p_config &BiquadConfig, p_bq &Biquad) Result
// biquad_reinit is currently undocumented
pub fn biquad_reinit(const_p_config &BiquadConfig, p_bq &Biquad) Result {
return C.ma_biquad_reinit(const_p_config, p_bq)
}
// C: `MA_API ma_result ma_biquad_clear_cache(ma_biquad* pBQ)`
fn C.ma_biquad_clear_cache(p_bq &Biquad) Result
// biquad_clear_cache is currently undocumented
pub fn biquad_clear_cache(p_bq &Biquad) Result {
return C.ma_biquad_clear_cache(p_bq)
}
// C: `MA_API ma_result ma_biquad_process_pcm_frames(ma_biquad* pBQ, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)`
fn C.ma_biquad_process_pcm_frames(p_bq &Biquad, p_frames_out voidptr, const_p_frames_in voidptr, frame_count u64) Result
// biquad_process_pcm_frames is currently undocumented
pub fn biquad_process_pcm_frames(p_bq &Biquad, p_frames_out voidptr, const_p_frames_in voidptr, frame_count u64) Result {
return C.ma_biquad_process_pcm_frames(p_bq, p_frames_out, const_p_frames_in, frame_count)
}
// C: `MA_API ma_uint32 ma_biquad_get_latency(const ma_biquad* pBQ)`
fn C.ma_biquad_get_latency(const_p_bq &Biquad) u32
// biquad_get_latency is currently undocumented
pub fn biquad_get_latency(const_p_bq &Biquad) u32 {
return C.ma_biquad_get_latency(const_p_bq)
}
@[typedef]
struct C.ma_lpf1_config {
pub mut:
format Format
channels u32
sampleRate u32
cutoffFrequency f64
q f64
}
pub type Lpf1Config = C.ma_lpf1_config
@[typedef]
struct C.ma_lpf2_config {
pub mut:
format Format
channels u32
sampleRate u32
cutoffFrequency f64
q f64
}
pub type Lpf2Config = C.ma_lpf2_config
// C: `MA_API ma_lpf1_config ma_lpf1_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency)`
fn C.ma_lpf1_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64) Lpf1Config
// lpf1_config_init is currently undocumented
pub fn lpf1_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64) Lpf1Config {
return C.ma_lpf1_config_init(format, channels, sample_rate, cutoff_frequency)
}
// C: `MA_API ma_lpf2_config ma_lpf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, double q)`
fn C.ma_lpf2_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64, q f64) Lpf2Config
// lpf2_config_init is currently undocumented
pub fn lpf2_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64, q f64) Lpf2Config {
return C.ma_lpf2_config_init(format, channels, sample_rate, cutoff_frequency, q)
}
@[typedef]
struct C.ma_lpf1 {
pub mut:
format Format
channels u32
a BiquadCoefficient
pR1 &BiquadCoefficient = unsafe { nil } // Memory management.
_pHeap voidptr
_ownsHeap u32
}
pub type Lpf1 = C.ma_lpf1
// C: `MA_API ma_result ma_lpf1_get_heap_size(const ma_lpf1_config* pConfig, size_t* pHeapSizeInBytes)`
fn C.ma_lpf1_get_heap_size(const_p_config &Lpf1Config, p_heap_size_in_bytes &usize) Result
// lpf1_get_heap_size is currently undocumented
pub fn lpf1_get_heap_size(const_p_config &Lpf1Config, p_heap_size_in_bytes &usize) Result {
return C.ma_lpf1_get_heap_size(const_p_config, p_heap_size_in_bytes)
}
// C: `MA_API ma_result ma_lpf1_init_preallocated(const ma_lpf1_config* pConfig, void* pHeap, ma_lpf1* pLPF)`
fn C.ma_lpf1_init_preallocated(const_p_config &Lpf1Config, p_heap voidptr, p_lpf &Lpf1) Result
// lpf1_init_preallocated is currently undocumented
pub fn lpf1_init_preallocated(const_p_config &Lpf1Config, p_heap voidptr, p_lpf &Lpf1) Result {
return C.ma_lpf1_init_preallocated(const_p_config, p_heap, p_lpf)
}
// C: `MA_API ma_result ma_lpf1_init(const ma_lpf1_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf1* pLPF)`
fn C.ma_lpf1_init(const_p_config &Lpf1Config, const_p_allocation_callbacks &AllocationCallbacks, p_lpf &Lpf1) Result
// lpf1_init is currently undocumented
pub fn lpf1_init(const_p_config &Lpf1Config, const_p_allocation_callbacks &AllocationCallbacks, p_lpf &Lpf1) Result {
return C.ma_lpf1_init(const_p_config, const_p_allocation_callbacks, p_lpf)
}
// C: `MA_API void ma_lpf1_uninit(ma_lpf1* pLPF, const ma_allocation_callbacks* pAllocationCallbacks)`
fn C.ma_lpf1_uninit(p_lpf &Lpf1, const_p_allocation_callbacks &AllocationCallbacks)
// lpf1_uninit is currently undocumented
pub fn lpf1_uninit(p_lpf &Lpf1, const_p_allocation_callbacks &AllocationCallbacks) {
C.ma_lpf1_uninit(p_lpf, const_p_allocation_callbacks)
}
// C: `MA_API ma_result ma_lpf1_reinit(const ma_lpf1_config* pConfig, ma_lpf1* pLPF)`
fn C.ma_lpf1_reinit(const_p_config &Lpf1Config, p_lpf &Lpf1) Result
// lpf1_reinit is currently undocumented
pub fn lpf1_reinit(const_p_config &Lpf1Config, p_lpf &Lpf1) Result {
return C.ma_lpf1_reinit(const_p_config, p_lpf)
}
// C: `MA_API ma_result ma_lpf1_clear_cache(ma_lpf1* pLPF)`
fn C.ma_lpf1_clear_cache(p_lpf &Lpf1) Result
// lpf1_clear_cache is currently undocumented
pub fn lpf1_clear_cache(p_lpf &Lpf1) Result {
return C.ma_lpf1_clear_cache(p_lpf)
}
// C: `MA_API ma_result ma_lpf1_process_pcm_frames(ma_lpf1* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)`
fn C.ma_lpf1_process_pcm_frames(p_lpf &Lpf1, p_frames_out voidptr, const_p_frames_in voidptr, frame_count u64) Result
// lpf1_process_pcm_frames is currently undocumented
pub fn lpf1_process_pcm_frames(p_lpf &Lpf1, p_frames_out voidptr, const_p_frames_in voidptr, frame_count u64) Result {
return C.ma_lpf1_process_pcm_frames(p_lpf, p_frames_out, const_p_frames_in, frame_count)
}
// C: `MA_API ma_uint32 ma_lpf1_get_latency(const ma_lpf1* pLPF)`
fn C.ma_lpf1_get_latency(const_p_lpf &Lpf1) u32
// lpf1_get_latency is currently undocumented
pub fn lpf1_get_latency(const_p_lpf &Lpf1) u32 {
return C.ma_lpf1_get_latency(const_p_lpf)
}
@[typedef]
struct C.ma_lpf2 {
pub mut:
bq Biquad // The second order low-pass filter is implemented as a biquad filter.
}
pub type Lpf2 = C.ma_lpf2
// C: `MA_API ma_result ma_lpf2_get_heap_size(const ma_lpf2_config* pConfig, size_t* pHeapSizeInBytes)`
fn C.ma_lpf2_get_heap_size(const_p_config &Lpf2Config, p_heap_size_in_bytes &usize) Result
// lpf2_get_heap_size is currently undocumented
pub fn lpf2_get_heap_size(const_p_config &Lpf2Config, p_heap_size_in_bytes &usize) Result {
return C.ma_lpf2_get_heap_size(const_p_config, p_heap_size_in_bytes)
}
// C: `MA_API ma_result ma_lpf2_init_preallocated(const ma_lpf2_config* pConfig, void* pHeap, ma_lpf2* pHPF)`
fn C.ma_lpf2_init_preallocated(const_p_config &Lpf2Config, p_heap voidptr, p_hpf &Lpf2) Result
// lpf2_init_preallocated is currently undocumented
pub fn lpf2_init_preallocated(const_p_config &Lpf2Config, p_heap voidptr, p_hpf &Lpf2) Result {
return C.ma_lpf2_init_preallocated(const_p_config, p_heap, p_hpf)
}
// C: `MA_API ma_result ma_lpf2_init(const ma_lpf2_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf2* pLPF)`
fn C.ma_lpf2_init(const_p_config &Lpf2Config, const_p_allocation_callbacks &AllocationCallbacks, p_lpf &Lpf2) Result
// lpf2_init is currently undocumented
pub fn lpf2_init(const_p_config &Lpf2Config, const_p_allocation_callbacks &AllocationCallbacks, p_lpf &Lpf2) Result {
return C.ma_lpf2_init(const_p_config, const_p_allocation_callbacks, p_lpf)
}
// C: `MA_API void ma_lpf2_uninit(ma_lpf2* pLPF, const ma_allocation_callbacks* pAllocationCallbacks)`
fn C.ma_lpf2_uninit(p_lpf &Lpf2, const_p_allocation_callbacks &AllocationCallbacks)
// lpf2_uninit is currently undocumented
pub fn lpf2_uninit(p_lpf &Lpf2, const_p_allocation_callbacks &AllocationCallbacks) {
C.ma_lpf2_uninit(p_lpf, const_p_allocation_callbacks)
}
// C: `MA_API ma_result ma_lpf2_reinit(const ma_lpf2_config* pConfig, ma_lpf2* pLPF)`
fn C.ma_lpf2_reinit(const_p_config &Lpf2Config, p_lpf &Lpf2) Result
// lpf2_reinit is currently undocumented
pub fn lpf2_reinit(const_p_config &Lpf2Config, p_lpf &Lpf2) Result {
return C.ma_lpf2_reinit(const_p_config, p_lpf)
}
// C: `MA_API ma_result ma_lpf2_clear_cache(ma_lpf2* pLPF)`
fn C.ma_lpf2_clear_cache(p_lpf &Lpf2) Result
// lpf2_clear_cache is currently undocumented
pub fn lpf2_clear_cache(p_lpf &Lpf2) Result {
return C.ma_lpf2_clear_cache(p_lpf)
}
// C: `MA_API ma_result ma_lpf2_process_pcm_frames(ma_lpf2* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)`
fn C.ma_lpf2_process_pcm_frames(p_lpf &Lpf2, p_frames_out voidptr, const_p_frames_in voidptr, frame_count u64) Result
// lpf2_process_pcm_frames is currently undocumented
pub fn lpf2_process_pcm_frames(p_lpf &Lpf2, p_frames_out voidptr, const_p_frames_in voidptr, frame_count u64) Result {
return C.ma_lpf2_process_pcm_frames(p_lpf, p_frames_out, const_p_frames_in, frame_count)
}
// C: `MA_API ma_uint32 ma_lpf2_get_latency(const ma_lpf2* pLPF)`
fn C.ma_lpf2_get_latency(const_p_lpf &Lpf2) u32
// lpf2_get_latency is currently undocumented
pub fn lpf2_get_latency(const_p_lpf &Lpf2) u32 {
return C.ma_lpf2_get_latency(const_p_lpf)
}
@[typedef]
struct C.ma_lpf_config {
pub mut:
format Format
channels u32
sampleRate u32
cutoffFrequency f64
order u32 // If set to 0, will be treated as a passthrough (no filtering will be applied).
}
pub type LpfConfig = C.ma_lpf_config
// C: `MA_API ma_lpf_config ma_lpf_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, ma_uint32 order)`
fn C.ma_lpf_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64, order u32) LpfConfig
// lpf_config_init is currently undocumented
pub fn lpf_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64, order u32) LpfConfig {
return C.ma_lpf_config_init(format, channels, sample_rate, cutoff_frequency, order)
}
@[typedef]
struct C.ma_lpf {
pub mut:
format Format
channels u32
sampleRate u32
lpf1Count u32
lpf2Count u32
pLPF1 &Lpf1 = unsafe { nil }
pLPF2 &Lpf2 = unsafe { nil } // Memory management.
_pHeap voidptr
_ownsHeap u32
}
pub type Lpf = C.ma_lpf
// C: `MA_API ma_result ma_lpf_get_heap_size(const ma_lpf_config* pConfig, size_t* pHeapSizeInBytes)`
fn C.ma_lpf_get_heap_size(const_p_config &LpfConfig, p_heap_size_in_bytes &usize) Result
// lpf_get_heap_size is currently undocumented
pub fn lpf_get_heap_size(const_p_config &LpfConfig, p_heap_size_in_bytes &usize) Result {
return C.ma_lpf_get_heap_size(const_p_config, p_heap_size_in_bytes)
}
// C: `MA_API ma_result ma_lpf_init_preallocated(const ma_lpf_config* pConfig, void* pHeap, ma_lpf* pLPF)`
fn C.ma_lpf_init_preallocated(const_p_config &LpfConfig, p_heap voidptr, p_lpf &Lpf) Result
// lpf_init_preallocated is currently undocumented
pub fn lpf_init_preallocated(const_p_config &LpfConfig, p_heap voidptr, p_lpf &Lpf) Result {
return C.ma_lpf_init_preallocated(const_p_config, p_heap, p_lpf)
}
// C: `MA_API ma_result ma_lpf_init(const ma_lpf_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_lpf* pLPF)`
fn C.ma_lpf_init(const_p_config &LpfConfig, const_p_allocation_callbacks &AllocationCallbacks, p_lpf &Lpf) Result
// lpf_init is currently undocumented
pub fn lpf_init(const_p_config &LpfConfig, const_p_allocation_callbacks &AllocationCallbacks, p_lpf &Lpf) Result {
return C.ma_lpf_init(const_p_config, const_p_allocation_callbacks, p_lpf)
}
// C: `MA_API void ma_lpf_uninit(ma_lpf* pLPF, const ma_allocation_callbacks* pAllocationCallbacks)`
fn C.ma_lpf_uninit(p_lpf &Lpf, const_p_allocation_callbacks &AllocationCallbacks)
// lpf_uninit is currently undocumented
pub fn lpf_uninit(p_lpf &Lpf, const_p_allocation_callbacks &AllocationCallbacks) {
C.ma_lpf_uninit(p_lpf, const_p_allocation_callbacks)
}
// C: `MA_API ma_result ma_lpf_reinit(const ma_lpf_config* pConfig, ma_lpf* pLPF)`
fn C.ma_lpf_reinit(const_p_config &LpfConfig, p_lpf &Lpf) Result
// lpf_reinit is currently undocumented
pub fn lpf_reinit(const_p_config &LpfConfig, p_lpf &Lpf) Result {
return C.ma_lpf_reinit(const_p_config, p_lpf)
}
// C: `MA_API ma_result ma_lpf_clear_cache(ma_lpf* pLPF)`
fn C.ma_lpf_clear_cache(p_lpf &Lpf) Result
// lpf_clear_cache is currently undocumented
pub fn lpf_clear_cache(p_lpf &Lpf) Result {
return C.ma_lpf_clear_cache(p_lpf)
}
// C: `MA_API ma_result ma_lpf_process_pcm_frames(ma_lpf* pLPF, void* pFramesOut, const void* pFramesIn, ma_uint64 frameCount)`
fn C.ma_lpf_process_pcm_frames(p_lpf &Lpf, p_frames_out voidptr, const_p_frames_in voidptr, frame_count u64) Result
// lpf_process_pcm_frames is currently undocumented
pub fn lpf_process_pcm_frames(p_lpf &Lpf, p_frames_out voidptr, const_p_frames_in voidptr, frame_count u64) Result {
return C.ma_lpf_process_pcm_frames(p_lpf, p_frames_out, const_p_frames_in, frame_count)
}
// C: `MA_API ma_uint32 ma_lpf_get_latency(const ma_lpf* pLPF)`
fn C.ma_lpf_get_latency(const_p_lpf &Lpf) u32
// lpf_get_latency is currently undocumented
pub fn lpf_get_latency(const_p_lpf &Lpf) u32 {
return C.ma_lpf_get_latency(const_p_lpf)
}
@[typedef]
struct C.ma_hpf1_config {
pub mut:
format Format
channels u32
sampleRate u32
cutoffFrequency f64
q f64
}
pub type Hpf1Config = C.ma_hpf1_config
@[typedef]
struct C.ma_hpf2_config {
pub mut:
format Format
channels u32
sampleRate u32
cutoffFrequency f64
q f64
}
pub type Hpf2Config = C.ma_hpf2_config
// C: `MA_API ma_hpf1_config ma_hpf1_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency)`
fn C.ma_hpf1_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64) Hpf1Config
// hpf1_config_init is currently undocumented
pub fn hpf1_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64) Hpf1Config {
return C.ma_hpf1_config_init(format, channels, sample_rate, cutoff_frequency)
}
// C: `MA_API ma_hpf2_config ma_hpf2_config_init(ma_format format, ma_uint32 channels, ma_uint32 sampleRate, double cutoffFrequency, double q)`
fn C.ma_hpf2_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64, q f64) Hpf2Config
// hpf2_config_init is currently undocumented
pub fn hpf2_config_init(format Format, channels u32, sample_rate u32, cutoff_frequency f64, q f64) Hpf2Config {
return C.ma_hpf2_config_init(format, channels, sample_rate, cutoff_frequency, q)
}
@[typedef]
struct C.ma_hpf1 {
pub mut:
format Format
channels u32
a BiquadCoefficient
pR1 &BiquadCoefficient = unsafe { nil } // Memory management.
_pHeap voidptr
_ownsHeap u32
}
pub type Hpf1 = C.ma_hpf1
// C: `MA_API ma_result ma_hpf1_get_heap_size(const ma_hpf1_config* pConfig, size_t* pHeapSizeInBytes)`
fn C.ma_hpf1_get_heap_size(const_p_config &Hpf1Config, p_heap_size_in_bytes &usize) Result
// hpf1_get_heap_size is currently undocumented
pub fn hpf1_get_heap_size(const_p_config &Hpf1Config, p_heap_size_in_bytes &usize) Result {
return C.ma_hpf1_get_heap_size(const_p_config, p_heap_size_in_bytes)
}
// C: `MA_API ma_result ma_hpf1_init_preallocated(const ma_hpf1_config* pConfig, void* pHeap, ma_hpf1* pLPF)`
fn C.ma_hpf1_init_preallocated(const_p_config &Hpf1Config, p_heap voidptr, p_lpf &Hpf1) Result
// hpf1_init_preallocated is currently undocumented
pub fn hpf1_init_preallocated(const_p_config &Hpf1Config, p_heap voidptr, p_lpf &Hpf1) Result {
return C.ma_hpf1_init_preallocated(const_p_config, p_heap, p_lpf)
}