-
Notifications
You must be signed in to change notification settings - Fork 0
/
soloud.cs
2758 lines (2303 loc) · 136 KB
/
soloud.cs
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
// SoLoud wrapper for C# (cs)
// This file is autogenerated; any changes will be overwritten
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace SoLoud {
public class SoloudObject {
public IntPtr objhandle;
}
public class Soloud : SoloudObject {
public const int AUTO = 0;
public const int SDL1 = 1;
public const int SDL2 = 2;
public const int PORTAUDIO = 3;
public const int WINMM = 4;
public const int XAUDIO2 = 5;
public const int WASAPI = 6;
public const int ALSA = 7;
public const int JACK = 8;
public const int OSS = 9;
public const int OPENAL = 10;
public const int COREAUDIO = 11;
public const int OPENSLES = 12;
public const int VITA_HOMEBREW = 13;
public const int MINIAUDIO = 14;
public const int NOSOUND = 15;
public const int NULLDRIVER = 16;
public const int BACKEND_MAX = 17;
public const int CLIP_ROUNDOFF = 1;
public const int ENABLE_VISUALIZATION = 2;
public const int LEFT_HANDED_3D = 4;
public const int NO_FPU_REGISTER_CHANGE = 8;
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Soloud_create();
public Soloud() {
objhandle = Soloud_create();
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Soloud_destroy(IntPtr aObjHandle);
~Soloud() {
Soloud_destroy(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_initEx(IntPtr aObjHandle, uint aFlags, uint aBackend, uint aSamplerate, uint aBufferSize, uint aChannels);
public int init(uint aFlags = CLIP_ROUNDOFF, uint aBackend = AUTO, uint aSamplerate = AUTO, uint aBufferSize = AUTO, uint aChannels = 2) {
return Soloud_initEx(objhandle, aFlags, aBackend, aSamplerate, aBufferSize, aChannels);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_deinit(IntPtr aObjHandle);
public void deinit() {
Soloud_deinit(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getVersion(IntPtr aObjHandle);
public uint getVersion() {
return Soloud_getVersion(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Soloud_getErrorString(IntPtr aObjHandle, int aErrorCode);
public string getErrorString(int aErrorCode) {
IntPtr p = Soloud_getErrorString(objhandle, aErrorCode);
return Marshal.PtrToStringAnsi(p);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getBackendId(IntPtr aObjHandle);
public uint getBackendId() {
return Soloud_getBackendId(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Soloud_getBackendString(IntPtr aObjHandle);
public string getBackendString() {
IntPtr p = Soloud_getBackendString(objhandle);
return Marshal.PtrToStringAnsi(p);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getBackendChannels(IntPtr aObjHandle);
public uint getBackendChannels() {
return Soloud_getBackendChannels(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getBackendSamplerate(IntPtr aObjHandle);
public uint getBackendSamplerate() {
return Soloud_getBackendSamplerate(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getBackendBufferSize(IntPtr aObjHandle);
public uint getBackendBufferSize() {
return Soloud_getBackendBufferSize(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_setSpeakerPosition(IntPtr aObjHandle, uint aChannel, float aX, float aY, float aZ);
public int setSpeakerPosition(uint aChannel, float aX, float aY, float aZ) {
return Soloud_setSpeakerPosition(objhandle, aChannel, aX, aY, aZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_getSpeakerPosition(IntPtr aObjHandle, uint aChannel, float[] aX, float[] aY, float[] aZ);
public int getSpeakerPosition(uint aChannel, float[] aX, float[] aY, float[] aZ) {
return Soloud_getSpeakerPosition(objhandle, aChannel, aX, aY, aZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_playEx(IntPtr aObjHandle, IntPtr aSound, float aVolume, float aPan, int aPaused, uint aBus);
public uint play(SoloudObject aSound, float aVolume = -1.0f, float aPan = 0.0f, int aPaused = 0, uint aBus = 0) {
return Soloud_playEx(objhandle, aSound.objhandle, aVolume, aPan, aPaused, aBus);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_playClockedEx(IntPtr aObjHandle, double aSoundTime, IntPtr aSound, float aVolume, float aPan, uint aBus);
public uint playClocked(double aSoundTime, SoloudObject aSound, float aVolume = -1.0f, float aPan = 0.0f, uint aBus = 0) {
return Soloud_playClockedEx(objhandle, aSoundTime, aSound.objhandle, aVolume, aPan, aBus);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_play3dEx(IntPtr aObjHandle, IntPtr aSound, float aPosX, float aPosY, float aPosZ, float aVelX, float aVelY, float aVelZ, float aVolume, int aPaused, uint aBus);
public uint play3d(SoloudObject aSound, float aPosX, float aPosY, float aPosZ, float aVelX = 0.0f, float aVelY = 0.0f, float aVelZ = 0.0f, float aVolume = 1.0f, int aPaused = 0, uint aBus = 0) {
return Soloud_play3dEx(objhandle, aSound.objhandle, aPosX, aPosY, aPosZ, aVelX, aVelY, aVelZ, aVolume, aPaused, aBus);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_play3dClockedEx(IntPtr aObjHandle, double aSoundTime, IntPtr aSound, float aPosX, float aPosY, float aPosZ, float aVelX, float aVelY, float aVelZ, float aVolume, uint aBus);
public uint play3dClocked(double aSoundTime, SoloudObject aSound, float aPosX, float aPosY, float aPosZ, float aVelX = 0.0f, float aVelY = 0.0f, float aVelZ = 0.0f, float aVolume = 1.0f, uint aBus = 0) {
return Soloud_play3dClockedEx(objhandle, aSoundTime, aSound.objhandle, aPosX, aPosY, aPosZ, aVelX, aVelY, aVelZ, aVolume, aBus);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_playBackgroundEx(IntPtr aObjHandle, IntPtr aSound, float aVolume, int aPaused, uint aBus);
public uint playBackground(SoloudObject aSound, float aVolume = -1.0f, int aPaused = 0, uint aBus = 0) {
return Soloud_playBackgroundEx(objhandle, aSound.objhandle, aVolume, aPaused, aBus);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_seek(IntPtr aObjHandle, uint aVoiceHandle, double aSeconds);
public int seek(uint aVoiceHandle, double aSeconds) {
return Soloud_seek(objhandle, aVoiceHandle, aSeconds);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_stop(IntPtr aObjHandle, uint aVoiceHandle);
public void stop(uint aVoiceHandle) {
Soloud_stop(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_stopAll(IntPtr aObjHandle);
public void stopAll() {
Soloud_stopAll(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_stopAudioSource(IntPtr aObjHandle, IntPtr aSound);
public void stopAudioSource(SoloudObject aSound) {
Soloud_stopAudioSource(objhandle, aSound.objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_countAudioSource(IntPtr aObjHandle, IntPtr aSound);
public int countAudioSource(SoloudObject aSound) {
return Soloud_countAudioSource(objhandle, aSound.objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setFilterParameter(IntPtr aObjHandle, uint aVoiceHandle, uint aFilterId, uint aAttributeId, float aValue);
public void setFilterParameter(uint aVoiceHandle, uint aFilterId, uint aAttributeId, float aValue) {
Soloud_setFilterParameter(objhandle, aVoiceHandle, aFilterId, aAttributeId, aValue);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getFilterParameter(IntPtr aObjHandle, uint aVoiceHandle, uint aFilterId, uint aAttributeId);
public float getFilterParameter(uint aVoiceHandle, uint aFilterId, uint aAttributeId) {
return Soloud_getFilterParameter(objhandle, aVoiceHandle, aFilterId, aAttributeId);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_fadeFilterParameter(IntPtr aObjHandle, uint aVoiceHandle, uint aFilterId, uint aAttributeId, float aTo, double aTime);
public void fadeFilterParameter(uint aVoiceHandle, uint aFilterId, uint aAttributeId, float aTo, double aTime) {
Soloud_fadeFilterParameter(objhandle, aVoiceHandle, aFilterId, aAttributeId, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_oscillateFilterParameter(IntPtr aObjHandle, uint aVoiceHandle, uint aFilterId, uint aAttributeId, float aFrom, float aTo, double aTime);
public void oscillateFilterParameter(uint aVoiceHandle, uint aFilterId, uint aAttributeId, float aFrom, float aTo, double aTime) {
Soloud_oscillateFilterParameter(objhandle, aVoiceHandle, aFilterId, aAttributeId, aFrom, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern double Soloud_getStreamTime(IntPtr aObjHandle, uint aVoiceHandle);
public double getStreamTime(uint aVoiceHandle) {
return Soloud_getStreamTime(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern double Soloud_getStreamPosition(IntPtr aObjHandle, uint aVoiceHandle);
public double getStreamPosition(uint aVoiceHandle) {
return Soloud_getStreamPosition(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_getPause(IntPtr aObjHandle, uint aVoiceHandle);
public int getPause(uint aVoiceHandle) {
return Soloud_getPause(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getVolume(IntPtr aObjHandle, uint aVoiceHandle);
public float getVolume(uint aVoiceHandle) {
return Soloud_getVolume(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getOverallVolume(IntPtr aObjHandle, uint aVoiceHandle);
public float getOverallVolume(uint aVoiceHandle) {
return Soloud_getOverallVolume(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getPan(IntPtr aObjHandle, uint aVoiceHandle);
public float getPan(uint aVoiceHandle) {
return Soloud_getPan(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getSamplerate(IntPtr aObjHandle, uint aVoiceHandle);
public float getSamplerate(uint aVoiceHandle) {
return Soloud_getSamplerate(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_getProtectVoice(IntPtr aObjHandle, uint aVoiceHandle);
public int getProtectVoice(uint aVoiceHandle) {
return Soloud_getProtectVoice(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getActiveVoiceCount(IntPtr aObjHandle);
public uint getActiveVoiceCount() {
return Soloud_getActiveVoiceCount(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getVoiceCount(IntPtr aObjHandle);
public uint getVoiceCount() {
return Soloud_getVoiceCount(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_isValidVoiceHandle(IntPtr aObjHandle, uint aVoiceHandle);
public int isValidVoiceHandle(uint aVoiceHandle) {
return Soloud_isValidVoiceHandle(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getRelativePlaySpeed(IntPtr aObjHandle, uint aVoiceHandle);
public float getRelativePlaySpeed(uint aVoiceHandle) {
return Soloud_getRelativePlaySpeed(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getPostClipScaler(IntPtr aObjHandle);
public float getPostClipScaler() {
return Soloud_getPostClipScaler(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getGlobalVolume(IntPtr aObjHandle);
public float getGlobalVolume() {
return Soloud_getGlobalVolume(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getMaxActiveVoiceCount(IntPtr aObjHandle);
public uint getMaxActiveVoiceCount() {
return Soloud_getMaxActiveVoiceCount(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_getLooping(IntPtr aObjHandle, uint aVoiceHandle);
public int getLooping(uint aVoiceHandle) {
return Soloud_getLooping(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern double Soloud_getLoopPoint(IntPtr aObjHandle, uint aVoiceHandle);
public double getLoopPoint(uint aVoiceHandle) {
return Soloud_getLoopPoint(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setLoopPoint(IntPtr aObjHandle, uint aVoiceHandle, double aLoopPoint);
public void setLoopPoint(uint aVoiceHandle, double aLoopPoint) {
Soloud_setLoopPoint(objhandle, aVoiceHandle, aLoopPoint);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setLooping(IntPtr aObjHandle, uint aVoiceHandle, int aLooping);
public void setLooping(uint aVoiceHandle, int aLooping) {
Soloud_setLooping(objhandle, aVoiceHandle, aLooping);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_setMaxActiveVoiceCount(IntPtr aObjHandle, uint aVoiceCount);
public int setMaxActiveVoiceCount(uint aVoiceCount) {
return Soloud_setMaxActiveVoiceCount(objhandle, aVoiceCount);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setInaudibleBehavior(IntPtr aObjHandle, uint aVoiceHandle, int aMustTick, int aKill);
public void setInaudibleBehavior(uint aVoiceHandle, int aMustTick, int aKill) {
Soloud_setInaudibleBehavior(objhandle, aVoiceHandle, aMustTick, aKill);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setGlobalVolume(IntPtr aObjHandle, float aVolume);
public void setGlobalVolume(float aVolume) {
Soloud_setGlobalVolume(objhandle, aVolume);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setPostClipScaler(IntPtr aObjHandle, float aScaler);
public void setPostClipScaler(float aScaler) {
Soloud_setPostClipScaler(objhandle, aScaler);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setPause(IntPtr aObjHandle, uint aVoiceHandle, int aPause);
public void setPause(uint aVoiceHandle, int aPause) {
Soloud_setPause(objhandle, aVoiceHandle, aPause);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setPauseAll(IntPtr aObjHandle, int aPause);
public void setPauseAll(int aPause) {
Soloud_setPauseAll(objhandle, aPause);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_setRelativePlaySpeed(IntPtr aObjHandle, uint aVoiceHandle, float aSpeed);
public int setRelativePlaySpeed(uint aVoiceHandle, float aSpeed) {
return Soloud_setRelativePlaySpeed(objhandle, aVoiceHandle, aSpeed);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setProtectVoice(IntPtr aObjHandle, uint aVoiceHandle, int aProtect);
public void setProtectVoice(uint aVoiceHandle, int aProtect) {
Soloud_setProtectVoice(objhandle, aVoiceHandle, aProtect);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setSamplerate(IntPtr aObjHandle, uint aVoiceHandle, float aSamplerate);
public void setSamplerate(uint aVoiceHandle, float aSamplerate) {
Soloud_setSamplerate(objhandle, aVoiceHandle, aSamplerate);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setPan(IntPtr aObjHandle, uint aVoiceHandle, float aPan);
public void setPan(uint aVoiceHandle, float aPan) {
Soloud_setPan(objhandle, aVoiceHandle, aPan);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setPanAbsoluteEx(IntPtr aObjHandle, uint aVoiceHandle, float aLVolume, float aRVolume, float aLBVolume, float aRBVolume, float aCVolume, float aSVolume);
public void setPanAbsolute(uint aVoiceHandle, float aLVolume, float aRVolume, float aLBVolume = 0, float aRBVolume = 0, float aCVolume = 0, float aSVolume = 0) {
Soloud_setPanAbsoluteEx(objhandle, aVoiceHandle, aLVolume, aRVolume, aLBVolume, aRBVolume, aCVolume, aSVolume);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setVolume(IntPtr aObjHandle, uint aVoiceHandle, float aVolume);
public void setVolume(uint aVoiceHandle, float aVolume) {
Soloud_setVolume(objhandle, aVoiceHandle, aVolume);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setDelaySamples(IntPtr aObjHandle, uint aVoiceHandle, uint aSamples);
public void setDelaySamples(uint aVoiceHandle, uint aSamples) {
Soloud_setDelaySamples(objhandle, aVoiceHandle, aSamples);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_fadeVolume(IntPtr aObjHandle, uint aVoiceHandle, float aTo, double aTime);
public void fadeVolume(uint aVoiceHandle, float aTo, double aTime) {
Soloud_fadeVolume(objhandle, aVoiceHandle, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_fadePan(IntPtr aObjHandle, uint aVoiceHandle, float aTo, double aTime);
public void fadePan(uint aVoiceHandle, float aTo, double aTime) {
Soloud_fadePan(objhandle, aVoiceHandle, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_fadeRelativePlaySpeed(IntPtr aObjHandle, uint aVoiceHandle, float aTo, double aTime);
public void fadeRelativePlaySpeed(uint aVoiceHandle, float aTo, double aTime) {
Soloud_fadeRelativePlaySpeed(objhandle, aVoiceHandle, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_fadeGlobalVolume(IntPtr aObjHandle, float aTo, double aTime);
public void fadeGlobalVolume(float aTo, double aTime) {
Soloud_fadeGlobalVolume(objhandle, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_schedulePause(IntPtr aObjHandle, uint aVoiceHandle, double aTime);
public void schedulePause(uint aVoiceHandle, double aTime) {
Soloud_schedulePause(objhandle, aVoiceHandle, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_scheduleStop(IntPtr aObjHandle, uint aVoiceHandle, double aTime);
public void scheduleStop(uint aVoiceHandle, double aTime) {
Soloud_scheduleStop(objhandle, aVoiceHandle, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_oscillateVolume(IntPtr aObjHandle, uint aVoiceHandle, float aFrom, float aTo, double aTime);
public void oscillateVolume(uint aVoiceHandle, float aFrom, float aTo, double aTime) {
Soloud_oscillateVolume(objhandle, aVoiceHandle, aFrom, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_oscillatePan(IntPtr aObjHandle, uint aVoiceHandle, float aFrom, float aTo, double aTime);
public void oscillatePan(uint aVoiceHandle, float aFrom, float aTo, double aTime) {
Soloud_oscillatePan(objhandle, aVoiceHandle, aFrom, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_oscillateRelativePlaySpeed(IntPtr aObjHandle, uint aVoiceHandle, float aFrom, float aTo, double aTime);
public void oscillateRelativePlaySpeed(uint aVoiceHandle, float aFrom, float aTo, double aTime) {
Soloud_oscillateRelativePlaySpeed(objhandle, aVoiceHandle, aFrom, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_oscillateGlobalVolume(IntPtr aObjHandle, float aFrom, float aTo, double aTime);
public void oscillateGlobalVolume(float aFrom, float aTo, double aTime) {
Soloud_oscillateGlobalVolume(objhandle, aFrom, aTo, aTime);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setGlobalFilter(IntPtr aObjHandle, uint aFilterId, IntPtr aFilter);
public void setGlobalFilter(uint aFilterId, SoloudObject aFilter) {
Soloud_setGlobalFilter(objhandle, aFilterId, aFilter.objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_setVisualizationEnable(IntPtr aObjHandle, int aEnable);
public void setVisualizationEnable(int aEnable) {
Soloud_setVisualizationEnable(objhandle, aEnable);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Soloud_calcFFT(IntPtr aObjHandle);
public float[] calcFFT() {
float[] ret = new float[256];
IntPtr p = Soloud_calcFFT(objhandle);
byte[] buffer = new byte[4];
for (int i = 0; i < ret.Length; ++i) {
int f_bits = Marshal.ReadInt32(p, i * 4);
buffer[0] = (byte)((f_bits >> 0) & 0xff);
buffer[1] = (byte)((f_bits >> 8) & 0xff);
buffer[2] = (byte)((f_bits >> 16) & 0xff);
buffer[3] = (byte)((f_bits >> 24) & 0xff);
ret[i] = BitConverter.ToSingle(buffer, 0);
}
return ret;
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Soloud_getWave(IntPtr aObjHandle);
public float[] getWave() {
float[] ret = new float[256];
IntPtr p = Soloud_getWave(objhandle);
byte[] buffer = new byte[4];
for (int i = 0; i < ret.Length; ++i) {
int f_bits = Marshal.ReadInt32(p, i * 4);
buffer[0] = (byte)((f_bits >> 0) & 0xff);
buffer[1] = (byte)((f_bits >> 8) & 0xff);
buffer[2] = (byte)((f_bits >> 16) & 0xff);
buffer[3] = (byte)((f_bits >> 24) & 0xff);
ret[i] = BitConverter.ToSingle(buffer, 0);
}
return ret;
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getApproximateVolume(IntPtr aObjHandle, uint aChannel);
public float getApproximateVolume(uint aChannel) {
return Soloud_getApproximateVolume(objhandle, aChannel);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_getLoopCount(IntPtr aObjHandle, uint aVoiceHandle);
public uint getLoopCount(uint aVoiceHandle) {
return Soloud_getLoopCount(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_getInfo(IntPtr aObjHandle, uint aVoiceHandle, uint aInfoKey);
public float getInfo(uint aVoiceHandle, uint aInfoKey) {
return Soloud_getInfo(objhandle, aVoiceHandle, aInfoKey);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Soloud_createVoiceGroup(IntPtr aObjHandle);
public uint createVoiceGroup() {
return Soloud_createVoiceGroup(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_destroyVoiceGroup(IntPtr aObjHandle, uint aVoiceGroupHandle);
public int destroyVoiceGroup(uint aVoiceGroupHandle) {
return Soloud_destroyVoiceGroup(objhandle, aVoiceGroupHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_addVoiceToGroup(IntPtr aObjHandle, uint aVoiceGroupHandle, uint aVoiceHandle);
public int addVoiceToGroup(uint aVoiceGroupHandle, uint aVoiceHandle) {
return Soloud_addVoiceToGroup(objhandle, aVoiceGroupHandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_isVoiceGroup(IntPtr aObjHandle, uint aVoiceGroupHandle);
public int isVoiceGroup(uint aVoiceGroupHandle) {
return Soloud_isVoiceGroup(objhandle, aVoiceGroupHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_isVoiceGroupEmpty(IntPtr aObjHandle, uint aVoiceGroupHandle);
public int isVoiceGroupEmpty(uint aVoiceGroupHandle) {
return Soloud_isVoiceGroupEmpty(objhandle, aVoiceGroupHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_update3dAudio(IntPtr aObjHandle);
public void update3dAudio() {
Soloud_update3dAudio(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Soloud_set3dSoundSpeed(IntPtr aObjHandle, float aSpeed);
public int set3dSoundSpeed(float aSpeed) {
return Soloud_set3dSoundSpeed(objhandle, aSpeed);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Soloud_get3dSoundSpeed(IntPtr aObjHandle);
public float get3dSoundSpeed() {
return Soloud_get3dSoundSpeed(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dListenerParametersEx(IntPtr aObjHandle, float aPosX, float aPosY, float aPosZ, float aAtX, float aAtY, float aAtZ, float aUpX, float aUpY, float aUpZ, float aVelocityX, float aVelocityY, float aVelocityZ);
public void set3dListenerParameters(float aPosX, float aPosY, float aPosZ, float aAtX, float aAtY, float aAtZ, float aUpX, float aUpY, float aUpZ, float aVelocityX = 0.0f, float aVelocityY = 0.0f, float aVelocityZ = 0.0f) {
Soloud_set3dListenerParametersEx(objhandle, aPosX, aPosY, aPosZ, aAtX, aAtY, aAtZ, aUpX, aUpY, aUpZ, aVelocityX, aVelocityY, aVelocityZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dListenerPosition(IntPtr aObjHandle, float aPosX, float aPosY, float aPosZ);
public void set3dListenerPosition(float aPosX, float aPosY, float aPosZ) {
Soloud_set3dListenerPosition(objhandle, aPosX, aPosY, aPosZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dListenerAt(IntPtr aObjHandle, float aAtX, float aAtY, float aAtZ);
public void set3dListenerAt(float aAtX, float aAtY, float aAtZ) {
Soloud_set3dListenerAt(objhandle, aAtX, aAtY, aAtZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dListenerUp(IntPtr aObjHandle, float aUpX, float aUpY, float aUpZ);
public void set3dListenerUp(float aUpX, float aUpY, float aUpZ) {
Soloud_set3dListenerUp(objhandle, aUpX, aUpY, aUpZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dListenerVelocity(IntPtr aObjHandle, float aVelocityX, float aVelocityY, float aVelocityZ);
public void set3dListenerVelocity(float aVelocityX, float aVelocityY, float aVelocityZ) {
Soloud_set3dListenerVelocity(objhandle, aVelocityX, aVelocityY, aVelocityZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dSourceParametersEx(IntPtr aObjHandle, uint aVoiceHandle, float aPosX, float aPosY, float aPosZ, float aVelocityX, float aVelocityY, float aVelocityZ);
public void set3dSourceParameters(uint aVoiceHandle, float aPosX, float aPosY, float aPosZ, float aVelocityX = 0.0f, float aVelocityY = 0.0f, float aVelocityZ = 0.0f) {
Soloud_set3dSourceParametersEx(objhandle, aVoiceHandle, aPosX, aPosY, aPosZ, aVelocityX, aVelocityY, aVelocityZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dSourcePosition(IntPtr aObjHandle, uint aVoiceHandle, float aPosX, float aPosY, float aPosZ);
public void set3dSourcePosition(uint aVoiceHandle, float aPosX, float aPosY, float aPosZ) {
Soloud_set3dSourcePosition(objhandle, aVoiceHandle, aPosX, aPosY, aPosZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dSourceVelocity(IntPtr aObjHandle, uint aVoiceHandle, float aVelocityX, float aVelocityY, float aVelocityZ);
public void set3dSourceVelocity(uint aVoiceHandle, float aVelocityX, float aVelocityY, float aVelocityZ) {
Soloud_set3dSourceVelocity(objhandle, aVoiceHandle, aVelocityX, aVelocityY, aVelocityZ);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dSourceMinMaxDistance(IntPtr aObjHandle, uint aVoiceHandle, float aMinDistance, float aMaxDistance);
public void set3dSourceMinMaxDistance(uint aVoiceHandle, float aMinDistance, float aMaxDistance) {
Soloud_set3dSourceMinMaxDistance(objhandle, aVoiceHandle, aMinDistance, aMaxDistance);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dSourceAttenuation(IntPtr aObjHandle, uint aVoiceHandle, uint aAttenuationModel, float aAttenuationRolloffFactor);
public void set3dSourceAttenuation(uint aVoiceHandle, uint aAttenuationModel, float aAttenuationRolloffFactor) {
Soloud_set3dSourceAttenuation(objhandle, aVoiceHandle, aAttenuationModel, aAttenuationRolloffFactor);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_set3dSourceDopplerFactor(IntPtr aObjHandle, uint aVoiceHandle, float aDopplerFactor);
public void set3dSourceDopplerFactor(uint aVoiceHandle, float aDopplerFactor) {
Soloud_set3dSourceDopplerFactor(objhandle, aVoiceHandle, aDopplerFactor);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_mix(IntPtr aObjHandle, float[] aBuffer, uint aSamples);
public void mix(float[] aBuffer, uint aSamples) {
Soloud_mix(objhandle, aBuffer, aSamples);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Soloud_mixSigned16(IntPtr aObjHandle, IntPtr aBuffer, uint aSamples);
public void mixSigned16(IntPtr aBuffer, uint aSamples) {
Soloud_mixSigned16(objhandle, aBuffer, aSamples);
}
}
public class BassboostFilter : SoloudObject {
public const int WET = 0;
public const int BOOST = 1;
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr BassboostFilter_create();
public BassboostFilter() {
objhandle = BassboostFilter_create();
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr BassboostFilter_destroy(IntPtr aObjHandle);
~BassboostFilter() {
BassboostFilter_destroy(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int BassboostFilter_getParamCount(IntPtr aObjHandle);
public int getParamCount() {
return BassboostFilter_getParamCount(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr BassboostFilter_getParamName(IntPtr aObjHandle, uint aParamIndex);
public string getParamName(uint aParamIndex) {
IntPtr p = BassboostFilter_getParamName(objhandle, aParamIndex);
return Marshal.PtrToStringAnsi(p);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint BassboostFilter_getParamType(IntPtr aObjHandle, uint aParamIndex);
public uint getParamType(uint aParamIndex) {
return BassboostFilter_getParamType(objhandle, aParamIndex);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float BassboostFilter_getParamMax(IntPtr aObjHandle, uint aParamIndex);
public float getParamMax(uint aParamIndex) {
return BassboostFilter_getParamMax(objhandle, aParamIndex);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float BassboostFilter_getParamMin(IntPtr aObjHandle, uint aParamIndex);
public float getParamMin(uint aParamIndex) {
return BassboostFilter_getParamMin(objhandle, aParamIndex);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int BassboostFilter_setParams(IntPtr aObjHandle, float aBoost);
public int setParams(float aBoost) {
return BassboostFilter_setParams(objhandle, aBoost);
}
}
public class BiquadResonantFilter : SoloudObject {
public const int LOWPASS = 0;
public const int HIGHPASS = 1;
public const int BANDPASS = 2;
public const int WET = 0;
public const int TYPE = 1;
public const int FREQUENCY = 2;
public const int RESONANCE = 3;
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr BiquadResonantFilter_create();
public BiquadResonantFilter() {
objhandle = BiquadResonantFilter_create();
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr BiquadResonantFilter_destroy(IntPtr aObjHandle);
~BiquadResonantFilter() {
BiquadResonantFilter_destroy(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int BiquadResonantFilter_getParamCount(IntPtr aObjHandle);
public int getParamCount() {
return BiquadResonantFilter_getParamCount(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr BiquadResonantFilter_getParamName(IntPtr aObjHandle, uint aParamIndex);
public string getParamName(uint aParamIndex) {
IntPtr p = BiquadResonantFilter_getParamName(objhandle, aParamIndex);
return Marshal.PtrToStringAnsi(p);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint BiquadResonantFilter_getParamType(IntPtr aObjHandle, uint aParamIndex);
public uint getParamType(uint aParamIndex) {
return BiquadResonantFilter_getParamType(objhandle, aParamIndex);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float BiquadResonantFilter_getParamMax(IntPtr aObjHandle, uint aParamIndex);
public float getParamMax(uint aParamIndex) {
return BiquadResonantFilter_getParamMax(objhandle, aParamIndex);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float BiquadResonantFilter_getParamMin(IntPtr aObjHandle, uint aParamIndex);
public float getParamMin(uint aParamIndex) {
return BiquadResonantFilter_getParamMin(objhandle, aParamIndex);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int BiquadResonantFilter_setParams(IntPtr aObjHandle, int aType, float aFrequency, float aResonance);
public int setParams(int aType, float aFrequency, float aResonance) {
return BiquadResonantFilter_setParams(objhandle, aType, aFrequency, aResonance);
}
}
public class Bus : SoloudObject {
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Bus_create();
public Bus() {
objhandle = Bus_create();
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Bus_destroy(IntPtr aObjHandle);
~Bus() {
Bus_destroy(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_setFilter(IntPtr aObjHandle, uint aFilterId, IntPtr aFilter);
public void setFilter(uint aFilterId, SoloudObject aFilter) {
Bus_setFilter(objhandle, aFilterId, aFilter.objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Bus_playEx(IntPtr aObjHandle, IntPtr aSound, float aVolume, float aPan, int aPaused);
public uint play(SoloudObject aSound, float aVolume = 1.0f, float aPan = 0.0f, int aPaused = 0) {
return Bus_playEx(objhandle, aSound.objhandle, aVolume, aPan, aPaused);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Bus_playClockedEx(IntPtr aObjHandle, double aSoundTime, IntPtr aSound, float aVolume, float aPan);
public uint playClocked(double aSoundTime, SoloudObject aSound, float aVolume = 1.0f, float aPan = 0.0f) {
return Bus_playClockedEx(objhandle, aSoundTime, aSound.objhandle, aVolume, aPan);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Bus_play3dEx(IntPtr aObjHandle, IntPtr aSound, float aPosX, float aPosY, float aPosZ, float aVelX, float aVelY, float aVelZ, float aVolume, int aPaused);
public uint play3d(SoloudObject aSound, float aPosX, float aPosY, float aPosZ, float aVelX = 0.0f, float aVelY = 0.0f, float aVelZ = 0.0f, float aVolume = 1.0f, int aPaused = 0) {
return Bus_play3dEx(objhandle, aSound.objhandle, aPosX, aPosY, aPosZ, aVelX, aVelY, aVelZ, aVolume, aPaused);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Bus_play3dClockedEx(IntPtr aObjHandle, double aSoundTime, IntPtr aSound, float aPosX, float aPosY, float aPosZ, float aVelX, float aVelY, float aVelZ, float aVolume);
public uint play3dClocked(double aSoundTime, SoloudObject aSound, float aPosX, float aPosY, float aPosZ, float aVelX = 0.0f, float aVelY = 0.0f, float aVelZ = 0.0f, float aVolume = 1.0f) {
return Bus_play3dClockedEx(objhandle, aSoundTime, aSound.objhandle, aPosX, aPosY, aPosZ, aVelX, aVelY, aVelZ, aVolume);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Bus_setChannels(IntPtr aObjHandle, uint aChannels);
public int setChannels(uint aChannels) {
return Bus_setChannels(objhandle, aChannels);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_setVisualizationEnable(IntPtr aObjHandle, int aEnable);
public void setVisualizationEnable(int aEnable) {
Bus_setVisualizationEnable(objhandle, aEnable);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_annexSound(IntPtr aObjHandle, uint aVoiceHandle);
public void annexSound(uint aVoiceHandle) {
Bus_annexSound(objhandle, aVoiceHandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Bus_calcFFT(IntPtr aObjHandle);
public float[] calcFFT() {
float[] ret = new float[256];
IntPtr p = Bus_calcFFT(objhandle);
byte[] buffer = new byte[4];
for (int i = 0; i < ret.Length; ++i) {
int f_bits = Marshal.ReadInt32(p, i * 4);
buffer[0] = (byte)((f_bits >> 0) & 0xff);
buffer[1] = (byte)((f_bits >> 8) & 0xff);
buffer[2] = (byte)((f_bits >> 16) & 0xff);
buffer[3] = (byte)((f_bits >> 24) & 0xff);
ret[i] = BitConverter.ToSingle(buffer, 0);
}
return ret;
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr Bus_getWave(IntPtr aObjHandle);
public float[] getWave() {
float[] ret = new float[256];
IntPtr p = Bus_getWave(objhandle);
byte[] buffer = new byte[4];
for (int i = 0; i < ret.Length; ++i) {
int f_bits = Marshal.ReadInt32(p, i * 4);
buffer[0] = (byte)((f_bits >> 0) & 0xff);
buffer[1] = (byte)((f_bits >> 8) & 0xff);
buffer[2] = (byte)((f_bits >> 16) & 0xff);
buffer[3] = (byte)((f_bits >> 24) & 0xff);
ret[i] = BitConverter.ToSingle(buffer, 0);
}
return ret;
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float Bus_getApproximateVolume(IntPtr aObjHandle, uint aChannel);
public float getApproximateVolume(uint aChannel) {
return Bus_getApproximateVolume(objhandle, aChannel);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint Bus_getActiveVoiceCount(IntPtr aObjHandle);
public uint getActiveVoiceCount() {
return Bus_getActiveVoiceCount(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_setVolume(IntPtr aObjHandle, float aVolume);
public void setVolume(float aVolume) {
Bus_setVolume(objhandle, aVolume);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_setLooping(IntPtr aObjHandle, int aLoop);
public void setLooping(int aLoop) {
Bus_setLooping(objhandle, aLoop);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_set3dMinMaxDistance(IntPtr aObjHandle, float aMinDistance, float aMaxDistance);
public void set3dMinMaxDistance(float aMinDistance, float aMaxDistance) {
Bus_set3dMinMaxDistance(objhandle, aMinDistance, aMaxDistance);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_set3dAttenuation(IntPtr aObjHandle, uint aAttenuationModel, float aAttenuationRolloffFactor);
public void set3dAttenuation(uint aAttenuationModel, float aAttenuationRolloffFactor) {
Bus_set3dAttenuation(objhandle, aAttenuationModel, aAttenuationRolloffFactor);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_set3dDopplerFactor(IntPtr aObjHandle, float aDopplerFactor);
public void set3dDopplerFactor(float aDopplerFactor) {
Bus_set3dDopplerFactor(objhandle, aDopplerFactor);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_set3dListenerRelative(IntPtr aObjHandle, int aListenerRelative);
public void set3dListenerRelative(int aListenerRelative) {
Bus_set3dListenerRelative(objhandle, aListenerRelative);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_set3dDistanceDelay(IntPtr aObjHandle, int aDistanceDelay);
public void set3dDistanceDelay(int aDistanceDelay) {
Bus_set3dDistanceDelay(objhandle, aDistanceDelay);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_set3dColliderEx(IntPtr aObjHandle, IntPtr aCollider, int aUserData);
public void set3dCollider(SoloudObject aCollider, int aUserData = 0) {
Bus_set3dColliderEx(objhandle, aCollider.objhandle, aUserData);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_set3dAttenuator(IntPtr aObjHandle, IntPtr aAttenuator);
public void set3dAttenuator(SoloudObject aAttenuator) {
Bus_set3dAttenuator(objhandle, aAttenuator.objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_setInaudibleBehavior(IntPtr aObjHandle, int aMustTick, int aKill);
public void setInaudibleBehavior(int aMustTick, int aKill) {
Bus_setInaudibleBehavior(objhandle, aMustTick, aKill);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_setLoopPoint(IntPtr aObjHandle, double aLoopPoint);
public void setLoopPoint(double aLoopPoint) {
Bus_setLoopPoint(objhandle, aLoopPoint);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern double Bus_getLoopPoint(IntPtr aObjHandle);
public double getLoopPoint() {
return Bus_getLoopPoint(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern void Bus_stop(IntPtr aObjHandle);
public void stop() {
Bus_stop(objhandle);
}
}
public class DCRemovalFilter : SoloudObject {
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr DCRemovalFilter_create();
public DCRemovalFilter() {
objhandle = DCRemovalFilter_create();
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr DCRemovalFilter_destroy(IntPtr aObjHandle);
~DCRemovalFilter() {
DCRemovalFilter_destroy(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int DCRemovalFilter_setParamsEx(IntPtr aObjHandle, float aLength);
public int setParams(float aLength = 0.1f) {
return DCRemovalFilter_setParamsEx(objhandle, aLength);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern int DCRemovalFilter_getParamCount(IntPtr aObjHandle);
public int getParamCount() {
return DCRemovalFilter_getParamCount(objhandle);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr DCRemovalFilter_getParamName(IntPtr aObjHandle, uint aParamIndex);
public string getParamName(uint aParamIndex) {
IntPtr p = DCRemovalFilter_getParamName(objhandle, aParamIndex);
return Marshal.PtrToStringAnsi(p);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern uint DCRemovalFilter_getParamType(IntPtr aObjHandle, uint aParamIndex);
public uint getParamType(uint aParamIndex) {
return DCRemovalFilter_getParamType(objhandle, aParamIndex);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float DCRemovalFilter_getParamMax(IntPtr aObjHandle, uint aParamIndex);
public float getParamMax(uint aParamIndex) {
return DCRemovalFilter_getParamMax(objhandle, aParamIndex);
}
[DllImport("soloud", CallingConvention = CallingConvention.Cdecl)]
internal static extern float DCRemovalFilter_getParamMin(IntPtr aObjHandle, uint aParamIndex);
public float getParamMin(uint aParamIndex) {
return DCRemovalFilter_getParamMin(objhandle, aParamIndex);
}