Code: Select all
'Coded by UEZ build 2024-01-01
#Include Once "windows.bi"
#Include Once "file.bi"
Const BASS_UNICODE = &h80000000, BASS_DEVICE_ENABLED = 1, BASS_DEVICE_DEFAULT = 2, BASS_DEVICE_INIT = 4, BASS_DEVICE_LOOPBACK = 8, BASS_FILEDATA_END = 0, BASS_FILEPOS_START = 3, _
BASS_SAMPLE_8BITS = 1, BASS_SAMPLE_FLOAT = 256, BASS_SAMPLE_MONO = 2, BASS_SAMPLE_LOOP = 4, BASS_SAMPLE_3D = 8, BASS_SAMPLE_SOFTWARE = 16, _
BASS_SAMPLE_MUTEMAX = 32, BASS_SAMPLE_VAM = 64, BASS_SAMPLE_FX = 128, BASS_STREAM_PRESCAN = &h20000, BASS_STREAM_AUTOFREE = &h400001, _
BASS_STREAM_RESTRATE = &h800001, BASS_STREAM_BLOCK = &h100000, BASS_STREAM_DECODE = &h200000, BASS_MUSIC_RAMP = &h200, _
BASS_MUSIC_RAMPS = &h400, BASS_MUSIC_SURROUND = &h800, BASS_MUSIC_SURROUND2 = &h1000, BASS_MUSIC_FT2PAN = &h2000, _
BASS_MUSIC_FT2MOD = &h2000, BASS_MUSIC_PT1MOD = &h4000, BASS_MUSIC_NONINTER = &h10000, BASS_MUSIC_STOPBACK = &h80000, _
BASS_ASYNCFILE = &h40000000, BASS_CTYPE_SAMPLE = 1, BASS_CTYPE_RECORD = 2, BASS_CTYPE_STREAM = &h10000, BASS_CTYPE_STREAM_OGG = &h10002, _
BASS_CTYPE_STREAM_MP1 = &h10003, BASS_CTYPE_STREAM_MP2 = &h10004, BASS_CTYPE_STREAM_MP3 = &h10005, BASS_CTYPE_STREAM_AIFF = &h10006, _
BASS_CTYPE_STREAM_CA = &h10007, BASS_CTYPE_STREAM_MF = &h10008, BASS_CTYPE_STREAM_AM = &h10009, BASS_CTYPE_STREAM_DUMMY = &h18000, _
BASS_CTYPE_STREAM_DEVICE = &h18001, BASS_CTYPE_STREAM_WAV = &h40000, BASS_CTYPE_STREAM_WAV_PCM = &h50001, BASS_CTYPE_STREAM_WAV_FLOAT = &h50003, _
BASS_CTYPE_MUSIC_MOD = &h20000, BASS_CTYPE_MUSIC_MTM = &h20001, BASS_CTYPE_MUSIC_S3M = &h20002, BASS_CTYPE_MUSIC_XM = &h20003, _
BASS_CTYPE_MUSIC_IT = &h20004, BASS_CTYPE_MUSIC_MO3 = &h00100, BASS_DATA_AVAILABLE = 0, BASS_DATA_FIXED = &h20000000, _
BASS_DATA_FLOAT = &h40000000, BASS_DATA_FFT256 = &h80000000, BASS_DATA_FFT512 = &h80000001, BASS_DATA_FFT1024 = &h80000002, _
BASS_DATA_FFT2048 = &h80000003, BASS_DATA_FFT4096 = &h80000004, BASS_DATA_FFT8192 = &h80000005, BASS_DATA_FFT16384 = &h80000006, _
BASS_DATA_FFT32768 = &h80000007, BASS_DATA_FFT_INDIVIDUAL = &h10, BASS_DATA_FFT_NOWINDOW = &h20, BASS_DATA_FFT_REMOVEDC = &h40, _
BASS_DATA_FFT_COMPLEX = &h80, BASS_DATA_FFT_NYQUIST = &h100, BASS_POS_BYTE = 0, BASS_POS_MUSIC_ORDER = 1, BASS_POS_OGG = 3, _
BASS_ATTRIB_FREQ = 1, BASS_ATTRIB_VOL = 2, BASS_ATTRIB_PAN = 3, BASS_ATTRIB_EAXMIX = 4, BASS_ATTRIB_NOBUFFER = 5, BASS_ATTRIB_VBR = 6, _
BASS_ATTRIB_CPU = 7, BASS_ATTRIB_SRC = 8, BASS_ATTRIB_NET_RESUME = 9, BASS_ATTRIB_SCANINFO = 10, BASS_ATTRIB_NORAMP = 11, _
BASS_ATTRIB_BITRATE = 12, BASS_ATTRIB_BUFFER = 13, BASS_ATTRIB_MUSIC_AMPLIFY = &h100, BASS_ATTRIB_MUSIC_PANSEP = &h101, _
BASS_ATTRIB_MUSIC_PSCALER = &h102, BASS_ATTRIB_MUSIC_BPM = &h103, BASS_ATTRIB_MUSIC_SPEED = &h104, BASS_ATTRIB_MUSIC_VOL_GLOBAL = &h105, _
BASS_ATTRIB_MUSIC_ACTIVE = &h106, BASS_ATTRIB_MUSIC_VOL_CHAN = &h200, BASS_ATTRIB_MUSIC_VOL_INST = &h300, BASS_MUSIC_PRESCAN = BASS_STREAM_PRESCAN, _
BASS_LEVEL_STEREO = 2, BASS_FILEPOS_CURRENT = 0, BASS_FILEPOS_DECODE = BASS_FILEPOS_CURRENT, BASS_FILEPOS_DOWNLOAD = 1, BASS_FILEPOS_END = 2, _
BASS_FILEPOS_START = 3, BASS_FILEPOS_CONNECTED = 4, BASS_FILEPOS_BUFFER = 5, BASS_FILEPOS_SOCKET = 6, BASS_FILEPOS_ASYNCBUF = 7, BASS_FILEPOS_SIZE = 8, _
BASS_FILEPOS_BUFFERING = 9, BASS_TAG_ID3 = 0, BASS_TAG_ID3V2 = 1, BASS_TAG_OGG = 2, BASS_TAG_HTTP = 3, BASS_TAG_ICY = 4, BASS_TAG_META = 5, _
BASS_TAG_APE = 6, BASS_TAG_MP4 = 7, BASS_TAG_WMA = 8, BASS_TAG_VENDOR = 9, BASS_TAG_LYRICS3 = 10, BASS_TAG_CA_CODEC = 11, BASS_TAG_MF = 13, _
BASS_TAG_WAVEFORMAT = 14, BASS_TAG_AM_MIME = 15, BASS_TAG_AM_NAME = 16, BASS_TAG_RIFF_INFO = &h100, BASS_TAG_RIFF_BEXT = &h101, _
BASS_TAG_RIFF_CART = &h102, BASS_TAG_RIFF_DISP = &h103, BASS_TAG_RIFF_CUE = &h104, BASS_TAG_RIFF_SMPL = &h105, BASS_TAG_APE_BINARY = &h1000, _
BASS_TAG_MUSIC_NAME = &h10000, BASS_TAG_MUSIC_MESSAGE = &h10001, BASS_TAG_MUSIC_ORDERS = &h10002, BASS_TAG_MUSIC_AUTH = &h10003, _
BASS_TAG_MUSIC_INST = &h10100, BASS_TAG_MUSIC_SAMPLE = &h10300, BASS_POS_SCAN = &h40000000, BASS_LEVEL_MONO = 1, BASS_LEVEL_STEREO = 2, BASS_LEVEL_RMS = 4, _
BASS_LEVEL_VOLPAN = 8, BASS_CONFIG_DEV_DEFAULT = 36, BASS_FX_DX8_CHORUS = 0, BASS_FX_DX8_COMPRESSOR = 1, BASS_FX_DX8_DISTORTION = 2, BASS_FX_DX8_ECHO = 3, BASS_FX_DX8_FLANGER = 4, _
BASS_FX_DX8_GARGLE = 5, BASS_FX_DX8_I3DL2REVERB = 6, BASS_FX_DX8_PARAMEQ = 7, BASS_FX_DX8_REVERB = 8, BASS_FX_VOLUME = 9
Type HSTREAM As DWORD
Type HPLUGIN As DWORD
Type HSAMPLE As DWORD
Type HMUSIC As DWORD
Type HFX As DWORD
Type HDSP As DWORD
Type QWORD As Longint
Type HPLUGIN As DWORD
Type BASS_DEVICEINFO
As Zstring Ptr Name, driver
As DWORD flags
End Type
Type BASS_CHANNELINFO
As DWORD freq, chans, flags, ctype, origres
As HPLUGIN plugin
As HSAMPLE sample
As Zstring Ptr filename
End Type
Type BASS_INFO
As DWORD flags, hwsize, hwfree, freesam, free3d, minrate, maxrate
As BOOL eax
As DWORD minbuf, dsver, latency, initflags, speakers, freq
end type
Type BASS_LEVELS
As Single Left, Right
End Type
Type ID3v1
As Ubyte id(3), title(30), artist(30), album(30), Year(4), comment(30), genre
End Type
Type BASS_DX8_PARAMEQ
As Single fCenter, _ 'Bandwidth, in semitones, in the range from 1 to 36. Default 18 semitones.
fBandwidth, _ 'Center frequency, in hertz, in the range from 80 to 16000. This value cannot exceed one-third of the frequency of the channel. Default 100 Hz.
fGain 'Gain, in the range from -15 to 15. Default 0 dB.
End Type
Type BASS_FX_VOLUME_PARAM
As Single fTarget, fCurrent, fTime
As DWORD lCurve
End Type
Type BASS_DX8_REVERB
As Single fInGain, fReverbMix, fReverbTime, fHighFreqRTRatio
End Type
Dim Shared BASS_Init As Function Stdcall(Byval As Long, Byval As DWORD, Byval As DWORD, Byval As HWND, Byval As GUID Ptr) As BOOL
Dim Shared BASS_GetDeviceInfo As Function Stdcall(As DWORD, As BASS_DEVICEINFO Ptr) As BOOL
Dim Shared BASS_GetInfo As Function Stdcall(As BASS_INFO) As BOOL
Dim Shared BASS_GetDevice As Function Stdcall() As DWORD
Dim Shared BASS_GetVersion As Function Stdcall() As DWORD
Dim Shared BASS_Free As Function Stdcall() As BOOL
Dim Shared BASS_Stop As Function Stdcall() As BOOL
Dim Shared BASS_SetVolume As Function Stdcall(Byval As Single) As BOOL
Dim Shared BASS_SetDevice As Function Stdcall(Byval As DWORD) As BOOL
Dim Shared BASS_SetConfig As Function Stdcall(Byval As DWORD, Byval As DWORD) As BOOL
Dim Shared BASS_ErrorGetCode As Function Stdcall() As Integer
Dim Shared BASS_StreamGetFilePosition As Function Stdcall(Byval As HSTREAM, As DWORD) As QWORD
Dim Shared BASS_StreamCreateFile As Function Stdcall(Byval As BOOL, Byval As Any Ptr, Byval As QWORD, Byval As QWORD, Byval As DWORD) As HSTREAM
Dim Shared BASS_StreamCreateURL As Function Stdcall(Byval As Any Ptr, Byval As DWORD, Byval As DWORD, Byval As Any Ptr, Byval As Any Ptr) As HSTREAM
Dim Shared BASS_StreamFree As Function Stdcall(Byval As HSTREAM) As BOOL
Dim Shared BASS_ChannelPlay As Function Stdcall(Byval As DWORD, Byval As BOOL) As BOOL
Dim Shared BASS_ChannelStop As Function Stdcall(Byval As DWORD) As BOOL
Dim Shared BASS_ChannelPause As Function Stdcall(Byval As DWORD) As BOOL
Dim Shared BASS_ChannelGetInfo As Function Stdcall(Byval As DWORD, Byval As BASS_CHANNELINFO) As BOOL
Dim Shared BASS_ChannelGetData As Function Stdcall(Byval As DWORD, Byval As Any Ptr, Byval As DWORD) As DWORD
Dim Shared BASS_ChannelGetLevel As Function Stdcall(Byval As DWORD) As DWORD
Dim Shared BASS_ChannelGetLevelEx As Function Stdcall(Byval As DWORD, Byval As Any Ptr, Byval As Single, Byval As DWORD) As BOOL
Dim Shared BASS_ChannelGetPosition As Function Stdcall(Byval As DWORD, Byval As DWORD) As DWORD
Dim Shared BASS_ChannelGetLength As Function Stdcall(Byval As DWORD, Byval As DWORD) As QWORD
Dim Shared BASS_ChannelGetTags As Function Stdcall(Byval As DWORD, Byval As DWORD) As Zstring Ptr
Dim Shared BASS_ChannelGetAttribute As Function Stdcall(Byval As DWORD, Byval As DWORD, Byval As Any Ptr) As BOOL
Dim Shared BASS_ChannelGetDevice As Function Stdcall(Byval As DWORD) As DWORD
Dim Shared BASS_ChannelBytes2Seconds As Function Stdcall(Byval As DWORD, Byval As QWORD) As Double
Dim Shared BASS_ChannelSeconds2Bytes As Function Stdcall(Byval As DWORD, Byval As Double) As QWORD
Dim Shared BASS_ChannelSetAttribute As Function Stdcall(Byval As DWORD, Byval As DWORD, Byval As Single) As BOOL
Dim Shared BASS_ChannelSetPosition As Function Stdcall(Byval As DWORD, Byval As QWORD, Byval As DWORD) As BOOL
Dim Shared BASS_ChannelSetDevice As Function Stdcall(Byval As DWORD, Byval As DWORD) As BOOL
Dim Shared BASS_MusicLoad As Function Stdcall(Byval As BOOL, Byval As Any Ptr, Byval As QWORD, Byval As DWORD, Byval As DWORD, Byval As DWORD) As HMUSIC
Dim Shared BASS_MusicFree As Function Stdcall(Byval As HMUSIC) As BOOL
Dim Shared BASS_ChannelSetFX As Function Stdcall(Byval As DWORD, Byval As DWORD, Byval As Integer) As HFX
Dim Shared BASS_FXSetParameters As Function Stdcall(Byval As HFX, Byval As Any Ptr) As BOOL
Dim Shared BASS_FXGetParameters As Function Stdcall(Byval As HFX, Byval As Any Ptr) As BOOL
Dim Shared BASS_ChannelRemoveFX As Function Stdcall(Byval As DWORD, Byval As HFX) As BOOL
Dim Shared BASS_PluginLoad As Function Stdcall(Byval As Any Ptr, Byval As DWORD) As HPLUGIN
Dim Shared BASS_PluginFree As Function Stdcall(Byval As HPLUGIN) As BOOL
Dim Shared As Any Ptr _g__hLib_Bass = 0
Dim Shared As BOOL _g__bSound = True
'Init-------------------------------------------------------------------------------------------------------------------------------------------
Function _Bass_Startup(sFolderDLL As String = Curdir, b64DllSuffix As BOOL = True) As BOOL
Dim As String sb64 = "\Bass.dll"
#Ifdef __Fb_64bit__
If b64DllSuffix = True Then sb64 = "\Bass64.dll"
#Endif
If Fileexists(sFolderDLL & sb64) = 0 Then
_g__bSound = False
Return False
Else
_g__hLib_Bass = Dylibload(sFolderDLL & sb64)
Endif
BASS_Init = Dylibsymbol(_g__hLib_Bass, "BASS_Init")
If BASS_Init = 0 Then Return False
BASS_Free = Dylibsymbol(_g__hLib_Bass, "BASS_Free")
If BASS_Free = 0 Then Return False
BASS_StreamCreateFile = Dylibsymbol(_g__hLib_Bass, "BASS_StreamCreateFile")
If BASS_StreamCreateFile = 0 Then Return False
BASS_StreamCreateURL = Dylibsymbol(_g__hLib_Bass, "BASS_StreamCreateURL")
If BASS_StreamCreateURL = 0 Then Return False
BASS_StreamFree = Dylibsymbol(_g__hLib_Bass, "BASS_StreamFree")
If BASS_StreamFree = 0 Then Return False
BASS_ChannelPlay = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelPlay")
If BASS_ChannelPlay = 0 Then Return False
BASS_ChannelStop = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelStop")
If BASS_ChannelStop = 0 Then Return False
BASS_Stop = Dylibsymbol(_g__hLib_Bass, "BASS_Stop")
If BASS_Stop = 0 Then Return False
BASS_SetVolume = Dylibsymbol(_g__hLib_Bass, "BASS_SetVolume")
If BASS_SetVolume = 0 Then Return False
BASS_SetDevice = Dylibsymbol(_g__hLib_Bass, "BASS_SetDevice")
If BASS_SetDevice = 0 Then Return False
BASS_SetConfig = Dylibsymbol(_g__hLib_Bass, "BASS_SetConfig")
If BASS_SetConfig = 0 Then Return False
BASS_ErrorGetCode = Dylibsymbol(_g__hLib_Bass, "BASS_ErrorGetCode")
If BASS_ErrorGetCode = 0 Then Return False
BASS_GetDeviceInfo = Dylibsymbol(_g__hLib_Bass, "BASS_GetDeviceInfo")
If BASS_GetDeviceInfo = 0 Then Return False
BASS_GetDevice = Dylibsymbol(_g__hLib_Bass, "BASS_GetDevice")
If BASS_GetDevice = 0 Then Return False
BASS_StreamGetFilePosition = Dylibsymbol(_g__hLib_Bass, "BASS_StreamGetFilePosition")
If BASS_StreamGetFilePosition = 0 Then Return False
BASS_GetInfo = Dylibsymbol(_g__hLib_Bass, "BASS_GetInfo")
If BASS_GetInfo = 0 Then Return False
BASS_GetVersion = Dylibsymbol(_g__hLib_Bass, "BASS_GetVersion")
If BASS_GetVersion = 0 Then Return False
BASS_ChannelGetInfo = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetInfo")
If BASS_ChannelGetInfo = 0 Then Return False
BASS_ChannelGetData = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetData")
If BASS_ChannelGetData = 0 Then Return False
BASS_ChannelGetLevel = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetLevel")
If BASS_ChannelGetLevel = 0 Then Return False
BASS_ChannelGetLevelEx = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetLevelEx")
If BASS_ChannelGetLevelEx = 0 Then Return False
BASS_ChannelGetPosition = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetPosition")
If BASS_ChannelGetPosition = 0 Then Return False
BASS_ChannelPause = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelPause")
If BASS_ChannelPause = 0 Then Return False
BASS_ChannelGetLength = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetLength")
If BASS_ChannelGetLength = 0 Then Return False
BASS_ChannelGetTags = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetTags")
If BASS_ChannelGetTags = 0 Then Return False
BASS_ChannelGetAttribute = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetAttribute")
If BASS_ChannelGetAttribute = 0 Then Return False
BASS_ChannelGetDevice = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelGetDevice")
If BASS_ChannelGetDevice = 0 Then Return False
BASS_ChannelBytes2Seconds = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelBytes2Seconds")
If BASS_ChannelBytes2Seconds = 0 Then Return False
BASS_ChannelSeconds2Bytes = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelSeconds2Bytes")
If BASS_ChannelSeconds2Bytes = 0 Then Return False
BASS_ChannelSetAttribute = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelSetAttribute")
If BASS_ChannelSetAttribute = 0 Then Return False
BASS_ChannelSetPosition = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelSetPosition")
If BASS_ChannelSetPosition = 0 Then Return False
BASS_ChannelSetDevice = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelSetDevice")
If BASS_ChannelSetDevice = 0 Then Return False
BASS_MusicLoad = Dylibsymbol(_g__hLib_Bass, "BASS_MusicLoad")
If BASS_MusicLoad = 0 Then Return False
BASS_MusicFree = Dylibsymbol(_g__hLib_Bass, "BASS_MusicFree")
If BASS_MusicFree = 0 Then Return False
BASS_ChannelSetFX = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelSetFX")
If BASS_ChannelSetFX = 0 Then Return False
BASS_FXSetParameters = Dylibsymbol(_g__hLib_Bass, "BASS_FXSetParameters")
If BASS_FXSetParameters = 0 Then Return False
BASS_FXGetParameters = Dylibsymbol(_g__hLib_Bass, "BASS_FXGetParameters")
If BASS_FXGetParameters = 0 Then Return False
BASS_ChannelRemoveFX = Dylibsymbol(_g__hLib_Bass, "BASS_ChannelRemoveFX")
If BASS_ChannelRemoveFX = 0 Then Return False
BASS_PluginLoad = Dylibsymbol(_g__hLib_Bass, "BASS_PluginLoad")
If BASS_PluginLoad = 0 Then Return False
BASS_PluginFree = Dylibsymbol(_g__hLib_Bass, "BASS_PluginFree")
If BASS_PluginFree = 0 Then Return False
Return True
End Function
Function _Bass_Shutdown() As BOOL
If _g__hLib_Bass > 0 Then
Dylibfree(_g__hLib_Bass)
Return True
End If
Return False
End Function
Function _BASS_ErrorGetCode() As String
Select Case BASS_ErrorGetCode()
Case 0 : Return "No error."
Case 1 : Return "There is insufficient memory."
Case 2 : Return "The file could not be opened."
Case 3 : Return "Cannot find a free sound driver."
Case 4 : Return "The sample buffer was lost."
Case 5 : Return "Invalid handle."
Case 6 : Return "Unsupported sample Format."
Case 7 : Return "Invalid position."
Case 8 : Return "BASS_Init has not been successfully called."
Case 9 : Return "BASS_Start has not been successfully called."
Case 10 : Return "SSL/HTTPS support is not available."
Case 14 : Return "Already initialized/paused/whatever."
Case 17 : Return "The file does not contain audio, or it also contains video and videos are disabled."
Case 18 : Return "Cannot get a free channel."
Case 19 : Return "An illegal type was specified."
Case 20 : Return "An illegal parameter was specified."
Case 21 : Return "Could not initialize 3D support."
Case 22 : Return "No EAX support."
Case 23 : Return "Illegal device number."
Case 24 : Return "Not playing."
Case 25 : Return "Illegal sample rate."
Case 27 : Return "The stream is not a file stream."
Case 29 : Return "No hardware voices available."
Case 31 : Return "The Mod music has no sequence data."
Case 32 : Return "No internet connection could be opened."
Case 33 : Return "Could not create the file."
Case 34 : Return "Effects are Not available."
Case 37 : Return "Requested data is not available."
Case 38 : Return "The channel is a decoding channel"
Case 39 : Return "A sufficient DirectX version is not installed."
Case 40 : Return "Connection timed Out."
Case 41 : Return "The file's format is not recognised/supported."
Case 42 : Return "The specified SPEAKER flags are invalid."
Case 43 : Return "The plugin requires a different BASS version."
Case 44 : Return "Codec is Not available/supported."
Case 45 : Return "The channel/file has ended."
Case 46 : Return "Something else has exclusive use of the device."
Case 47 : Return "The file cannot be streamed using the buffered file system."
Case -1 : Return "Some other mystery problem!"
End Select
Return "Hmmmm."
End Function
Function _Bass_Init(Device As DWORD = -1, Freq As Dword = 44100, Flags As Dword = 0, Win As HWND = Null, clsid As GUID Ptr = Null) As BOOL
Return BASS_Init(Device, Freq, Flags, Win, clsid)
End Function
Function _Bass_Free() As BOOL
Return BASS_Free()
End Function
Function _Bass_Stop() As BOOL
Return BASS_Stop()
End Function
Function _BASS_SetVolume(Volume As Single) As BOOL
Return BASS_SetVolume(Iif(Volume < 0, 0, Iif(Volume > 1.0, 1.0, Volume)))
End Function
Function _BASS_SetDevice(Device As DWORD) As BOOL
Return BASS_SetDevice(Device)
End Function
Function _BASS_SetConfig(Device As DWORD, Value As DWORD) As BOOL
Return BASS_SetConfig(Device, Value)
End Function
'Device-----------------------------------------------------------------------------------------------------------------------------------------
Function _BASS_GetInfo(bi As BASS_INFO) As BOOL
Return BASS_GetInfo(bi)
End Function
Function _BASS_GetDevice() As DWORD
Return BASS_GetDevice()
End Function
Function _BASS_GetDeviceInfo(Device As DWORD, Info As BASS_DEVICEINFO Ptr) As BOOL
Return BASS_GetDeviceInfo(Device, Info)
End Function
Function _BASS_GetVersion() As String
Dim as String ver, t, h
Dim as DWORD v = BASS_GetVersion()
If v = 0 Then Return ""
h = Hex(v, 8)
For i as Ubyte = 1 to 8 Step 2
t = Str(Val("&h" + Mid(h, i, 2)))
'if Left(t, 1) = "0" Then t = Ltrim(t, "0")
ver &= t & "."
next
Return RTrim(ver, ".")
End Function
'Stream-----------------------------------------------------------------------------------------------------------------------------------------
Function _BASS_StreamFree(hStream As HSTREAM) As BOOL
Return BASS_StreamFree(hStream)
End Function
Function _BASS_StreamCreateFile(File As String, Flags As Dword = 0, offset As QWORD = 0, Length As QWORD = 0, Mem As BOOL = False) As HSTREAM
Return BASS_StreamCreateFile(Mem, Strptr(File), offset, Length, Flags)
End Function
Function _BASS_StreamCreateURL(URL As String, Flags As Dword = 0, Offset As Dword = 0, Proc As Any Ptr = 0, UsrProc As Any Ptr = 0) As HSTREAM
Return BASS_StreamCreateURL(Strptr(URL), offset, Flags, Proc, UsrProc)
End Function
Function _BASS_StreamCreateMem(pMem As Any Ptr, Length As QWORD = 0, Flags As Dword = 0, offset As QWORD = 0, Mem As BOOL = True) As HSTREAM
Return BASS_StreamCreateFile(Mem, pMem, offset, Length, Flags Or BASS_UNICODE)
End Function
Function _BASS_StreamGetFilePosition(hStream As HSTREAM, Mode As Dword) As QWORD
Return BASS_StreamGetFilePosition(hStream, Mode)
End Function
'Music------------------------------------------------------------------------------------------------------------------------------------------
Function _BASS_MusicLoad(File As String, Flags As DWORD = 0, Freq As DWORD = 0, offset As QWORD = 0, Length As DWORD = 0, Mem As BOOL = False) As HMUSIC
Return BASS_MusicLoad(Mem, Strptr(File), offset, Length, Flags, Freq)
End Function
Function _BASS_MusicLoadMem(pMem As Any Ptr, Flags As DWORD = 0, Freq As DWORD = 0, offset As QWORD = 0, Length As DWORD = 0, Mem As BOOL = True) As HMUSIC
Return BASS_MusicLoad(Mem, pMem, offset, Length, Flags, Freq)
End Function
Function _BASS_MusicFree(Handle As HMUSIC) As BOOL
Return BASS_MusicFree(Handle)
End Function
'Channel----------------------------------------------------------------------------------------------------------------------------------------
Function _BASS_ChannelPlay(Handle As DWORD, Restart As BOOL = True) As BOOL
Return BASS_ChannelPlay(Handle, Restart)
End Function
Function _BASS_ChannelStop(Handle As DWORD) As BOOL
Return BASS_ChannelStop(Handle)
End Function
Function _BASS_ChannelPause(Handle As DWORD) As BOOL
Return BASS_ChannelPause(Handle)
End Function
Function _BASS_ChannelGetInfo(Handle As DWORD, ChanInfo As BASS_CHANNELINFO) As BOOL
Return BASS_ChannelGetInfo(Handle, ChanInfo)
End Function
Function _BASS_ChannelGetData(Handle As DWORD, Buffer As Any Ptr, Length As DWORD) As DWORD
Return BASS_ChannelGetData(Handle, Buffer, Length)
End Function
Function _BASS_ChannelGetLevel(Handle As DWORD) As DWORD
Return BASS_ChannelGetLevel(Handle)
End Function
Function _BASS_ChannelGetLevelEx(Handle As DWORD, Byref Levels As BASS_LEVELS, Length As Single = 0.05, Flags As DWORD = BASS_LEVEL_STEREO) As BOOL
Return BASS_ChannelGetLevelEx(Handle, @Levels, Length, Flags)
End Function
Function _BASS_ChannelGetPosition(Handle As DWORD, Mode As DWORD) As QWORD
Return BASS_ChannelGetPosition(Handle, Mode)
End Function
Function _BASS_ChannelGetLength(Handle As DWORD, Mode As DWORD = BASS_POS_BYTE) As QWORD
Return BASS_ChannelGetLength(Handle, Mode)
End Function
Function _BASS_ChannelGetAttribute(Handle As DWORD, Byref Value As Single, Attrib As DWORD = BASS_ATTRIB_BITRATE) As BOOL
Return BASS_ChannelGetAttribute(Handle, Attrib, @Value)
End Function
Function _BASS_ChannelBytes2Seconds(Handle As DWORD, Position As QWORD) As Double
Return BASS_ChannelBytes2Seconds(Handle, Position)
End Function
Function _BASS_ChannelSeconds2Bytes(Handle As DWORD, Position As Double) As QWORD
Return BASS_ChannelSeconds2Bytes(Handle, Position)
End Function
Function _BASS_ChannelSetAttribute(Handle As DWORD, Attrib As DWORD, Value As Single) As BOOL
Return BASS_ChannelSetAttribute(Handle, Attrib, Value)
End Function
Function _BASS_ChannelSetDevice(Handle As DWORD, Device As DWORD) As BOOL
Return _BASS_ChannelSetDevice(Handle, Device)
End Function
Function _BASS_ChannelSetPosition(Handle As DWORD, Position As QWORD, Mode As DWORD) As BOOL
Return BASS_ChannelSetPosition(Handle, Position, Mode)
End Function
Function _BASS_ChannelGetTags(Handle As DWORD, Tags As DWORD) As Any Ptr
Return BASS_ChannelGetTags(Handle, Tags)
End Function
'ChannelFX--------------------------------------------------------------------------------------------------------------------------------------
Function _BASS_ChannelSetFX(Handle As DWORD, _Type As DWORD, Priority As Integer = 0) As HFX
Return BASS_ChannelSetFX(Handle, _Type, Priority)
End Function
Function _BASS_FXSetParameters(Handle As HFX, Params As Any Ptr) As BOOL
Return BASS_FXSetParameters(Handle, Params)
End Function
Function _BASS_FXGetParameters(Handle As HFX, Params As Any Ptr) As BOOL
Return BASS_FXGetParameters(Handle, Params)
End Function
Function _BASS_ChannelRemoveFX(Handle As DWORD, FX As HFX) As BOOL
Return BASS_ChannelRemoveFX(Handle, FX)
End Function
'Plugin-----------------------------------------------------------------------------------------------------------------------------------------
Function _BASS_PluginLoad(sFile As String, flags As DWORD = 0) As HPLUGIN
Return BASS_PluginLoad(Strptr(sFile), flags)
End Function
Function _BASS_PluginFree(hPlugin As HPLUGIN) As BOOL
Return BASS_PluginFree(hPlugin)
End Function
'-----------------------------------------------------------------------------------------------------------------------------------------------
into the same folder.
It works properly as x64 compiled.