-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfmod.bas
891 lines (714 loc) · 58.1 KB
/
fmod.bas
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
Attribute VB_Name = "mFMod"
Option Explicit
'MODULE FE (FMOD EASY)
'added variables
Public mp3channel As Long
Public mp3stream As Long
Public modmodule As Long
'end of added variables
'
'FMOD VB6 Module
'
Public Const FMOD_VERSION = 3.6
'************
'* Enums
'************
'FSOUND_GetError
Public Enum FMOD_ERRORS
FMOD_ERR_NONE ' No errors
FMOD_ERR_BUSY ' Cannot call this command after FSOUND_Init. Call FSOUND_Close first.
FMOD_ERR_UNINITIALIZED ' This command failed because FSOUND_Init was not called
FMOD_ERR_INIT ' Error initializing output device.
FMOD_ERR_ALLOCATED ' Error initializing output device, but more specifically, the output device is already in use and cannot be reused.
FMOD_ERR_PLAY ' Playing the sound failed.
FMOD_ERR_OUTPUT_FORMAT ' Soundcard does not support the features needed for this soundsystem (16bit stereo output)
FMOD_ERR_COOPERATIVELEVEL ' Error setting cooperative level for hardware.
FMOD_ERR_CREATEBUFFER ' Error creating hardware sound buffer.
FMOD_ERR_FILE_NOTFOUND ' File not found
FMOD_ERR_FILE_FORMAT ' Unknown file format
FMOD_ERR_FILE_BAD ' Error loading file
FMOD_ERR_MEMORY ' Not enough memory
FMOD_ERR_VERSION ' The version number of this file format is not supported
FMOD_ERR_INVALID_PARAM ' An invalid parameter was passed to this function
FMOD_ERR_NO_EAX ' Tried to use an EAX command on a non EAX enabled channel or output.
FMOD_ERR_CHANNEL_ALLOC ' Failed to allocate a new channel
FMOD_ERR_RECORD ' Recording is not supported on this machine
FMOD_ERR_MEDIAPLAYER ' Required Mediaplayer codec is not installed
FMOD_ERR_CDDEVICE ' An error occured trying to open the specified CD device
End Enum
'FSOUND_SetOutput, FSOUND_GetOutput
Public Enum FSOUND_OUTPUTTYPES
FSOUND_OUTPUT_NOSOUND 'NoSound driver, all calls to this succeed but do nothing.
FSOUND_OUTPUT_WINMM 'Windows Multimedia driver.
FSOUND_OUTPUT_DSOUND 'DirectSound driver. You need this to get EAX2 or EAX3 support, or FX api support.
FSOUND_OUTPUT_A3D 'A3D driver. You need this to get geometry and EAX reverb support.
FSOUND_OUTPUT_OSS 'Linux/Unix OSS (Open Sound System) driver, i.e. the kernel sound drivers.
FSOUND_OUTPUT_ESD 'Linux/Unix ESD (Enlightment Sound Daemon) driver.
FSOUND_OUTPUT_ALSA 'Linux Alsa driver.
FSOUND_OUTPUT_ASIO ' Low latency ASIO driver
FSOUND_OUTPUT_XBOX ' Xbox driver
FSOUND_OUTPUT_PS2 ' PlayStation 2 driver
FSOUND_OUTPUT_MAC ' Mac SoundMager driver
End Enum
'FSOUND_SetMixer, FSOUND_GetMixer
Public Enum FSOUND_MIXERTYPES
FSOUND_MIXER_AUTODETECT ' CE/PS2 Only - Non interpolating/low quality mixer */
FSOUND_MIXER_BLENDMODE ' removed / obsolete.
FSOUND_MIXER_MMXP5 ' removed / obsolete.
FSOUND_MIXER_MMXP6 ' removed / obsolete.
FSOUND_MIXER_QUALITY_AUTODETECT ' All platforms - Autodetect the fastest quality mixer based on your cpu.
FSOUND_MIXER_QUALITY_FPU ' Win32/Linux only - Interpolating/volume ramping FPU mixer.
FSOUND_MIXER_QUALITY_MMXP5 ' Win32/Linux only - Interpolating/volume ramping FPU mixer.
FSOUND_MIXER_QUALITY_MMXP6 ' Win32/Linux only - Interpolating/volume ramping ppro+ MMX mixer.
FSOUND_MIXER_MONO ' CE/PS2 only - MONO non interpolating/low quality mixer. For speed
FSOUND_MIXER_QUALITY_MONO ' CE/PS2 only - MONO Interpolating mixer. For speed
End Enum
'FMUSIC_GetType
Public Enum FMUSIC_TYPES
FMUSIC_TYPE_NONE
FMUSIC_TYPE_MOD 'Protracker / Fasttracker
FMUSIC_TYPE_S3M 'ScreamTracker 3
FMUSIC_TYPE_XM 'FastTracker 2
FMUSIC_TYPE_IT 'Impulse Tracker.
FMUSIC_TYPE_MIDI 'MIDI file
End Enum
Public Enum FSOUND_DSP_PRIORITIES
FSOUND_DSP_DEFAULTPRIORITY_CLEARUNIT = 0 'DSP CLEAR unit - done first
FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT = 100 'DSP SFX unit - done second
FSOUND_DSP_DEFAULTPRIORITY_MUSICUNIT = 200 'DSP MUSIC unit - done third
FSOUND_DSP_DEFAULTPRIORITY_USER = 300 'User priority, use this as reference
FSOUND_DSP_DEFAULTPRIORITY_FFTUNIT = 900 'This reads data for FSOUND_DSP_GetSpectrum, so it comes after user units
FSOUND_DSP_DEFAULTPRIORITY_CLIPANDCOPYUNIT = 1000 'DSP CLIP AND COPY unit - last
End Enum
'FSOUND_DSP_Create, FSOUND_DSP_SetPriority
Public Enum FSOUND_CAPS
FSOUND_CAPS_HARDWARE = &H1 ' This driver supports hardware accelerated 3d sound.
FSOUND_CAPS_EAX2 = &H2 ' This driver supports EAX 2 reverb
FSOUND_CAPS_EAX3 = &H10 ' This driver supports EAX 3 reverb
End Enum
'FSOUND_MODES
Public Enum FSOUND_MODES
FSOUND_LOOP_OFF = 1 ' For non looping samples.
FSOUND_LOOP_NORMAL = 2 ' For forward looping samples.
FSOUND_LOOP_BIDI = 4 ' For bidirectional looping samples. (no effect if in hardware).
FSOUND_8BITS = 8 ' For 8 bit samples.
FSOUND_16BITS = 16 ' For 16 bit samples.
FSOUND_MONO = 32 ' For mono samples.
FSOUND_STEREO = 64 ' For stereo samples.
FSOUND_UNSIGNED = 128 ' For source data containing unsigned samples.
FSOUND_SIGNED = 256 ' For source data containing signed data.
FSOUND_DELTA = 512 ' For source data stored as delta values.
FSOUND_IT214 = 1024 ' For source data stored using IT214 compression.
FSOUND_IT215 = 2048 ' For source data stored using IT215 compression.
FSOUND_HW3D = 4096 ' Attempts to make samples use 3d hardware acceleration. (if the card supports it)
FSOUND_2D = 8192 ' Ignores any 3d processing. overrides FSOUND_HW3D. Located in software.
FSOUND_STREAMABLE = 16384 ' For realtime streamable samples. If you dont supply this sound may come out corrupted.
FSOUND_LOADMEMORY = 32768 ' For FSOUND_Sample_Load - name will be interpreted as a pointer to data
FSOUND_LOADRAW = 65536 ' For FSOUND_Sample_Load/FSOUND_Stream_Open - will ignore file format and treat as raw pcm.
FSOUND_MPEGACCURATE = 131072 ' For FSOUND_Stream_Open - scans MP2/MP3 (VBR also) for accurate FSOUND_Stream_GetLengthMs/FSOUND_Stream_SetTime.
FSOUND_FORCEMONO = 262144 ' For forcing stereo streams and samples to be mono - needed with FSOUND_HW3D - incurs speed hit
FSOUND_HW2D = 524288 ' 2d hardware sounds. allows hardware specific effects
FSOUND_ENABLEFX = 1048576 ' Allows DX8 FX to be played back on a sound. Requires DirectX 8 - Note these sounds cant be played more than once, or have a changing frequency
FSOUND_MPEGHALFRATE = 2097152 ' For FMODCE only - decodes mpeg streams using a lower quality decode, but faster execution
FSOUND_XADPCM = 4194304 ' For XBOX only - Describes a user sample that its contents are compressed as XADPCM
FSOUND_VAG = 8388608 ' For PS2 only - Describes a user sample that its contents are compressed as Sony VAG format.
FSOUND_NONBLOCKING = 16777216 ' For FSOUND_Stream_OpenFile - Causes stream to open in the background and not block the foreground app - stream plays only when ready.
FSOUND_NORMAL = FSOUND_16BITS Or FSOUND_SIGNED Or FSOUND_MONO
End Enum
'FSOUND_CD_SetPlayMode
Public Enum FSOUND_CDPLAYMODES
FSOUND_CD_PLAYCONTINUOUS 'Starts from the current track and plays to end of CD.
FSOUND_CD_PLAYONCE 'Plays the specified track then stops.
FSOUND_CD_PLAYLOOPED 'Plays the specified track looped, forever until stopped manually.
FSOUND_CD_PLAYRANDOM 'Plays tracks in random order
End Enum
'Miscellaneous values for FMOD functions.
'FSOUND_PlaySound, FSOUND_PlaySoundEx, FSOUND_Sample_Alloc, FSOUND_Sample_Load, FSOUND_SetPan
Public Enum FSOUND_CHANNELSAMPLEMODE
FSOUND_FREE = -1 ' definition for dynamically allocated channel or sample
FSOUND_UNMANAGED = -2 ' definition for allocating a sample that is NOT managed by fsound
FSOUND_ALL = -3 ' for a channel index or sample index, this flag affects ALL channels or samples available! Not supported by all functions.
FSOUND_STEREOPAN = -1 ' definition for full middle stereo volume on both channels
FSOUND_SYSTEMCHANNEL = -1000 ' special channel ID for channel based functions that want to alter the global FSOUND software mixing output channel
FSOUND_SYSTEMSAMPLE = -1000 ' special sample ID for all sample based functions that want to alter the global FSOUND software mixing output sample
End Enum
' FSOUND_Reverb_SetProperties, FSOUND_Reverb_GetProperties, FSOUND_REVERB_PROPERTYFLAGS
Public Type FSOUND_REVERB_PROPERTIES
' MIN MAX DEFAULT DESCRIPTION
Environment As Long ' 0 25 0 sets all listener properties
EnvSize As Single ' 1.0 100.0 7.5 environment size in meters
EnvDiffusion As Single ' 0.0 1.0 1.0 environment diffusion
Room As Long ' -10000 0 -1000 room effect level (at mid frequencies)
RoomHF As Long ' -10000 0 -100 relative room effect level at high frequencies
RoomLF As Long ' -10000 0 0 relative room effect level at low frequencies
DecayTime As Single ' 0.1 20.0 1.49 reverberation decay time at mid frequencies
DecayHFRatio As Single ' 0.1 2.0 0.83 high-frequency to mid-frequency decay time ratio
DecayLFRatio As Single ' 0.1 2.0 1.0 low-frequency to mid-frequency decay time ratio
Reflections As Long ' -10000 1000 -2602 early reflections level relative to room effect
ReflectionsDelay As Single ' 0.0 0.3 0.007 initial reflection delay time
ReflectionsPan(3) As Single ' 0,0,0 early reflections panning vector
Reverb As Long ' -1000 2000 200 late reverberation level relative to room effect
ReverbDelay As Single ' 0.0 0.1 0.011 late reverberation delay time relative to initial reflection
ReverbPan(3) As Single ' 0,0,0 late reverberation panning vector
EchoTime As Single ' .075 0.25 0.25 echo time
EchoDepth As Single ' 0.0 1.0 0.0 echo depth
ModulationTime As Single ' 0.04 4.0 0.25 modulation time
ModulationDepth As Single ' 0.0 1.0 0.0 modulation depth
AirAbsorptionHF As Single ' -100 0.0 -5.0 change in level per meter at high frequencies
HFReference As Single ' 1000.0 20000 5000.0 reference high frequency (hz)
LFReference As Single ' 20.0 1000.0 250.0 reference low frequency (hz)
RoomRolloffFactor As Single ' 0.0 10.0 0.0 like FSOUND_3D_Listener_SetRolloffFactor but for room effect
Diffusion As Single ' 0.0 100.0 100.0 Value that controls the echo density in the late reverberation decay. (xbox only)
Density As Single ' 0.0 100.0 100.0 Value that controls the modal density in the late reverberation decay (xbox only)
Flags As Long ' modifies the behavior of above properties
End Type
'Values for the Flags member of the FSOUND_REVERB_PROPERTIES structure.
Public Enum FSOUND_REVERB_PROPERTYFLAGS
FSOUND_REVERBFLAGS_DECAYTIMESCALE = &H1 ' EnvironmentSize affects reverberation decay time
FSOUND_REVERBFLAGS_REFLECTIONSSCALE = &H2 ' EnvironmentSize affects reflection level
FSOUND_REVERBFLAGS_REFLECTIONSDELAYSCALE = &H4 ' EnvironmentSize affects initial reflection delay time
FSOUND_REVERBFLAGS_REVERBSCALE = &H8 ' EnvironmentSize affects reflections level
FSOUND_REVERBFLAGS_REVERBDELAYSCALE = &H10 ' EnvironmentSize affects late reverberation delay time
FSOUND_REVERBFLAGS_DECAYHFLIMIT = &H20 ' AirAbsorptionHF affects DecayHFRatio
FSOUND_REVERBFLAGS_ECHOTIMESCALE = &H40 ' EnvironmentSize affects echo time
FSOUND_REVERBFLAGS_MODULATIONTIMESCALE = &H80 ' EnvironmentSize affects modulation time
FSOUND_REVERB_FLAGS_CORE0 = &H100 ' PS2 Only - Reverb is applied to CORE0 (hw voices 0-23)
FSOUND_REVERB_FLAGS_CORE1 = &H200 ' PS2 Only - Reverb is applied to CORE1 (hw voices 24-47)
FSOUND_REVERBFLAGS_DEFAULT = FSOUND_REVERBFLAGS_DECAYTIMESCALE Or FSOUND_REVERBFLAGS_REFLECTIONSSCALE Or FSOUND_REVERBFLAGS_REFLECTIONSDELAYSCALE Or FSOUND_REVERBFLAGS_REVERBSCALE Or FSOUND_REVERBFLAGS_REVERBDELAYSCALE Or FSOUND_REVERBFLAGS_DECAYHFLIMIT Or FSOUND_REVERB_FLAGS_CORE0 Or FSOUND_REVERB_FLAGS_CORE1
End Enum
' FSOUND_REVERB_PRESETS
' don't know how to set that in VB ?
' #define FSOUND_PRESET_GENERIC {0, 7.5f, 1.000f, -1000, -100, 0, 1.49f, 0.83f, 1.00f, -2602, 0.007f, 0.00f,0.00f,0.00f, 200, 0.011f, 0.00f,0.00f,0.00f, 0.250f, 0.000f, 0.250f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.00f, 0x3f }
'FSOUND_Reverb_SetEnvironment, FSOUND_Reverb_SetEnvironmentAdvanced
Public Type FSOUND_REVERB_CHANNELPROPERTIES
Direct As Long ' direct path level (at low and mid frequencies)
DirectHF As Long ' relative direct path level at high frequencies
Room As Long ' room effect level (at low and mid frequencies)
RoomHF As Long ' relative room effect level at high frequencies
Obstruction As Long ' main obstruction control (attenuation at high frequencies)
ObstructionLFRatio As Single ' obstruction low-frequency level re. main control
Occlusion As Long ' main occlusion control (attenuation at high frequencies)
OcclustionLFRatio As Single ' occlusion low-frequency level re. main control
OcclusionRoomRatio As Single ' relative occlusion control for room effect
OcclusionDirectRatio As Single ' relative occlusion control for direct path
Exclusion As Long ' main exlusion control (attenuation at high frequencies)
ExclusionLFRatio As Single ' exclusion low-frequency level re. main control
OutsideVolumeHF As Long ' outside sound cone level at high frequencies
DopplerFactor As Single ' like DS3D flDopplerFactor but per source
RolloffFactor As Single ' like DS3D flRolloffFactor but per source
RoomRolloffFactor As Single ' like DS3D flRolloffFactor but for room effect
AirAbsorptionFactor As Single ' multiplies AirAbsorptionHF member of FSOUND_REVERB_PROPERTIES
Flags As Long ' modifies the behavior of properties
End Type
Public Enum FSOUND_REVERB_CHANNELFLAGS
FSOUND_REVERB_CHANNELFLAGS_DIRECTHFAUTO = &H1 ' Automatic setting of Direct due to distance from listener
FSOUND_REVERB_CHANNELFLAGS_ROOMAUTO = &H2 ' Automatic setting of Room due to distance from listener
FSOUND_REVERB_CHANNELFLAGS_ROOMHFAUTO = &H4 ' Automatic setting of RoomHF due to distance from listener
FSOUND_REVERB_CHANNELFLAGS_DEFAULT = FSOUND_REVERB_CHANNELFLAGS_DIRECTHFAUTO Or FSOUND_REVERB_CHANNELFLAGS_ROOMAUTO Or FSOUND_REVERB_CHANNELFLAGS_ROOMHFAUTO
End Enum
'FSOUND_FX_MODES
Public Enum FSOUND_FX_MODES
FSOUND_FX_CHORUS
FSOUND_FX_COMPRESSOR
FSOUND_FX_DISTORTION
FSOUND_FX_ECHO
FSOUND_FX_FLANGER
FSOUND_FX_GARGLE
FSOUND_FX_I3DL2REVERB
FSOUND_FX_PARAMEQ
FSOUND_FX_WAVES_REVERB
End Enum
'FSOUND_SPEAKERMODES
'FSOUND_SetSpeakerMode
'These are speaker types defined for use with the FSOUND_SetSpeakerMode command.
'Note - Only reliably works with FSOUND_OUTPUT_DSOUND or FSOUND_OUTPUT_XBOX output modes. Other output modes will only
'interpret FSOUND_SPEAKERMODE_MONO and set everything else to be stereo.
'Using either DolbyDigital or DTS will use whatever 5.1 digital mode is available if destination hardware is unsure.
Public Enum FSOUND_SPEAKERMODES
FSOUND_SPEAKERMODE_DOLBYDIGITAL ' The audio is played through a speaker arrangement of surround speakers with a subwoofer.
FSOUND_SPEAKERMODE_HEADPHONE ' The speakers are headphones.
FSOUND_SPEAKERMODE_MONO ' The speakers are monaural.
FSOUND_SPEAKERMODE_QUAD ' The speakers are quadraphonic.
FSOUND_SPEAKERMODE_STEREO ' The speakers are stereo (default value).
FSOUND_SPEAKERMODE_SURROUND ' The speakers are surround sound.
FSOUND_SPEAKERMODE_DTS ' The audio is played through a speaker arrangement of surround speakers with a subwoofer.
End Enum
'************
'* DEFINES (Constants)
'************
Public Const FSOUND_INIT_USEDEFAULTMIDISYNTH = &H1 'Causes MIDI playback to force software decoding.
Public Const FSOUND_INIT_GLOBALFOCUS = &H2 'For DirectSound output - sound is not muted when window is out of focus.
Public Const FSOUND_INIT_ENABLEOUTPUTFX = &H4 'For DirectSound output - Allows FSOUND_FX api to be used on global software mixer output!
Public Const FSOUND_INIT_ACCURATEVULEVELS = &H8 'This latency adjusts FSOUND_GetCurrentLevels, but incurs a small cpu and memory hit
Public Const FSOUND_INIT_DISABLE_CORE0_REVERB = &H10 'PS2 only - Disable reverb on CORE 0 to regain SRAM
Public Const FSOUND_INIT_DISABLE_CORE1_REVERB = &H20 'PS2 only - Disable reverb on CORE 1 to regain SRAM
'/* ================================== */
'/* Initialization / Global functions. */
'/* ================================== */
' PRE - FSOUND_Init functions. These cant be called after FSOUND_Init is
' called (they will fail). They set up FMOD system functionality.
Public Declare Function FSOUND_SetOutput Lib "fmod.dll" Alias "_FSOUND_SetOutput@4" (ByVal outputtype As FSOUND_OUTPUTTYPES) As Byte
Public Declare Function FSOUND_SetDriver Lib "fmod.dll" Alias "_FSOUND_SetDriver@4" (ByVal driver As Long) As Byte
Public Declare Function FSOUND_SetMixer Lib "fmod.dll" Alias "_FSOUND_SetMixer@4" (ByVal mixer As FSOUND_MIXERTYPES) As Byte
Public Declare Function FSOUND_SetBufferSize Lib "fmod.dll" Alias "_FSOUND_SetBufferSize@4" (ByVal lenms As Long) As Byte
Public Declare Function FSOUND_SetHWND Lib "fmod.dll" Alias "_FSOUND_SetHWND@4" (ByVal hwnd As Long) As Byte
Public Declare Function FSOUND_SetMinHardwareChannels Lib "fmod.dll" Alias "_FSOUND_SetMinHardwareChannels@4" (ByVal min As Integer) As Byte
Public Declare Function FSOUND_SetMaxHardwareChannels Lib "fmod.dll" Alias "_FSOUND_SetMaxHardwareChannels@4" (ByVal min As Integer) As Byte
Public Declare Function FSOUND_SetMemorySystem Lib "fmod.dll" Alias "_FSOUND_SetMemorySystem@20" (ByVal pool As Long, ByVal poollen As Long, ByVal useralloc As Long, ByVal userrealloc As Long, ByVal userfree As Long) As Byte
' Main initialization / closedown functions.
' Note : Use FSOUND_INIT_USEDEFAULTMIDISYNTH with FSOUND_Init for software override
' with MIDI playback.
' : Use FSOUND_INIT_GLOBALFOCUS with FSOUND_Init to make sound audible no matter
' which window is in focus. (FSOUND_OUTPUT_DSOUND only)
Public Declare Function FSOUND_Init Lib "fmod.dll" Alias "_FSOUND_Init@12" (ByVal mixrate As Long, ByVal maxchannels As Long, ByVal Flags As Long) As Byte
Public Declare Function FSOUND_Close Lib "fmod.dll" Alias "_FSOUND_Close@0" () As Long
' Runtime system level functions
Public Declare Function FSOUND_SetSpeakerMode Lib "fmod.dll" Alias "_FSOUND_SetSpeakerMode@4" (ByVal speakermode As FSOUND_SPEAKERMODES) As Long
Public Declare Function FSOUND_SetSFXMasterVolume Lib "fmod.dll" Alias "_FSOUND_SetSFXMasterVolume@4" (ByVal volume As Long) As Long
Public Declare Function FSOUND_SetPanSeperation Lib "fmod.dll" Alias "_FSOUND_SetPanSeperation@4" (ByVal pansep As Single) As Long
Public Declare Function FSOUND_File_SetCallbacks Lib "fmod.dll" Alias "_FSOUND_File_SetCallbacks@20" (ByVal OpenCallback As Long, ByVal CloseCallback As Long, ByVal ReadCallback As Long, ByVal SeekCallback As Long, ByVal TellCallback As Long) As Long
' System information functions.
Public Declare Function FSOUND_GetError Lib "fmod.dll" Alias "_FSOUND_GetError@0" () As FMOD_ERRORS
Public Declare Function FSOUND_GetVersion Lib "fmod.dll" Alias "_FSOUND_GetVersion@0" () As Single
Public Declare Function FSOUND_GetOutput Lib "fmod.dll" Alias "_FSOUND_GetOutput@0" () As FSOUND_OUTPUTTYPES
Public Declare Function FSOUND_GetOutputHandle Lib "fmod.dll" Alias "_FSOUND_GetOutputHandle@0" () As Long
Public Declare Function FSOUND_GetDriver Lib "fmod.dll" Alias "_FSOUND_GetDriver@0" () As Long
Public Declare Function FSOUND_GetMixer Lib "fmod.dll" Alias "_FSOUND_GetMixer@0" () As FSOUND_MIXERTYPES
Public Declare Function FSOUND_GetNumDrivers Lib "fmod.dll" Alias "_FSOUND_GetNumDrivers@0" () As Long
Public Declare Function FSOUND_GetDriverName Lib "fmod.dll" Alias "_FSOUND_GetDriverName@4" (ByVal id As Long) As Long
Public Declare Function FSOUND_GetDriverCaps Lib "fmod.dll" Alias "_FSOUND_GetDriverCaps@8" (ByVal id As Long, ByRef caps As Long) As Byte
Public Declare Function FSOUND_GetOutputRate Lib "fmod.dll" Alias "_FSOUND_GetOutputRate@0" () As Long
Public Declare Function FSOUND_GetMaxChannels Lib "fmod.dll" Alias "_FSOUND_GetMaxChannels@0" () As Long
Public Declare Function FSOUND_GetMaxSamples Lib "fmod.dll" Alias "_FSOUND_GetMaxSamples@0" () As Long
Public Declare Function FSOUND_GetSFXMasterVolume Lib "fmod.dll" Alias "_FSOUND_GetSFXMasterVolume@0" () As Long
Public Declare Function FSOUND_GetNumHardwareChannels Lib "fmod.dll" Alias "_FSOUND_GetNumHardwareChannels@0" () As Long
Public Declare Function FSOUND_GetChannelsPlaying Lib "fmod.dll" Alias "_FSOUND_GetChannelsPlaying@0" () As Long
Public Declare Function FSOUND_GetCPUUsage Lib "fmod.dll" Alias "_FSOUND_GetCPUUsage@0" () As Single
Public Declare Sub FSOUND_GetMemoryStats Lib "fmod.dll" Alias "_FSOUND_GetCPUUsage@0" (ByRef currentalloced As Long, ByRef maxalloced As Long)
'/* =================================== */
'/* Sample management / load functions. */
'/* =================================== */
' Sample creation and management functions
' Note : Use FSOUND_LOADMEMORY flag with FSOUND_Sample_Load to load from memory.
' Use FSOUND_LOADRAW flag with FSOUND_Sample_Load to treat as as raw pcm data.
Public Declare Function FSOUND_Sample_Load Lib "fmod.dll" Alias "_FSOUND_Sample_Load@16" (ByVal Index As Long, ByVal name As String, ByVal mode As FSOUND_MODES, ByVal memlength As Long) As Long
Public Declare Function FSOUND_Sample_Alloc Lib "fmod.dll" Alias "_FSOUND_Sample_Alloc@28" (ByVal Index As Long, ByVal length As Long, ByVal mode As Long, ByVal deffreq As Long, ByVal defvol As Long, ByVal defpan As Long, ByVal defpri As Long) As Long
Public Declare Function FSOUND_Sample_Free Lib "fmod.dll" Alias "_FSOUND_Sample_Free@4" (ByVal sptr As Long) As Long
Public Declare Function FSOUND_Sample_Upload Lib "fmod.dll" Alias "_FSOUND_Sample_Upload@12" (ByVal sptr As Long, ByRef srcdata As Long, ByVal mode As Long) As Byte
Public Declare Function FSOUND_Sample_Lock Lib "fmod.dll" Alias "_FSOUND_Sample_Lock@28" (ByVal sptr As Long, ByVal offset As Long, ByVal length As Long, ByRef ptr1 As Long, ByRef ptr2 As Long, ByRef len1 As Long, ByRef len2 As Long) As Byte
Public Declare Function FSOUND_Sample_Unlock Lib "fmod.dll" Alias "_FSOUND_Sample_Unlock@20" (ByVal sptr As Long, ByVal sptr1 As Long, ByVal sptr2 As Long, ByVal len1 As Long, ByVal len2 As Long) As Byte
' Sample control functions
Public Declare Function FSOUND_Sample_SetMode Lib "fmod.dll" Alias "_FSOUND_Sample_SetMode@8" (ByVal sptr As Long, ByVal mode As FSOUND_MODES) As Byte
Public Declare Function FSOUND_Sample_SetLoopPoints Lib "fmod.dll" Alias "_FSOUND_Sample_SetLoopPoints@12" (ByVal sptr As Long, ByVal loopstart As Long, ByVal loopend As Long) As Byte
Public Declare Function FSOUND_Sample_SetDefaults Lib "fmod.dll" Alias "_FSOUND_Sample_SetDefaults@20" (ByVal sptr As Long, ByVal deffreq As Long, ByVal defvol As Long, ByVal defpan As Long, ByVal defpri As Long) As Byte
Public Declare Function FSOUND_Sample_SetMinMaxDistance Lib "fmod.dll" Alias "_FSOUND_Sample_SetMinMaxDistance@12" (ByVal sptr As Long, ByVal min As Single, ByVal max As Single) As Byte
Public Declare Function FSOUND_Sample_SetMaxPlaybacks Lib "fmod.dll" Alias "_FSOUND_Sample_SetMaxPlaybacks@8" (ByVal sptr As Long, ByVal max As Long) As Byte
'Sample information
Public Declare Function FSOUND_Sample_Get Lib "fmod.dll" Alias "_FSOUND_Sample_Get@4" (ByVal sampno As Long) As Long
Public Declare Function FSOUND_Sample_GetName Lib "fmod.dll" Alias "_FSOUND_Sample_GetName@4" (ByVal sptr As Long) As Long
Public Declare Function FSOUND_Sample_GetLength Lib "fmod.dll" Alias "_FSOUND_Sample_GetLength@4" (ByVal sptr As Long) As Long
Public Declare Function FSOUND_Sample_GetLoopPoints Lib "fmod.dll" Alias "_FSOUND_Sample_GetLoopPoints@12" (ByVal sptr As Long, ByRef loopstart As Long, ByRef loopend As Long) As Byte
Public Declare Function FSOUND_Sample_GetDefaults Lib "fmod.dll" Alias "_FSOUND_Sample_GetDefaults@20" (ByVal sptr As Long, ByRef deffreq As Long, ByRef defvol As Long, ByRef defpan As Long, ByRef defpri As Long) As Byte
Public Declare Function FSOUND_Sample_GetMode Lib "fmod.dll" Alias "_FSOUND_Sample_GetMode@4" (ByVal sptr As Long) As Long
'/* ============================ */
'/* Channel control functions. */
'/* ============================ */
' Playing and stopping sounds.
' Note : Use FSOUND_FREE as the channel variable, to let FMOD pick a free channel for you.
' Use FSOUND_ALL as the channel variable to control ALL channels with one function call!
Public Declare Function FSOUND_PlaySound Lib "fmod.dll" Alias "_FSOUND_PlaySound@8" (ByVal channel As Long, ByVal sptr As Long) As Long
Public Declare Function FSOUND_PlaySoundEx Lib "fmod.dll" Alias "_FSOUND_PlaySoundEx@16" (ByVal channel As Long, ByVal sptr As Long, ByVal dsp As Long, ByVal startpaused As Byte) As Long
Public Declare Function FSOUND_StopSound Lib "fmod.dll" Alias "_FSOUND_StopSound@4" (ByVal channel As Long) As Byte
' Functions to control playback of a channel.
' Note : FSOUND_ALL can be used on most of these functions as a channel value.
Public Declare Function FSOUND_SetFrequency Lib "fmod.dll" Alias "_FSOUND_SetFrequency@8" (ByVal channel As Long, ByVal freq As Long) As Byte
Public Declare Function FSOUND_SetVolume Lib "fmod.dll" Alias "_FSOUND_SetVolume@8" (ByVal channel As Long, ByVal Vol As Long) As Byte
Public Declare Function FSOUND_SetVolumeAbsolute Lib "fmod.dll" Alias "_FSOUND_SetVolumeAbsolute@8" (ByVal channel As Long, ByVal Vol As Long) As Byte
Public Declare Function FSOUND_SetPan Lib "fmod.dll" Alias "_FSOUND_SetPan@8" (ByVal channel As Long, ByVal pan As Long) As Byte
Public Declare Function FSOUND_SetSurround Lib "fmod.dll" Alias "_FSOUND_SetSurround@8" (ByVal channel As Long, ByVal surround As Long) As Byte
Public Declare Function FSOUND_SetMute Lib "fmod.dll" Alias "_FSOUND_SetMute@8" (ByVal channel As Long, ByVal mute As Byte) As Byte
Public Declare Function FSOUND_SetPriority Lib "fmod.dll" Alias "_FSOUND_SetPriority@8" (ByVal channel As Long, ByVal Priority As Long) As Byte
Public Declare Function FSOUND_SetReserved Lib "fmod.dll" Alias "_FSOUND_SetReserved@8" (ByVal channel As Long, ByVal reserved As Long) As Byte
Public Declare Function FSOUND_SetPaused Lib "fmod.dll" Alias "_FSOUND_SetPaused@8" (ByVal channel As Long, ByVal Paused As Byte) As Byte
Public Declare Function FSOUND_SetLoopMode Lib "fmod.dll" Alias "_FSOUND_SetLoopMode@8" (ByVal channel As Long, ByVal loopmode As Long) As Byte
Public Declare Function FSOUND_SetCurrentPosition Lib "fmod.dll" Alias "_FSOUND_SetCurrentPosition@8" (ByVal channel As Long, ByVal offset As Long) As Byte
'_FSOUND_StopSound@4
' Channel information functions.
Public Declare Function FSOUND_IsPlaying Lib "fmod.dll" Alias "_FSOUND_IsPlaying@4" (ByVal channel As Long) As Byte
Public Declare Function FSOUND_GetFrequency Lib "fmod.dll" Alias "_FSOUND_GetFrequency@4" (ByVal channel As Long) As Long
Public Declare Function FSOUND_GetVolume Lib "fmod.dll" Alias "_FSOUND_GetVolume@4" (ByVal channel As Long) As Long
Public Declare Function FSOUND_GetPan Lib "fmod.dll" Alias "_FSOUND_GetPan@4" (ByVal channel As Long) As Long
Public Declare Function FSOUND_GetSurround Lib "fmod.dll" Alias "_FSOUND_GetSurround@4" (ByVal channel As Long) As Byte
Public Declare Function FSOUND_GetMute Lib "fmod.dll" Alias "_FSOUND_GetMute@4" (ByVal channel As Long) As Byte
Public Declare Function FSOUND_GetPriority Lib "fmod.dll" Alias "_FSOUND_GetPriority@4" (ByVal channel As Long) As Long
Public Declare Function FSOUND_GetReserved Lib "fmod.dll" Alias "_FSOUND_GetReserved@4" (ByVal channel As Long) As Byte
Public Declare Function FSOUND_GetPaused Lib "fmod.dll" Alias "_FSOUND_GetPaused@4" (ByVal channel As Long) As Byte
Public Declare Function FSOUND_GetLoopMode Lib "fmod.dll" Alias "_FSOUND_GetLoopMode@4" (ByVal channel As Long) As Long
Public Declare Function FSOUND_GetCurrentPosition Lib "fmod.dll" Alias "_FSOUND_GetCurrentPosition@4" (ByVal channel As Long) As Long
Public Declare Function FSOUND_GetCurrentSample Lib "fmod.dll" Alias "_FSOUND_GetCurrentSample@4" (ByVal channel As Long) As Long
Public Declare Function FSOUND_GetCurrentLevels Lib "fmod.dll" Alias "_FSOUND_GetCurrentLevels@12" (ByVal channel As Long, ByRef l As Single, ByRef r As Single) As Byte
'/* =================== */
'/* FX functions. */
'/* =================== */
' Functions to control DX8 only effects processing.
'
' - FX enabled samples can only be played once at a time, not multiple times at once.
' - Sounds have to be created with FSOUND_HW2D or FSOUND_HW3D for this to work.
' - FSOUND_INIT_ENABLEOUTPUTFX can be used to apply hardware effect processing to the
' global mixed output of FMODs software channels.
' - FSOUND_FX_Enable returns an FX handle that you can use to alter fx parameters.
' - FSOUND_FX_Enable can be called multiple times in a row, even on the same FX type,
' it will return a unique handle for each FX.
' - FSOUND_FX_Enable cannot be called if the sound is playing or locked.
' - FSOUND_FX_Disable must be called to reset/clear the FX from a channel.
Public Declare Function FSOUND_FX_Enable Lib "fmod.dll" Alias "_FSOUND_FX_Enable@8" (ByVal channel As Long, ByVal fx As FSOUND_FX_MODES) As Long
Public Declare Function FSOUND_FX_Disable Lib "fmod.dll" Alias "_FSOUND_FX_Disable@4" (ByVal channel As Long) As Byte
Public Declare Function FSOUND_FX_SetChorus Lib "fmod.dll" Alias "_FSOUND_FX_SetChorus@32" (ByVal fxid As Long, ByVal WetDryMix As Single, ByVal Depth As Single, ByVal Feedback As Single, ByVal Frequency As Single, ByVal Waveform As Long, ByVal Delay As Single, ByVal Phase As Long) As Byte
Public Declare Function FSOUND_FX_SetCompressor Lib "fmod.dll" Alias "_FSOUND_FX_SetCompressor@28" (ByVal fxid As Long, ByVal Gain As Single, ByVal Attack As Single, ByVal Release As Single, ByVal Threshold As Single, ByVal Ratio As Single, ByVal Predelay As Single) As Byte
Public Declare Function FSOUND_FX_SetDistortion Lib "fmod.dll" Alias "_FSOUND_FX_SetDistortion@24" (ByVal fxid As Long, ByVal Gain As Single, ByVal Edge As Single, ByVal PostEQCenterFrequency As Single, ByVal PostEQBandwidth As Single, ByVal PreLowpassCutoff As Single) As Byte
Public Declare Function FSOUND_FX_SetEcho Lib "fmod.dll" Alias "_FSOUND_FX_SetEcho@24" (ByVal fxid As Long, ByVal WetDryMix As Single, ByVal Feedback As Single, ByVal LeftDelay As Single, ByVal RightDelay As Single, ByVal PanDelay As Long) As Byte
Public Declare Function FSOUND_FX_SetFlanger Lib "fmod.dll" Alias "_FSOUND_FX_SetFlanger@32" (ByVal fxid As Long, ByVal WetDryMix As Single, ByVal Depth As Single, ByVal Feedback As Single, ByVal Frequency As Single, ByVal Waveform As Long, ByVal Delay As Single, ByVal Phase As Long) As Byte
Public Declare Function FSOUND_FX_SetGargle Lib "fmod.dll" Alias "_FSOUND_FX_SetGargle@12" (ByVal fxid As Long, ByVal RateHz As Long, ByVal WaveShape As Long) As Byte
Public Declare Function FSOUND_FX_SetI3DL2Reverb Lib "fmod.dll" Alias "_FSOUND_FX_SetI3DL2Reverb@52" (ByVal fxid As Long, ByVal Room As Long, ByVal RoomHF As Long, ByVal RoomRolloffFactor As Single, ByVal DecayTime As Single, ByVal DecayHFRatio As Single, ByVal Reflections As Long, ByVal ReflectionsDelay As Single, ByVal Reverb As Long, ByVal ReverbDelay As Single, ByVal Diffusion As Single, ByVal Density As Single, ByVal HFReference As Single) As Byte
Public Declare Function FSOUND_FX_SetParamEQ Lib "fmod.dll" Alias "_FSOUND_FX_SetParamEQ@16" (ByVal fxid As Long, ByVal Center As Single, ByVal Bandwidth As Single, ByVal Gain As Single) As Byte
Public Declare Function FSOUND_FX_SetWavesReverb Lib "fmod.dll" Alias "_FSOUND_FX_SetWavesReverb@20" (ByVal fxid As Long, ByVal InGain As Single, ByVal ReverbMix As Single, ByVal ReverbTime As Single, ByVal HighFreqRTRatio As Single) As Byte
'/* =================== */
'/* 3D sound functions. */
'/* =================== */
' See also FSOUND_Sample_SetMinMaxDistance (above)
Public Declare Function FSOUND_3D_Update Lib "fmod.dll" Alias "_FSOUND_3D_Update@0" () As Long
Public Declare Function FSOUND_3D_SetAttributes Lib "fmod.dll" Alias "_FSOUND_3D_SetAttributes@12" (ByVal channel As Long, ByRef Pos As Single, ByRef vel As Single) As Byte
Public Declare Function FSOUND_3D_GetAttributes Lib "fmod.dll" Alias "_FSOUND_3D_GetAttributes@12" (ByVal channel As Long, ByRef Pos As Single, ByRef vel As Single) As Byte
Public Declare Function FSOUND_3D_Listener_SetAttributes Lib "fmod.dll" Alias "_FSOUND_3D_Listener_SetAttributes@32" (ByVal Pos As Single, ByVal vel As Single, ByVal fx As Single, ByVal fy As Single, ByVal fz As Single, ByVal tx As Single, ByVal ty As Single, ByVal tz As Single) As Long
Public Declare Function FSOUND_3D_Listener_GetAttributes Lib "fmod.dll" Alias "_FSOUND_3D_Listener_GetAttributes@32" (ByRef Pos As Single, ByRef vel As Single, ByRef fx As Single, ByRef fy As Single, ByRef fz As Single, ByRef tx As Single, ByRef ty As Single, ByRef tz As Single) As Long
Public Declare Function FSOUND_3D_Listener_SetDopplerFactor Lib "fmod.dll" Alias "_FSOUND_3D_Listener_SetDopplerFactor@4" (ByVal fscale As Single) As Long
Public Declare Function FSOUND_3D_Listener_SetDistanceFactor Lib "fmod.dll" Alias "_FSOUND_3D_Listener_SetDistanceFactor@4" (ByVal fscale As Single) As Long
Public Declare Function FSOUND_3D_Listener_SetRolloffFactor Lib "fmod.dll" Alias "_FSOUND_3D_Listener_SetRolloffFactor@4" (ByVal fscale As Single) As Long
'/* ========================= */
'/* File Streaming functions. */
'/* ========================= */
'/*
' Note : Use FSOUND_LOADMEMORY flag with FSOUND_Stream_OpenFile to stream from memory.
' Use FSOUND_LOADRAW flag with FSOUND_Stream_OpenFile to treat stream as raw pcm data.
' Use FSOUND_MPEGACCURATE flag with FSOUND_Stream_OpenFile to open mpegs in 'accurate mode' for settime/gettime/getlengthms.
' Use FSOUND_FREE as the 'channel' variable, to let FMOD pick a free channel for you.
'*/
Public Declare Function FSOUND_Stream_SetBufferSize Lib "fmod.dll" Alias "_FSOUND_Stream_SetBufferSize@4" (ByVal ms As Long) As Byte
Public Declare Function FSOUND_Stream_OpenFile Lib "fmod.dll" Alias "_FSOUND_Stream_OpenFile@12" (ByVal filename As String, ByVal mode As FSOUND_MODES, ByVal memlength As Long) As Long
Public Declare Function FSOUND_Stream_Create Lib "fmod.dll" Alias "_FSOUND_Stream_Create@20" (ByVal callback As Long, ByVal length As Long, ByVal mode As Long, ByVal samplerate As Long, ByVal userdata As Long) As Long
Public Declare Function FSOUND_Stream_Play Lib "fmod.dll" Alias "_FSOUND_Stream_Play@8" (ByVal channel As Long, ByVal stream As Long) As Long
Public Declare Function FSOUND_Stream_PlayEx Lib "fmod.dll" Alias "_FSOUND_Stream_PlayEx@16" (ByVal channel As Long, ByVal stream As Long, ByVal dsp As Long, ByVal startpaused As Byte) As Long
Public Declare Function FSOUND_Stream_Stop Lib "fmod.dll" Alias "_FSOUND_Stream_Stop@4" (ByVal stream As Long) As Byte
Public Declare Function FSOUND_Stream_Close Lib "fmod.dll" Alias "_FSOUND_Stream_Close@4" (ByVal stream As Long) As Byte
Public Declare Function FSOUND_Stream_SetEndCallback Lib "fmod.dll" Alias "_FSOUND_Stream_SetEndCallback@12" (ByVal stream As Long, ByVal callback As Long, ByVal userdata As Long) As Byte
Public Declare Function FSOUND_Stream_SetSynchCallback Lib "fmod.dll" Alias "_FSOUND_Stream_SetSynchCallback@12" (ByVal stream As Long, ByVal callback As Long, ByVal userdata As Long) As Byte
Public Declare Function FSOUND_Stream_GetSample Lib "fmod.dll" Alias "_FSOUND_Stream_GetSample@4" (ByVal stream As Long) As Long
Public Declare Function FSOUND_Stream_CreateDSP Lib "fmod.dll" Alias "_FSOUND_Stream_CreateDSP@16" (ByVal stream As Long, ByVal callback As Long, ByVal Priority As Long, ByVal userdata As Long) As Long
Public Declare Function FSOUND_Stream_SetPosition Lib "fmod.dll" Alias "_FSOUND_Stream_SetPosition@8" (ByVal stream As Long, ByVal positition As Long) As Byte
Public Declare Function FSOUND_Stream_GetPosition Lib "fmod.dll" Alias "_FSOUND_Stream_GetPosition@4" (ByVal stream As Long) As Long
Public Declare Function FSOUND_Stream_SetTime Lib "fmod.dll" Alias "_FSOUND_Stream_SetTime@8" (ByVal stream As Long, ByVal ms As Long) As Byte
Public Declare Function FSOUND_Stream_GetTime Lib "fmod.dll" Alias "_FSOUND_Stream_GetTime@4" (ByVal stream As Long) As Long
Public Declare Function FSOUND_Stream_GetLength Lib "fmod.dll" Alias "_FSOUND_Stream_GetLength@4" (ByVal stream As Long) As Long
Public Declare Function FSOUND_Stream_GetLengthMs Lib "fmod.dll" Alias "_FSOUND_Stream_GetLengthMs@4" (ByVal stream As Long) As Long
'/* =================== */
'/* CD audio functions. */
'/* =================== */
' Note : 0 = default cdrom. Otherwise specify the drive letter, for example. 'D'.
Public Declare Function FSOUND_CD_Play Lib "fmod.dll" Alias "_FSOUND_CD_Play@8" (ByVal drive As Byte, ByVal Track As Long) As Byte
Public Declare Function FSOUND_CD_SetPlayMode Lib "fmod.dll" Alias "_FSOUND_CD_SetPlayMode@8" (ByVal drive As Byte, ByVal mode As FSOUND_CDPLAYMODES) As Long
Public Declare Function FSOUND_CD_Stop Lib "fmod.dll" Alias "_FSOUND_CD_Stop@4" (ByVal drive As Byte) As Byte
Public Declare Function FSOUND_CD_SetPaused Lib "fmod.dll" Alias "_FSOUND_CD_SetPaused@8" (ByVal drive As Byte, ByVal Paused As Byte) As Byte
Public Declare Function FSOUND_CD_SetVolume Lib "fmod.dll" Alias "_FSOUND_CD_SetVolume@8" (ByVal drive As Byte, ByVal volume As Long) As Byte
Public Declare Function FSOUND_CD_Eject Lib "fmod.dll" Alias "_FSOUND_CD_Eject@4" (ByVal drive As Byte) As Byte
Public Declare Function FSOUND_CD_GetPaused Lib "fmod.dll" Alias "_FSOUND_CD_GetPaused@4" (ByVal drive As Byte) As Byte
Public Declare Function FSOUND_CD_GetTrack Lib "fmod.dll" Alias "_FSOUND_CD_GetTrack@4" (ByVal drive As Byte) As Long
Public Declare Function FSOUND_CD_GetNumTracks Lib "fmod.dll" Alias "_FSOUND_CD_GetNumTracks@4" (ByVal drive As Byte) As Long
Public Declare Function FSOUND_CD_GetVolume Lib "fmod.dll" Alias "_FSOUND_CD_GetVolume@4" (ByVal drive As Byte) As Long
Public Declare Function FSOUND_CD_GetTrackLength Lib "fmod.dll" Alias "_FSOUND_CD_GetTrackLength@8" (ByVal drive As Byte, ByVal Track As Long) As Long
Public Declare Function FSOUND_CD_GetTrackTime Lib "fmod.dll" Alias "_FSOUND_CD_GetTrackTime@4" (ByVal drive As Byte) As Long
'/* ============== */
'/* DSP functions. */
'/* ============== */
' DSP Unit control and information functions.
' These functions allow you access to the mixed stream that FMOD uses to play back sound on.
Public Declare Function FSOUND_DSP_Create Lib "fmod.dll" Alias "_FSOUND_DSP_Create@12" (ByVal callback As Long, ByVal Priority As Long, ByVal param As Long) As Long
Public Declare Function FSOUND_DSP_Free Lib "fmod.dll" Alias "_FSOUND_DSP_Free@4" (ByVal unit As Long) As Long
Public Declare Function FSOUND_DSP_SetPriority Lib "fmod.dll" Alias "_FSOUND_DSP_SetPriority@8" (ByVal unit As Long, ByVal Priority As Long) As Long
Public Declare Function FSOUND_DSP_GetPriority Lib "fmod.dll" Alias "_FSOUND_DSP_GetPriority@4" (ByVal unit As Long) As Long
Public Declare Function FSOUND_DSP_SetActive Lib "fmod.dll" Alias "_FSOUND_DSP_SetActive@8" (ByVal unit As Long, ByVal active As Integer) As Long
Public Declare Function FSOUND_DSP_GetActive Lib "fmod.dll" Alias "_FSOUND_DSP_GetActive@4" (ByVal unit As Long) As Byte
'Functions to get hold of FSOUND 'system DSP unit' handles
Public Declare Function FSOUND_DSP_GetClearUnit Lib "fmod.dll" Alias "_FSOUND_DSP_GetClearUnit@0" () As Long
Public Declare Function FSOUND_DSP_GetSFXUnit Lib "fmod.dll" Alias "_FSOUND_DSP_GetSFXUnit@0" () As Long
Public Declare Function FSOUND_DSP_GetMusicUnit Lib "fmod.dll" Alias "_FSOUND_DSP_GetMusicUnit@0" () As Long
Public Declare Function FSOUND_DSP_GetFFTUnit Lib "fmod.dll" Alias "_FSOUND_DSP_GetFFTUnit@0" () As Long
Public Declare Function FSOUND_DSP_GetClipAndCopyUnit Lib "fmod.dll" Alias "_FSOUND_DSP_GetClipAndCopyUnit@0" () As Long
' Miscellaneous DSP functions
' Note for the spectrum analysis function to work, you have to enable the FFT DSP unit with
' the following code FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE);
' It is off by default to save cpu usage.
Public Declare Function FSOUND_DSP_MixBuffers Lib "fmod.dll" Alias "_SOUND_DSP_MixBuffers@28" (ByVal destbuffer As Long, ByVal srcbuffer As Long, ByVal length As Long, ByVal freq As Long, ByVal Vol As Long, ByVal pan As Long, ByVal mode As Long) As Byte
Public Declare Function FSOUND_DSP_ClearMixBuffer Lib "fmod.dll" Alias "_FSOUND_DSP_ClearMixBuffer@0" () As Long
Public Declare Function FSOUND_DSP_GetBufferLength Lib "fmod.dll" Alias "_FSOUND_DSP_GetBufferLength@0" () As Long
Public Declare Function FSOUND_DSP_GetBufferLengthTotal Lib "fmod.dll" Alias "_FSOUND_DSP_GetBufferLengthTotal@0" () As Long
Public Declare Function FSOUND_DSP_GetSpectrum Lib "fmod.dll" Alias "_FSOUND_DSP_GetSpectrum@0" () As Long
'/* ========================================================================== */
'/* Reverb functions. (eax2/eax3 reverb) (NOT SUPPORTED IN LINUX/CE) */
'/* ========================================================================== */
' See top of file for definitions and information on the reverb parameters.
'The FSOUND_REVERB_PRESETS have not been included in VB yet so they cannot yet be used here...
Public Declare Function FSOUND_Reverb_SetProperties Lib "fmod.dll" Alias "_FSOUND_Reverb_SetProperties@4" (ByRef prop As FSOUND_REVERB_PROPERTIES) As Byte
Public Declare Function FSOUND_Reverb_GetProperties Lib "fmod.dll" Alias "_FSOUND_Reverb_GetProperties@4" (ByRef prop As FSOUND_REVERB_PROPERTIES) As Byte
Public Declare Function FSOUND_Reverb_SetChannelProperties Lib "fmod.dll" (ByVal channel As Long, ByRef prop As FSOUND_REVERB_CHANNELPROPERTIES) As Byte
Public Declare Function FSOUND_Reverb_GetChannelProperties Lib "fmod.dll" (ByVal channel As Long, ByRef prop As FSOUND_REVERB_CHANNELPROPERTIES) As Byte
'/* ================================================ */
'/* Recording functions (NOT SUPPORTED IN LINUX/MAC) */
'/* ================================================ */
' Recording initialization functions
Public Declare Function FSOUND_Record_SetDriver Lib "fmod.dll" Alias "_FSOUND_Record_SetDriver@4" (ByVal outputtype As Long) As Byte
Public Declare Function FSOUND_Record_GetNumDrivers Lib "fmod.dll" Alias "_FSOUND_Record_GetNumDrivers@0" () As Long
Public Declare Function FSOUND_Record_GetDriverName Lib "fmod.dll" Alias "_FSOUND_Record_GetDriverName@4" (ByVal id As Long) As Long
Public Declare Function FSOUND_Record_GetDriver Lib "fmod.dll" Alias "_FSOUND_Record_GetDriver@0" () As Long
' Recording functionality. Only one recording session will work at a time.
Public Declare Function FSOUND_Record_StartSample Lib "fmod.dll" Alias "_FSOUND_Record_StartSample@8" (ByVal sample As Long, ByVal loopit As Boolean) As Byte
Public Declare Function FSOUND_Record_Stop Lib "fmod.dll" Alias "_FSOUND_Record_Stop@0" () As Byte
Public Declare Function FSOUND_Record_GetPosition Lib "fmod.dll" Alias "_FSOUND_Record_GetPosition@0" () As Long
'/* ========================================================================================== */
'/* FMUSIC API (MOD,S3M,XM,IT,MIDI PLAYBACK) */
'/* ========================================================================================== */
' Song management / playback functions.
Public Declare Function FMUSIC_LoadSong Lib "fmod.dll" Alias "_FMUSIC_LoadSong@4" (ByVal name As String) As Long
Public Declare Function FMUSIC_LoadSongMemory Lib "fmod.dll" Alias "_FMUSIC_LoadSongMemory@8" (ByRef Data As Long, ByVal length As Long) As Long
Public Declare Function FMUSIC_FreeSong Lib "fmod.dll" Alias "_FMUSIC_FreeSong@4" (ByVal module As Long) As Byte
Public Declare Function FMUSIC_PlaySong Lib "fmod.dll" Alias "_FMUSIC_PlaySong@4" (ByVal module As Long) As Byte
Public Declare Function FMUSIC_StopSong Lib "fmod.dll" Alias "_FMUSIC_StopSong@4" (ByVal module As Long) As Byte
Public Declare Function FMUSIC_StopAllSongs Lib "fmod.dll" Alias "_FMUSIC_StopAllSongs@0" () As Long
Public Declare Function FMUSIC_SetZxxCallback Lib "fmod.dll" Alias "_FMUSIC_SetZxxCallback@8" (ByVal module As Long, ByVal callback As Long) As Byte
Public Declare Function FMUSIC_SetRowCallback Lib "fmod.dll" Alias "_FMUSIC_SetRowCallback@12" (ByVal module As Long, ByVal callback As Long, ByVal rowstep As Long) As Byte
Public Declare Function FMUSIC_SetOrderCallback Lib "fmod.dll" Alias "_FMUSIC_SetOrderCallback@12" (ByVal module As Long, ByVal callback As Long, ByVal rowstep As Long) As Byte
Public Declare Function FMUSIC_SetInstCallback Lib "fmod.dll" Alias "_FMUSIC_SetInstCallback@12" (ByVal module As Long, ByVal callback As Long, ByVal instrument As Long) As Byte
Public Declare Function FMUSIC_SetSample Lib "fmod.dll" Alias "_FMUSIC_SetSample@12" (ByVal module As Long, ByVal sampno As Long, ByRef sptr As Long) As Byte
Public Declare Function FMUSIC_OptimizeChannels Lib "fmod.dll" Alias "_FMUSIC_OptimizeChannels@12" (ByVal module As Long, ByVal maxchannels As Long, ByVal minvolume As Long) As Byte
'Runtime song functions
Public Declare Function FMUSIC_SetReverb Lib "fmod.dll" Alias "_FMUSIC_SetReverb@4" (ByVal Reverb As Byte) As Byte
Public Declare Function FMUSIC_SetLooping Lib "fmod.dll" Alias "_FMUSIC_SetLooping@8" (ByVal module As Long, ByVal looping As Byte) As Byte
Public Declare Function FMUSIC_SetOrder Lib "fmod.dll" Alias "_FMUSIC_SetOrder@8" (ByVal module As Long, ByVal order As Long) As Byte
Public Declare Function FMUSIC_SetPaused Lib "fmod.dll" Alias "_FMUSIC_SetPaused@8" (ByVal module As Long, ByVal Pause As Byte) As Byte
Public Declare Function FMUSIC_SetMasterVolume Lib "fmod.dll" Alias "_FMUSIC_SetMasterVolume@8" (ByVal module As Long, ByVal volume As Long) As Byte
Public Declare Function FMUSIC_SetMasterSpeed Lib "fmod.dll" Alias "_FMUSIC_SetMasterSpeed@8" (ByVal module As Long, ByVal speed As Single) As Byte
Public Declare Function FMUSIC_SetPanSeperation Lib "fmod.dll" Alias "_FMUSIC_SetPanSeperation@8" (ByVal module As Long, ByVal pansep As Single) As Byte
'Static song information functions
Public Declare Function FMUSIC_GetName Lib "fmod.dll" Alias "_FMUSIC_GetName@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetType Lib "fmod.dll" Alias "_FMUSIC_GetType@4" (ByVal module As Long) As FMUSIC_TYPES
Public Declare Function FMUSIC_GetNumOrders Lib "fmod.dll" Alias "_FMUSIC_GetNumOrders@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetNumPatterns Lib "fmod.dll" Alias "_FMUSIC_GetNumPatterns@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetNumInstruments Lib "fmod.dll" Alias "_FMUSIC_GetNumInstruments@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetNumSamples Lib "fmod.dll" Alias "_FMUSIC_GetNumSamples@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetNumChannels Lib "fmod.dll" Alias "_FMUSIC_GetNumChannels@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetSample Lib "fmod.dll" Alias "_FMUSIC_GetSample@8" (ByVal module As Long, ByVal sampno As Long) As Long
Public Declare Function FMUSIC_GetPatternLength Lib "fmod.dll" Alias "_FMUSIC_GetPatternLength@8" (ByVal module As Long, ByVal orderno As Long) As Long
'Runtime song information
Public Declare Function FMUSIC_IsFinished Lib "fmod.dll" Alias "_FMUSIC_IsFinished@4" (ByVal module As Long) As Byte
Public Declare Function FMUSIC_IsPlaying Lib "fmod.dll" Alias "_FMUSIC_IsPlaying@4" (ByVal module As Long) As Byte
Public Declare Function FMUSIC_GetMasterVolume Lib "fmod.dll" Alias "_FMUSIC_GetMasterVolume@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetGlobalVolume Lib "fmod.dll" Alias "_FMUSIC_GetGlobalVolume@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetOrder Lib "fmod.dll" Alias "_FMUSIC_GetOrder@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetPattern Lib "fmod.dll" Alias "_FMUSIC_GetPattern@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetSpeed Lib "fmod.dll" Alias "_FMUSIC_GetSpeed@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetBPM Lib "fmod.dll" Alias "_FMUSIC_GetBPM@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetRow Lib "fmod.dll" Alias "_FMUSIC_GetRow@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetPaused Lib "fmod.dll" Alias "_FMUSIC_GetPaused@4" (ByVal module As Long) As Byte
Public Declare Function FMUSIC_GetTime Lib "fmod.dll" Alias "_FMUSIC_GetTime@4" (ByVal module As Long) As Long
Public Declare Function FMUSIC_GetRealChannel Lib "fmod.dll" Alias "_FMUSIC_GetRealChannel@8" (ByVal module As Long, ByVal modchannel As Long) As Long
'************
'* Windows Declarations (Added by Adion)
'************
'Required for GetStringFromPointer
Private Declare Function ConvCStringToVBString Lib "kernel32" Alias "lstrcpyA" (ByVal lpsz As String, ByVal pt As Long) As Long ' Notice the As Long return value replacing the As String given by the API Viewer.
'Required for the FFT/Spectral functions
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal length As Long)
'************
'* FUNCTIONS (Added by Adion)
'************
'Usage: myerrorstring = FSOUND_GetErrorString(FSOUND_GetError)
Public Function FSOUND_GetErrorString(ByVal errorcode As Long) As String
Select Case errorcode
Case FMOD_ERR_NONE: FSOUND_GetErrorString = "No errors"
Case FMOD_ERR_BUSY: FSOUND_GetErrorString = "Cannot call this command after FSOUND_Init. Call FSOUND_Close first."
Case FMOD_ERR_UNINITIALIZED: FSOUND_GetErrorString = "This command failed because FSOUND_Init was not called"
Case FMOD_ERR_PLAY: FSOUND_GetErrorString = "Playing the sound failed."
Case FMOD_ERR_INIT: FSOUND_GetErrorString = "Error initializing output device."
Case FMOD_ERR_ALLOCATED: FSOUND_GetErrorString = "The output device is already in use and cannot be reused."
Case FMOD_ERR_OUTPUT_FORMAT: FSOUND_GetErrorString = "Soundcard does not support the features needed for this soundsystem (16bit stereo output)"
Case FMOD_ERR_COOPERATIVELEVEL: FSOUND_GetErrorString = "Error setting cooperative level for hardware."
Case FMOD_ERR_CREATEBUFFER: FSOUND_GetErrorString = "Error creating hardware sound buffer."
Case FMOD_ERR_FILE_NOTFOUND: FSOUND_GetErrorString = "File not found"
Case FMOD_ERR_FILE_FORMAT: FSOUND_GetErrorString = "Unknown file format"
Case FMOD_ERR_FILE_BAD: FSOUND_GetErrorString = "Error loading file"
Case FMOD_ERR_MEMORY: FSOUND_GetErrorString = "Not enough memory "
Case FMOD_ERR_VERSION: FSOUND_GetErrorString = "The version number of this file format is not supported"
Case FMOD_ERR_INVALID_PARAM: FSOUND_GetErrorString = "An invalid parameter was passed to this function"
Case FMOD_ERR_NO_EAX: FSOUND_GetErrorString = "Tried to use an EAX command on a non EAX enabled channel or output."
Case FMOD_ERR_CHANNEL_ALLOC: FSOUND_GetErrorString = "Failed to allocate a new channel"
Case FMOD_ERR_RECORD: FSOUND_GetErrorString = "Recording is not supported on this machine"
Case FMOD_ERR_MEDIAPLAYER: FSOUND_GetErrorString = "Required Mediaplayer codec is not installed"
Case Else: FSOUND_GetErrorString = "Unknown error"
End Select
End Function
'Thanks to KarLKoX for the following function
'Example: MyDriverName = GetStringFromPointer(FSOUND_GetDriverName(count))
Public Function GetStringFromPointer(ByVal lpString As Long) As String
Dim NullCharPos As Long
Dim szBuffer As String
szBuffer = String(255, 0)
ConvCStringToVBString szBuffer, lpString
' Look for the null char ending the C string
NullCharPos = InStr(szBuffer, vbNullChar)
GetStringFromPointer = Left(szBuffer, NullCharPos - 1)
End Function
'These functions are added by Adion
Public Function GetSingleFromPointer(ByVal lpSingle As Long) As Single
'A Single is 4 bytes, so we copy 4 bytes
CopyMemory GetSingleFromPointer, ByVal lpSingle, 4
End Function
'Warning: You should set the fft dsp to active before retreiving the spectrum
'Also make sure the array you pass is dimensioned and ready to use
'FSOUND_DSP_SetActive FSOUND_DSP_GetFFTUnit, 1
Public Function GetSpectrum(ByRef Spectrum() As Single)
Dim nrOfVals As Long, lpSpectrum As Long
Dim a As Long
If UBound(Spectrum) > 511 Then nrOfVals = 512 Else nrOfVals = UBound(Spectrum) + 1
lpSpectrum = FSOUND_DSP_GetSpectrum
CopyMemory Spectrum(0), ByVal lpSpectrum, nrOfVals * 4
End Function
'******************
'F*I*R*E*S*W*O*R*D*
'******************
'****************
'K*E*N*A*M*I*C*K*
'****************
'Extra Added subs for module
'**********************************
'Some SUBS for INIT & CLOSE FMOD!!!
'----------=IMOPRTANT=-------------
'Some SUBS for INIT & CLOSE FMOD!!!
'**********************************
Public Sub initFMOD()
FSOUND_SetBufferSize (100)
If FSOUND_Init(44100, 32, 0) = 0 Then
'Error
MsgBox "An error occured initializing fmod" & vbCrLf & FSOUND_GetErrorString(FSOUND_GetError)
End
End If
FSOUND_Stream_SetBufferSize (1000)
End Sub
Public Sub closeFMOD()
'Stop the song that was playing
If mp3channel <> 0 Then
FSOUND_Stream_Stop mp3stream
mp3channel = 0
End If
'Close any opened file
If mp3stream <> 0 Then
FSOUND_Stream_Close mp3stream
mp3channel = 0
End If
If modmodule <> 0 Then
FMUSIC_StopSong modmodule
FMUSIC_FreeSong modmodule
modmodule = 0
End If
'Make sure you close FMOD on exiting
'(If you forget this, Visual Basic will crash upon exiting the app in debug mode)
FSOUND_Close
End Sub
'*****************************************************
'SUBs FOR MP3 (Also works with other formats even MID)
'SUBs FOR MP3 (Also works with other formats even MID)
'SUBs FOR MP3 (Also works with other formats even MID)
'*****************************************************
'you don't have to use fmusic_ for MIDs
'all are ****file
Public Sub OPENfile(file As String, blooping As Boolean)
'ako kanala raboti da spre i da se osvobodi
If mp3channel <> 0 Then
FSOUND_Stream_Stop mp3stream
mp3channel = 0
End If
'stream-a da se zatvori vednagi4eski
If mp3stream <> 0 Then
FSOUND_Stream_Close mp3stream
mp3stream = 0
End If
'The Line That Opens The File
If blooping Then
mp3stream = FSOUND_Stream_OpenFile(file, FSOUND_STEREO Or FSOUND_2D Or FSOUND_16BITS Or FSOUND_LOOP_NORMAL, 0)
Else
mp3stream = FSOUND_Stream_OpenFile(file, FSOUND_STEREO Or FSOUND_2D Or FSOUND_16BITS, 0)
End If
End Sub
Public Sub PLAYfile()
If mp3channel <> 0 Then
FSOUND_Stream_Stop mp3stream
mp3channel = 0
End If
mp3channel = FSOUND_Stream_Play(FSOUND_FREE, mp3stream)
'FMod.FSOUND_SetLoopMode sarray(2, channel), 23
End Sub
Public Sub STOPfile()
'stop stream
FSOUND_Stream_Stop mp3stream ' spira pesenta
FSOUND_StopSound mp3channel ' osvobojdava kanala
mp3channel = 0 '- sled stop kanala se osvobojdava i za tova e redno promenlivata da e 0
End Sub
Public Sub PAUSEfile()
'no error if no stream loaded or playing !! !!!!
FSOUND_SetPaused mp3channel, Not CBool(FSOUND_GetPaused(mp3channel))
End Sub
Public Sub CLOSEfile()
'VERY interesting!!! no error if a stream is playing!!! !!!!
FSOUND_Stream_Close mp3stream
mp3stream = 0
mp3channel = 0
End Sub
Public Sub VOLUMEfile(volume As Byte)
FSOUND_SetVolume mp3channel, volume
End Sub
'********************************
'SUBs FOR -=MOD,S3M,XM,IT,MIDI=-
'********************************
'using FMUSIC_
'all are ****mus
Public Function OPENmus(file As String) As Boolean
If modmodule <> 0 Then FMUSIC_StopSong modmodule
modmodule = 0
modmodule = FMUSIC_LoadSong(file)
If (modmodule = 0) Then OPENmus = False _
Else OPENmus = True
End Function
Public Sub PLAYmus(bloop As Boolean)
'if a song is playing it restarts automatically
'here it returns an error for sure
If modmodule <> 0 And Not FMUSIC_IsPlaying(modmodule) Then
FMUSIC_SetLooping modmodule, bloop
FMUSIC_PlaySong (modmodule)
End If
End Sub
Public Sub PAUSEmus()
'it doesn't make an error if no music is loaded
FMUSIC_SetPaused modmodule, Not CBool(mFMod.FMUSIC_GetPaused(modmodule))
End Sub
Public Sub STOPmus()
'stops a song, doesn't make an error if the music is already stopped
FMUSIC_StopSong modmodule
End Sub
Public Sub VOLUMEmus(volume As Long)
' 0-256
FMUSIC_SetMasterVolume modmodule, volume
'FMod.FSOUND_SetVolume modmodule, volume
End Sub
Public Sub CLOSEmus()
'strange function doesn't close the music ???!!!!
FMUSIC_FreeSong modmodule
modmodule = 0
End Sub