BASS audio library v2.4.11 and PureBasic 5.31 includes

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

BASS audio library v2.4.11 and PureBasic 5.31 includes

Post by Rescator »

http://www.un4seen.com/
Click on BASS in the menu on the left, then scroll down to "Other APIs" and there you should find a download link for "Pure Basic API".
BASS is an audio library for use in Windows and Mac OSX software. Its purpose is to provide developers with powerful and efficient sample, stream (MP3, MP2, MP1, OGG, WAV, AIFF, custom generated, and more via add-ons), MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), and recording functions. All in a tiny DLL, under 100KB* in size.

On Windows, BASS requires DirectX 3 or above for output, and takes advantage of DirectSound and DirectSound3D hardware accelerated drivers, when available. On OSX, BASS uses CoreAudio for output, and OSX 10.3 or above is recommended. Both PowerPC and Intel Macs are supported.

C/C++, Delphi, Visual Basic, and MASM APIs are provided, with several examples to get you started. .Net and other APIs are also available.
The PureBasic API includes support for BASS, the BASSenc and BASSmix add-ons and constants for BASS Opus decoder and BASS AAC decoder. I will update these and any other future includes I create on a "as I need to basis", so if anyone else wish to submit includes for other BASS plugins. Or even port some of the examples to PureBasic, by all means go ahead and Ian will add those to the current PureBasic API download, just make sure to post about it on the forum so I and others are aware of it as updates to API/include packages on the BASS site is not announced normally.

Only the includes are included (pun intended), they have the constants, structures, the odd macro, some comments, and a the prototypes for the BASS fucntions, there is also a test program that shows how to get/check the version of the library and how to dynamically load the library and it's functions. The includes contains some commented C code stuff that was not directly "portable", mostly callback definitions and similar messy stuff.

Also note that BASS uses a special unicode flag on certain functions, the rest of BASS is ansi, so pay attention when passing strings to/from BASS functions as you may be juggling Unicode UTF-16 or Unicode UTF-8 or ASCII (7bit).

Personally I have found that BASS plays nicely (pun intended) with PureBasic. There is also a MacOS/Linux/Android version available but as I do not have any of those I could not check if the includes work on them, these includes are mainly Windows OS centric.


Note! I Did some changes compared to the previous includes, it should be easier to maintain the new ones as they are a little closer to the official C includes now.
User avatar
oryaaaaa
Enthusiast
Enthusiast
Posts: 780
Joined: Mon Jan 12, 2004 11:40 pm
Location: Okazaki, JAPAN

Re: BASS audio library v2.4.11 and PureBasic 5.31 includes

Post by oryaaaaa »

Bug head Emperor use follows code.

Code: Select all

CompilerIf #PB_Compiler_OS = #PB_Compiler_Unicode
  #BASS_UNICODE = $80000000
  #BASS_CONFIG_UNICODE = 42
CompilerElse
  #BASS_UNICODE = 0
  #BASS_CONFIG_UNICODE = 0
CompilerEndIf

Code: Select all

CompilerIf #PB_Compiler_OS = #PB_Compiler_Unicode
  BASS_ASIO_SetUnicode(#True)
  BASS_SetConfig(#BASS_CONFIG_UNICODE, #True)
CompilerEndIf

Code: Select all

Select dsd_play
  Case 0
    chan =  BASS_DSD_StreamCreateFile(#False, @FileName, 0, 0, #BASS_UNICODE | #BASS_STREAM_DECODE  | #BASS_SAMPLE_FLOAT | #BASS_SAMPLE_SOFTWARE , dsd_freq) 
  Case 1
    chan =  BASS_DSD_StreamCreateFile(#False, @FileName, 0, 0, #BASS_UNICODE | #BASS_STREAM_DECODE  | #BASS_DSD_RAW | #BASS_SAMPLE_SOFTWARE , 0) 
EndSelect
SeregaZ
Enthusiast
Enthusiast
Posts: 598
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: BASS audio library v2.4.11 and PureBasic 5.31 includes

Post by SeregaZ »

can you little hepl with that bass? i didnt understand how to make convert audio. i have wav in a memory PCM, 8bit, 10k frequency. i need almost same, but 5200 frequency and in memory too. i try to read help file, but not find some "encode" command.
User avatar
Roger Hågensen
User
User
Posts: 47
Joined: Wed Mar 25, 2015 1:06 pm
Location: Norway

Re: BASS audio library v2.4.11 and PureBasic 5.31 includes

Post by Roger Hågensen »

You need to do re-sampling. Also this is announcement post.
Might want to post your question in http://www.purebasic.fr/english/viewforum.php?f=13

Or visit the BASS website at http://www.un4seen.com/
In the menu on the right is the forum link for BASS.
The forums there are generally helpful just like here.
4 music albums under CC BY license available for free (any use, even commercial) at Skuldwyrm.no
Aleks_Longard
User
User
Posts: 44
Joined: Mon Dec 24, 2012 9:07 am
Location: Ukraine, Donetck

Re: BASS audio library v2.4.11 and PureBasic 5.31 includes

Post by Aleks_Longard »

I write new include file for last BASS 2.4.14

Code: Select all

; BASS 2.4.14 PureBasic header file
; Copyright (c) 1999-2019 Un4seen Developments Ltd.

#True = 1
#False = 0

#BASSVERSION = $204 ; API version
#BASSVERSIONTEXT = "2.4"

; Error codes returned by BASS_ErrorGetCode
#BASS_OK = 0 ; all is OK
#BASS_ERROR_MEM = 1 ; memory error
#BASS_ERROR_FILEOPEN = 2 ; can't open the file
#BASS_ERROR_DRIVER = 3 ; can't find a free/valid driver
#BASS_ERROR_BUFLOST = 4 ; the sample buffer was lost
#BASS_ERROR_HANDLE = 5 ; invalid handle
#BASS_ERROR_FORMAT = 6 ; unsupported sample format
#BASS_ERROR_POSITION = 7 ; invalid position
#BASS_ERROR_INIT = 8 ; BASS_Init has Not been successfully called
#BASS_ERROR_START = 9 ; BASS_Start has Not been successfully called
#BASS_ERROR_SSL = 10 ; SSL/HTTPS support isn't available
#BASS_ERROR_ALREADY = 14 ; already initialized/paused/whatever
#BASS_ERROR_NOCHAN = 18 ; can't get a free channel
#BASS_ERROR_ILLTYPE = 19 ; an illegal type was specified
#BASS_ERROR_ILLPARAM = 20 ; an illegal parameter was specified
#BASS_ERROR_NO3D = 21 ; no 3D support
#BASS_ERROR_NOEAX = 22 ; no EAX support
#BASS_ERROR_DEVICE = 23 ; illegal device number
#BASS_ERROR_NOPLAY = 24 ; Not playing
#BASS_ERROR_FREQ = 25 ; illegal sample rate
#BASS_ERROR_NOTFILE = 27 ; the stream is Not a file stream
#BASS_ERROR_NOHW = 29 ; no hardware voices available
#BASS_ERROR_EMPTY = 31 ; the MOD music has no sequence Data
#BASS_ERROR_NONET = 32 ; no internet connection could be opened
#BASS_ERROR_CREATE = 33 ; couldn't create the file
#BASS_ERROR_NOFX = 34 ; effects are Not available
#BASS_ERROR_NOTAVAIL = 37 ; requested Data/action is Not available
#BASS_ERROR_DECODE = 38 ; the channel is/isn't a "decoding channel"
#BASS_ERROR_DX = 39 ; a sufficient DirectX version is Not installed
#BASS_ERROR_TIMEOUT = 40 ; connection timedout
#BASS_ERROR_FILEFORM = 41 ; unsupported file format
#BASS_ERROR_SPEAKER = 42 ; unavailable speaker
#BASS_ERROR_VERSION = 43 ; invalid BASS version (used by add-ons)
#BASS_ERROR_CODEC = 44 ; codec is Not available/supported
#BASS_ERROR_ENDED = 45 ; the channel/file has ended
#BASS_ERROR_BUSY = 46 ; the device is busy
#BASS_ERROR_UNKNOWN = -1 ; some other mystery problem

; BASS_SetConfig options
#BASS_CONFIG_BUFFER = 0
#BASS_CONFIG_UPDATEPERIOD = 1
#BASS_CONFIG_GVOL_SAMPLE = 4
#BASS_CONFIG_GVOL_STREAM = 5
#BASS_CONFIG_GVOL_MUSIC = 6
#BASS_CONFIG_CURVE_VOL = 7
#BASS_CONFIG_CURVE_PAN = 8
#BASS_CONFIG_FLOATDSP = 9
#BASS_CONFIG_3DALGORITHM = 10
#BASS_CONFIG_NET_TIMEOUT = 11
#BASS_CONFIG_NET_BUFFER = 12
#BASS_CONFIG_PAUSE_NOPLAY = 13
#BASS_CONFIG_NET_PREBUF = 15
#BASS_CONFIG_NET_PASSIVE = 18
#BASS_CONFIG_REC_BUFFER = 19
#BASS_CONFIG_NET_PLAYLIST = 21
#BASS_CONFIG_MUSIC_VIRTUAL = 22
#BASS_CONFIG_VERIFY = 23
#BASS_CONFIG_UPDATETHREADS = 24
#BASS_CONFIG_DEV_BUFFER = 27
#BASS_CONFIG_REC_LOOPBACK = 28
#BASS_CONFIG_VISTA_TRUEPOS = 30
#BASS_CONFIG_IOS_MIXAUDIO = 34
#BASS_CONFIG_DEV_DEFAULT = 36
#BASS_CONFIG_NET_READTIMEOUT = 37
#BASS_CONFIG_VISTA_SPEAKERS = 38
#BASS_CONFIG_IOS_SPEAKER = 39
#BASS_CONFIG_MF_DISABLE = 40
#BASS_CONFIG_HANDLES = 41
#BASS_CONFIG_UNICODE = 42
#BASS_CONFIG_SRC = 43
#BASS_CONFIG_SRC_SAMPLE = 44
#BASS_CONFIG_ASYNCFILE_BUFFER = 45
#BASS_CONFIG_OGG_PRESCAN = 47
#BASS_CONFIG_MF_VIDEO = 48
#BASS_CONFIG_AIRPLAY = 49
#BASS_CONFIG_DEV_NONSTOP = 50
#BASS_CONFIG_IOS_NOCATEGORY = 51
#BASS_CONFIG_VERIFY_NET = 52
#BASS_CONFIG_DEV_PERIOD = 53
#BASS_CONFIG_FLOAT = 54
#BASS_CONFIG_NET_SEEK = 56
#BASS_CONFIG_AM_DISABLE = 58
#BASS_CONFIG_NET_PLAYLIST_DEPTH = 59
#BASS_CONFIG_NET_PREBUF_WAIT = 60
#BASS_CONFIG_WASAPI_PERSIST = 65
#BASS_CONFIG_REC_WASAPI = 66

; BASS_SetConfigPtr options
#BASS_CONFIG_NET_AGENT = 16
#BASS_CONFIG_NET_PROXY = 17
#BASS_CONFIG_IOS_NOTIFY = 46
#BASS_CONFIG_LIBSSL = 64

; BASS_Init flags
#BASS_DEVICE_8BITS = 1 ; 8 bit
#BASS_DEVICE_MONO = 2 ; mono
#BASS_DEVICE_3D = 4 ; enable 3D functionality
#BASS_DEVICE_16BITS = 8 ; limit output To 16 bit
#BASS_DEVICE_LATENCY = $100 ; calculate device latency (BASS_INFO struct)
#BASS_DEVICE_CPSPEAKERS = $400 ; detect speakers via Windows control panel
#BASS_DEVICE_SPEAKERS = $800 ; force enabling of speaker assignment
#BASS_DEVICE_NOSPEAKER = $1000 ; ignore speaker arrangement
#BASS_DEVICE_DMIX = $2000 ; use ALSA "dmix" plugin
#BASS_DEVICE_FREQ = $4000 ; set device sample rate
#BASS_DEVICE_STEREO = $8000 ; limit output To stereo
#BASS_DEVICE_HOG = $10000 ; hog/exclusive mode
#BASS_DEVICE_AUDIOTRACK = $20000 ; use AudioTrack output
#BASS_DEVICE_DSOUND = $40000 ; use DirectSound output

; DirectSound interfaces (For use With BASS_GetDSoundObject)
#BASS_OBJECT_DS = 1 ; IDirectSound
#BASS_OBJECT_DS3DL = 2 ; IDirectSound3DListener

; Device info Structure
Structure BASS_DEVICEINFO
*name ; description (char)
*driver ; driver (char)
flags.l
EndStructure

; BASS_DEVICEINFO flags
#BASS_DEVICE_ENABLED = 1
#BASS_DEVICE_DEFAULT = 2
#BASS_DEVICE_INIT = 4
#BASS_DEVICE_LOOPBACK = 8

#BASS_DEVICE_TYPE_MASK = $ff000000
#BASS_DEVICE_TYPE_NETWORK = $01000000
#BASS_DEVICE_TYPE_SPEAKERS = $02000000
#BASS_DEVICE_TYPE_LINE = $03000000
#BASS_DEVICE_TYPE_HEADPHONES = $04000000
#BASS_DEVICE_TYPE_MICROPHONE = $05000000
#BASS_DEVICE_TYPE_HEADSET = $06000000
#BASS_DEVICE_TYPE_HANDSET = $07000000
#BASS_DEVICE_TYPE_DIGITAL = $08000000
#BASS_DEVICE_TYPE_SPDIF = $09000000
#BASS_DEVICE_TYPE_HDMI = $0a000000
#BASS_DEVICE_TYPE_DISPLAYPORT = $40000000

; BASS_GetDeviceInfo flags
#BASS_DEVICES_AIRPLAY = $1000000

Structure BASS_INFO
flags.l ; device capabilities (DSCAPS_xxx flags)
hwsize.l ; size of total device hardware memory
hwfree.l ; size of free device hardware memory
freesam.l ; number of free sample slots in the hardware
free3d.l ; number of free 3D sample slots in the hardware
minrate.l ; min sample rate supported by the hardware
maxrate.l ; max sample rate supported by the hardware
eax.l ; device supports EAX? (always FALSE if BASS_DEVICE_3D was not used)
minbuf.l ; recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY)
dsver.l ; DirectSound version
latency.l ; delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY)
initflags.l ; BASS_Init "flags" parameter
speakers.l ; number of speakers available
freq.l ; current output rate
EndStructure

; BASS_INFO flags (from DSOUND.H)
#DSCAPS_CONTINUOUSRATE = $00000010 ; supports all sample rates between min/maxrate
#DSCAPS_EMULDRIVER = $00000020 ; device does Not have hardware DirectSound support
#DSCAPS_CERTIFIED = $00000040 ; device driver has been certified by Microsoft
#DSCAPS_SECONDARYMONO = $00000100 ; mono
#DSCAPS_SECONDARYSTEREO = $00000200 ; stereo
#DSCAPS_SECONDARY8BIT = $00000400 ; 8 bit
#DSCAPS_SECONDARY16BIT = $00000800 ; 16 bit

; Recording device info Structure
Structure BASS_RECORDINFO
flags.l ; device capabilities (DSCCAPS_xxx flags)
formats.l ; supported standard formats (WAVE_FORMAT_xxx flags)
inputs.l ; number of inputs
singlein.l ; TRUE = only 1 input can be set at a time
freq.l ; current input rate
EndStructure

; BASS_RECORDINFO flags (from DSOUND.H)
#DSCCAPS_EMULDRIVER = #DSCAPS_EMULDRIVER ; device does Not have hardware DirectSound recording support
#DSCCAPS_CERTIFIED = #DSCAPS_CERTIFIED ; device driver has been certified by Microsoft

; defines For formats field of BASS_RECORDINFO (from MMSYSTEM.H)
#WAVE_FORMAT_1M08 = $00000001 ; 11.025 kHz, Mono, 8-bit */
#WAVE_FORMAT_1S08 = $00000002 ; 11.025 kHz, Stereo, 8-bit */
#WAVE_FORMAT_1M16 = $00000004 ; 11.025 kHz, Mono, 16-bit */
#WAVE_FORMAT_1S16 = $00000008 ; 11.025 kHz, Stereo, 16-bit */
#WAVE_FORMAT_2M08 = $00000010 ; 22.05 kHz, Mono, 8-bit */
#WAVE_FORMAT_2S08 = $00000020 ; 22.05 kHz, Stereo, 8-bit */
#WAVE_FORMAT_2M16 = $00000040 ; 22.05 kHz, Mono, 16-bit */
#WAVE_FORMAT_2S16 = $00000080 ; 22.05 kHz, Stereo, 16-bit */
#WAVE_FORMAT_4M08 = $00000100 ; 44.1 kHz, Mono, 8-bit */
#WAVE_FORMAT_4S08 = $00000200 ; 44.1 kHz, Stereo, 8-bit */
#WAVE_FORMAT_4M16 = $00000400 ; 44.1 kHz, Mono, 16-bit */
#WAVE_FORMAT_4S16 = $00000800 ; 44.1 kHz, Stereo, 16-bit */

; Sample info Structure
Structure BASS_SAMPLE
freq.l ; default playback rate
volume.f ; default volume (0-1)
pan.f ; default pan (-1=left, 0=middle, 1=right)
flags.l ; BASS_SAMPLE_xxx flags
length.l ; length (in bytes)
max.l ; maximum simultaneous playbacks
origres.l ; original resolution
chans.l ; number of channels
mingap.l ; minimum gap (ms) between creating channels
mode3d.l ; BASS_3DMODE_xxx mode
mindist.f ; minimum distance
maxdist.f ; maximum distance
iangle.l ; angle of inside projection cone
oangle.l ; angle of outside projection cone
outvol.l ; delta-volume outside the projection cone
vam.l ; voice allocation/management flags (BASS_VAM_xxx)
priority.l ; priority (0=lowest, 0xffffffff=highest)
EndStructure

#BASS_SAMPLE_8BITS = 1 ; 8 bit
#BASS_SAMPLE_FLOAT = 256 ; 32 bit floating-point
#BASS_SAMPLE_MONO = 2 ; mono
#BASS_SAMPLE_LOOP = 4 ; looped
#BASS_SAMPLE_3D = 8 ; 3D functionality
#BASS_SAMPLE_SOFTWARE = 16 ; Not using hardware mixing
#BASS_SAMPLE_MUTEMAX = 32 ; mute at max distance (3D only)
#BASS_SAMPLE_VAM = 64 ; DX7 voice allocation & management
#BASS_SAMPLE_FX = 128 ; old implementation of DX8 effects
#BASS_SAMPLE_OVER_VOL = $10000 ; override lowest volume
#BASS_SAMPLE_OVER_POS = $20000 ; override longest playing
#BASS_SAMPLE_OVER_DIST = $30000 ; override furthest from listener (3D only)

#BASS_STREAM_PRESCAN = $20000 ; enable pin-point seeking/length (MP3/MP2/MP1)
#BASS_STREAM_AUTOFREE = $40000 ; automatically free the stream when it stop/ends
#BASS_STREAM_RESTRATE = $80000 ; restrict the download rate of internet file streams
#BASS_STREAM_BLOCK = $100000 ; download/play internet file stream in small blocks
#BASS_STREAM_DECODE = $200000 ; don't play the stream, only decode (BASS_ChannelGetData)
#BASS_STREAM_STATUS = $800000 ; give server status info (HTTP/ICY tags) in DOWNLOADPROC

#BASS_MP3_IGNOREDELAY = $200 ; ignore LAME/Xing/VBRI/iTunes delay & padding info
#BASS_MP3_SETPOS = #BASS_STREAM_PRESCAN

#BASS_MUSIC_FLOAT = #BASS_SAMPLE_FLOAT
#BASS_MUSIC_MONO = #BASS_SAMPLE_MONO
#BASS_MUSIC_LOOP = #BASS_SAMPLE_LOOP
#BASS_MUSIC_3D = #BASS_SAMPLE_3D
#BASS_MUSIC_FX = #BASS_SAMPLE_FX
#BASS_MUSIC_AUTOFREE = #BASS_STREAM_AUTOFREE
#BASS_MUSIC_DECODE = #BASS_STREAM_DECODE
#BASS_MUSIC_PRESCAN = #BASS_STREAM_PRESCAN ; calculate playback length
#BASS_MUSIC_CALCLEN = #BASS_MUSIC_PRESCAN
#BASS_MUSIC_RAMP = $200 ; normal ramping
#BASS_MUSIC_RAMPS = $400 ; sensitive ramping
#BASS_MUSIC_SURROUND = $800 ; surround sound
#BASS_MUSIC_SURROUND2 = $1000 ; surround sound (mode 2)
#BASS_MUSIC_FT2PAN = $2000 ; apply FastTracker 2 panning To XM files
#BASS_MUSIC_FT2MOD = $2000 ; play .MOD As FastTracker 2 does
#BASS_MUSIC_PT1MOD = $4000 ; play .MOD As ProTracker 1 does
#BASS_MUSIC_NONINTER = $10000 ; non-interpolated sample mixing
#BASS_MUSIC_SINCINTER = $800000 ; sinc interpolated sample mixing
#BASS_MUSIC_POSRESET = $8000 ; stop all notes when moving position
#BASS_MUSIC_POSRESETEX = $400000 ; stop all notes And reset bmp/etc when moving position
#BASS_MUSIC_STOPBACK = $80000 ; stop the music on a backwards jump effect
#BASS_MUSIC_NOSAMPLE = $100000 ; don't load the samples

; Speaker assignment flags
#BASS_SPEAKER_FRONT = $1000000 ; front speakers
#BASS_SPEAKER_REAR = $2000000 ; rear/side speakers
#BASS_SPEAKER_CENLFE = $3000000 ; center & LFE speakers (5.1)
#BASS_SPEAKER_REAR2 = $4000000 ; rear center speakers (7.1)
Macro BASS_SPEAKER_N(n)	:	(n<<24) :	EndMacro	;n'th pair of speakers (max 15)
#BASS_SPEAKER_LEFT = $10000000 ; modifier: left
#BASS_SPEAKER_RIGHT = $20000000 ; modifier: right
#BASS_SPEAKER_FRONTLEFT = #BASS_SPEAKER_FRONT | #BASS_SPEAKER_LEFT
#BASS_SPEAKER_FRONTRIGHT = #BASS_SPEAKER_FRONT | #BASS_SPEAKER_RIGHT
#BASS_SPEAKER_REARLEFT = #BASS_SPEAKER_REAR | #BASS_SPEAKER_LEFT
#BASS_SPEAKER_REARRIGHT = #BASS_SPEAKER_REAR | #BASS_SPEAKER_RIGHT
#BASS_SPEAKER_CENTER = #BASS_SPEAKER_CENLFE | #BASS_SPEAKER_LEFT
#BASS_SPEAKER_LFE = #BASS_SPEAKER_CENLFE | #BASS_SPEAKER_RIGHT
#BASS_SPEAKER_REAR2LEFT = #BASS_SPEAKER_REAR2 | #BASS_SPEAKER_LEFT
#BASS_SPEAKER_REAR2RIGHT = #BASS_SPEAKER_REAR2 | #BASS_SPEAKER_RIGHT

#BASS_ASYNCFILE = $40000000
#BASS_UNICODE = $80000000

#BASS_RECORD_PAUSE = $8000 ; start recording paused
#BASS_RECORD_ECHOCANCEL = $2000
#BASS_RECORD_AGC = $4000

; DX7 voice allocation & management flags
#BASS_VAM_HARDWARE = 1
#BASS_VAM_SOFTWARE = 2
#BASS_VAM_TERM_TIME = 4
#BASS_VAM_TERM_DIST = 8
#BASS_VAM_TERM_PRIO = 16

; Channel info Structure
Structure BASS_CHANNELINFO
freq.l ; default playback rate
chans.l ; channels
flags.l ; BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags
ctype.l ; type of channel
origres.l ; original resolution
plugin.l ; plugin
sample.l ; sample
*filename ; filename
EndStructure

#BASS_ORIGRES_FLOAT = $10000

; BASS_CHANNELINFO types
#BASS_CTYPE_SAMPLE = 1
#BASS_CTYPE_RECORD = 2
#BASS_CTYPE_STREAM = $10000
#BASS_CTYPE_STREAM_OGG = $10002
#BASS_CTYPE_STREAM_MP1 = $10003
#BASS_CTYPE_STREAM_MP2 = $10004
#BASS_CTYPE_STREAM_MP3 = $10005
#BASS_CTYPE_STREAM_AIFF = $10006
#BASS_CTYPE_STREAM_CA = $10007
#BASS_CTYPE_STREAM_MF = $10008
#BASS_CTYPE_STREAM_AM = $10009
#BASS_CTYPE_STREAM_DUMMY = $18000
#BASS_CTYPE_STREAM_DEVICE = $18001
#BASS_CTYPE_STREAM_WAV = $40000 ; WAVE flag, LOWORD=codec
#BASS_CTYPE_STREAM_WAV_PCM = $50001
#BASS_CTYPE_STREAM_WAV_FLOAT = $50003
#BASS_CTYPE_MUSIC_MOD = $20000
#BASS_CTYPE_MUSIC_MTM = $20001
#BASS_CTYPE_MUSIC_S3M = $20002
#BASS_CTYPE_MUSIC_XM = $20003
#BASS_CTYPE_MUSIC_IT = $20004
#BASS_CTYPE_MUSIC_MO3 = $00100 ; MO3 flag

Structure BASS_PLUGINFORM
ctype.l ; channel type
*name ; format description
*exts ; file extension filter (*.ext1;*.ext2;etc...)
EndStructure

Structure BASS_PLUGININFO
version.l ; version (same form as BASS_GetVersion)
formatc.l ; number of formats
*formats.BASS_PLUGINFORM ; the array of formats
 EndStructure

; 3D vector (For 3D positions/velocities/orientations)
Structure BASS_3DVECTOR
x.f; +=right, -=left
y.f ; +=up, -=down
z.f ; +=front, -=behind
EndStructure

; 3D channel modes
#BASS_3DMODE_NORMAL = 0 ; normal 3D processing
#BASS_3DMODE_RELATIVE = 1 ; position is relative To the listener
#BASS_3DMODE_OFF = 2 ; no 3D processing

; software 3D mixing algorithms (used With BASS_CONFIG_3DALGORITHM)
#BASS_3DALG_DEFAULT = 0
#BASS_3DALG_OFF = 1
#BASS_3DALG_FULL = 2
#BASS_3DALG_LIGHT = 3

; EAX environments, use With BASS_SetEAXParameters
Enumeration 0
#EAX_ENVIRONMENT_GENERIC
#EAX_ENVIRONMENT_PADDEDCELL
#EAX_ENVIRONMENT_ROOM
#EAX_ENVIRONMENT_BATHROOM
#EAX_ENVIRONMENT_LIVINGROOM
#EAX_ENVIRONMENT_STONEROOM
#EAX_ENVIRONMENT_AUDITORIUM
#EAX_ENVIRONMENT_CONCERTHALL
#EAX_ENVIRONMENT_CAVE
#EAX_ENVIRONMENT_ARENA
#EAX_ENVIRONMENT_HANGAR
#EAX_ENVIRONMENT_CARPETEDHALLWAY
#EAX_ENVIRONMENT_HALLWAY
#EAX_ENVIRONMENT_STONECORRIDOR
#EAX_ENVIRONMENT_ALLEY
#EAX_ENVIRONMENT_FOREST
#EAX_ENVIRONMENT_CITY
#EAX_ENVIRONMENT_MOUNTAINS
#EAX_ENVIRONMENT_QUARRY
#EAX_ENVIRONMENT_PLAIN
#EAX_ENVIRONMENT_PARKINGLOT
#EAX_ENVIRONMENT_SEWERPIPE
#EAX_ENVIRONMENT_UNDERWATER
#EAX_ENVIRONMENT_DRUGGED
#EAX_ENVIRONMENT_DIZZY
#EAX_ENVIRONMENT_PSYCHOTIC

#EAX_ENVIRONMENT_COUNT ; total number of environments
EndEnumeration

; EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx)
Macro EAX_ENVIRONMENT_GENERIC : #EAX_PRESET_GENERIC, 0.5F, 1.493F, 0.5F : EndMacro
Macro EAX_ENVIRONMENT_PADDEDCELL : #EAX_PRESET_PADDEDCELL, 0.25F, 0.1F, 0.0F : EndMacro
Macro EAX_ENVIRONMENT_ROOM : #EAX_PRESET_ROOM, 0.417F, 0.4F, 0.666F : EndMacro
Macro EAX_ENVIRONMENT_BATHROOM : #EAX_PRESET_BATHROOM, 0.653F, 1.499F, 0.166F : EndMacro
Macro EAX_ENVIRONMENT_LIVINGROOM : #EAX_PRESET_LIVINGROOM, 0.208F, 0.478F, 0.0F : EndMacro
Macro EAX_ENVIRONMENT_STONEROOM : #EAX_PRESET_STONEROOM,0.5F,2.309F,0.888F : EndMacro
Macro EAX_ENVIRONMENT_AUDITORIUM : #EAX_PRESET_AUDITORIUM,0.403F,4.279F,0.5F : EndMacro
Macro EAX_ENVIRONMENT_CONCERTHALL : #EAX_PRESET_CONCERTHALL,0.5F,3.961F,0.5F : EndMacro
Macro EAX_ENVIRONMENT_CAVE : #EAX_PRESET_CAVE,0.5F,2.886F,1.304F : EndMacro
Macro EAX_ENVIRONMENT_ARENA : #EAX_PRESET_ARENA,0.361F,7.284F,0.332F : EndMacro
Macro EAX_ENVIRONMENT_HANGAR : #EAX_PRESET_HANGAR,0.5F,10.0F,0.3F : EndMacro
Macro EAX_ENVIRONMENT_CARPETEDHALLWAY : #EAX_PRESET_CARPETEDHALLWAY 
,0.153F,0.259F,2.0F : EndMacro
Macro EAX_ENVIRONMENT_HALLWAY : #EAX_PRESET_HALLWAY,0.361F,1.493F,0.0F : EndMacro
Macro EAX_ENVIRONMENT_STONECORRIDOR : #EAX_PRESET_STONECORRIDOR,0.444F,2.697F,0.638F : EndMacro
Macro EAX_ENVIRONMENT_ALLEY : #EAX_PRESET_ALLEY,0.25F,1.752F,0.776F : EndMacro
Macro EAX_ENVIRONMENT_FOREST : #EAX_PRESET_FOREST,0.111F,3.145F,0.472F : EndMacro
Macro EAX_ENVIRONMENT_CITY : #EAX_PRESET_CITY,0.111F,2.767F,0.224F : EndMacro
Macro EAX_ENVIRONMENT_MOUNTAINS : #EAX_PRESET_MOUNTAINS,0.194F,7.841F,0.472F : EndMacro
Macro EAX_ENVIRONMENT_QUARRY : #EAX_PRESET_QUARRY,1.0F,1.499F,0.5F : EndMacro
Macro EAX_ENVIRONMENT_PLAIN : #EAX_PRESET_PLAIN,0.097F,2.767F,0.224F : EndMacro
Macro EAX_ENVIRONMENT_PARKINGLOT : #EAX_PRESET_PARKINGLOT,0.208F,1.652F,1.5F : EndMacro
Macro EAX_ENVIRONMENT_SEWERPIPE : #EAX_PRESET_SEWERPIPE,0.652F,2.886F,0.25F : EndMacro
Macro EAX_ENVIRONMENT_UNDERWATER : #EAX_PRESET_UNDERWATER,1.0F,1.499F,0.0F : EndMacro
Macro EAX_ENVIRONMENT_DRUGGED : #EAX_PRESET_DRUGGED,0.875F,8.392F,1.388F : EndMacro
Macro EAX_ENVIRONMENT_DIZZY : #EAX_PRESET_DIZZY,0.139F,17.234F,0.666F : EndMacro
Macro EAX_ENVIRONMENT_PSYCHOTIC : #EAX_PRESET_PSYCHOTIC,0.486F,7.563F,0.806F : EndMacro

Prototype.l STREAMPROC(handle.l, *buffer, length.l, *user)
; User stream callback function. NOTE: A stream function should obviously be As quick
; As possible, other streams (And MOD musics) can't be mixed until it's finished.
; handle : The stream that needs writing
; buffer : Buffer To write the samples in
; length : Number of bytes To write
; user : The 'user' parameter value given when calling BASS_StreamCreate
; Return : Number of bytes written. Set the BASS_STREAMPROC_END flag To End the stream. */

#BASS_STREAMPROC_END = $80000000 ; End of user stream flag

; special STREAMPROCs
; #STREAMPROC_DUMMY (STREAMPROC*)0 ; "dummy" stream
; #STREAMPROC_PUSH (STREAMPROC*)-1 ; push stream
; #STREAMPROC_DEVICE (STREAMPROC*)-2 ; device mix stream
; #STREAMPROC_DEVICE_3D (STREAMPROC*)-3 ; device 3D mix stream

; BASS_StreamCreateFileUser file systems
#STREAMFILE_NOBUFFER = 0
#STREAMFILE_BUFFER = 1
#STREAMFILE_BUFFERPUSH = 2

; User file stream callback functions
Prototype.i FILECLOSEPROC(*user)
Prototype.q FILELENPROC(*user)
Prototype.l FILEREADPROC(*buffer, length.l, *user)
Prototype.l FILESEEKPROC(offset.q, *user)

Structure BASS_FILEPROCS
*close
*length
*Read
*seek
EndStructure
 
; BASS_StreamPutFileData options
#BASS_FILEDATA_END = 0 ; End & close the file

; BASS_StreamGetFilePosition modes
#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

Prototype.l DOWNLOADPROC(*buffer, length.l, *user)
; Internet stream download callback function.
; buffer : Buffer containing the downloaded Data... NULL=End of download
; length : Number of bytes in the buffer
; user : The 'user' parameter value given when calling BASS_StreamCreateURL */

; BASS_ChannelSetSync types
#BASS_SYNC_POS = 0
#BASS_SYNC_END = 2
#BASS_SYNC_META = 4
#BASS_SYNC_SLIDE = 5
#BASS_SYNC_STALL = 6
#BASS_SYNC_DOWNLOAD = 7
#BASS_SYNC_FREE = 8
#BASS_SYNC_SETPOS = 11
#BASS_SYNC_MUSICPOS = 10
#BASS_SYNC_MUSICINST = 1
#BASS_SYNC_MUSICFX = 3
#BASS_SYNC_OGG_CHANGE = 12
#BASS_SYNC_DEV_FAIL = 14
#BASS_SYNC_DEV_FORMAT = 15
#BASS_SYNC_MIXTIME = $40000000 ; flag: sync at mixtime, Else at playtime
#BASS_SYNC_ONETIME  = $80000000 ; flag: sync only once, Else continuously

Prototype.i SYNCPROC(handle.l, channel.l, udata.l, *user)
; Sync callback function. NOTE: a sync callback function should be very
; quick As other syncs can't be processed until it has finished. If the sync
; is a "mixtime" sync, then other streams And MOD musics can't be mixed until
; it's finished either.
; handle : The sync that has occured
; channel: Channel that the sync occured in
; Data : Additional Data associated With the sync's occurance
; user : The 'user' parameter given when calling BASS_ChannelSetSync */

Prototype.i DSPPROC(handle.l, channel.l, *buffer, length.l, *user)
; DSP callback function. NOTE: A DSP function should obviously be As quick As
; possible... other DSP functions, streams And MOD musics can Not be processed
; Until it's finished.
; handle : The DSP handle
; channel: Channel that the DSP is being applied To
; buffer : Buffer To apply the DSP To
; length : Number of bytes in the buffer
; user : The 'user' parameter given when calling BASS_ChannelSetDSP */

Prototype.l RECORDPROC(handle.l, *buffer, length.l, *user)
;  Recording callback function.
; handle : The recording handle
; buffer : Buffer containing the recorded sample Data
; length : Number of bytes
; user : The 'user' parameter value given when calling BASS_RecordStart
; Return : TRUE = Continue recording, FALSE = stop */

; BASS_ChannelIsActive Return values
#BASS_ACTIVE_STOPPED = 0
#BASS_ACTIVE_PLAYING = 1
#BASS_ACTIVE_STALLED = 2
#BASS_ACTIVE_PAUSED = 3
#BASS_ACTIVE_PAUSED_DEVICE = 4

; Channel attributes
#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 = $100
#BASS_ATTRIB_MUSIC_PANSEP = $101
#BASS_ATTRIB_MUSIC_PSCALER = $102
#BASS_ATTRIB_MUSIC_BPM = $103
#BASS_ATTRIB_MUSIC_SPEED = $104
#BASS_ATTRIB_MUSIC_VOL_GLOBAL = $105
#BASS_ATTRIB_MUSIC_ACTIVE = $106
#BASS_ATTRIB_MUSIC_VOL_CHAN = $200 ; + channel #
#BASS_ATTRIB_MUSIC_VOL_INST = $300 ; + instrument #

; BASS_ChannelSlideAttribute flags
#BASS_SLIDE_LOG = $1000000

; BASS_ChannelGetData flags
#BASS_DATA_AVAILABLE = 0 ; query how much Data is buffered
#BASS_DATA_FIXED = $20000000 ; flag: Return 8.24 fixed-point Data
#BASS_DATA_FLOAT = $40000000 ; flag: Return floating-point sample Data
#BASS_DATA_FFT256 = $80000000 ; 256 sample FFT
#BASS_DATA_FFT512 = $80000001 ; 512 FFT
#BASS_DATA_FFT1024 = $80000002 ; 1024 FFT
#BASS_DATA_FFT2048 = $80000003 ; 2048 FFT
#BASS_DATA_FFT4096 = $80000004 ; 4096 FFT
#BASS_DATA_FFT8192 = $80000005 ; 8192 FFT
#BASS_DATA_FFT16384 = $80000006 ; 16384 FFT
#BASS_DATA_FFT32768 = $80000007 ; 32768 FFT
#BASS_DATA_FFT_INDIVIDUAL = $10 ; FFT flag: FFT For each channel, Else all combined
#BASS_DATA_FFT_NOWINDOW = $20 ; FFT flag: no Hanning window
#BASS_DATA_FFT_REMOVEDC = $40 ; FFT flag: pre-remove DC bias
#BASS_DATA_FFT_COMPLEX = $80 ; FFT flag: Return complex Data
#BASS_DATA_FFT_NYQUIST = $100 ; FFT flag: Return extra Nyquist value

; BASS_ChannelGetLevelEx flags
#BASS_LEVEL_MONO = 1
#BASS_LEVEL_STEREO = 2
#BASS_LEVEL_RMS = 4
#BASS_LEVEL_VOLPAN = 8

; BASS_ChannelGetTags types : what's returned
#BASS_TAG_ID3 = 0 ; ID3v1 tags : TAG_ID3 Structure
#BASS_TAG_ID3V2 = 1 ; ID3v2 tags : variable length block
#BASS_TAG_OGG = 2 ; OGG comments : series of null-terminated UTF-8 strings
#BASS_TAG_HTTP = 3 ; HTTP headers : series of null-terminated ANSI strings
#BASS_TAG_ICY = 4 ; ICY headers : series of null-terminated ANSI strings
#BASS_TAG_META = 5 ; ICY metadata : ANSI string
#BASS_TAG_APE = 6 ; APE tags : series of null-terminated UTF-8 strings
#BASS_TAG_MP4 = 7 ; MP4/iTunes metadata : series of null-terminated UTF-8 strings
#BASS_TAG_WMA = 8 ; WMA tags : series of null-terminated UTF-8 strings
#BASS_TAG_VENDOR = 9 ; OGG encoder : UTF-8 string
#BASS_TAG_LYRICS3 = 10 ; Lyric3v2 tag : ASCII string
#BASS_TAG_CA_CODEC = 11 ; CoreAudio codec info : TAG_CA_CODEC Structure
#BASS_TAG_MF = 13 ; Media Foundation tags : series of null-terminated UTF-8 strings
#BASS_TAG_WAVEFORMAT = 14 ; WAVE format : WAVEFORMATEEX Structure
#BASS_TAG_AM_MIME = 15 ; Android Media MIME type : ASCII string
#BASS_TAG_AM_NAME = 16 ; Android Media codec name : ASCII string
#BASS_TAG_RIFF_INFO = $100 ; RIFF "INFO" tags : series of null-terminated ANSI strings
#BASS_TAG_RIFF_BEXT = $101 ; RIFF/BWF "bext" tags : TAG_BEXT Structure
#BASS_TAG_RIFF_CART = $102 ; RIFF/BWF "cart" tags : TAG_CART Structure
#BASS_TAG_RIFF_DISP = $103 ; RIFF "DISP" text tag : ANSI string
#BASS_TAG_RIFF_CUE = $104 ; RIFF "cue " chunk : TAG_CUE Structure
#BASS_TAG_RIFF_SMPL = $105 ; RIFF "smpl" chunk : TAG_SMPL Structure
#BASS_TAG_APE_BINARY = $1000 ; + index #, binary APE tag : TAG_APE_BINARY Structure
#BASS_TAG_MUSIC_NAME = $10000 ; MOD music name : ANSI string
#BASS_TAG_MUSIC_MESSAGE = $10001 ; MOD message : ANSI string
#BASS_TAG_MUSIC_ORDERS = $10002 ; MOD order List : BYTE Array of pattern numbers
#BASS_TAG_MUSIC_AUTH = $10003 ; MOD author : UTF-8 string
#BASS_TAG_MUSIC_INST = $10100 ; + instrument #, MOD instrument name : ANSI string
#BASS_TAG_MUSIC_SAMPLE = $10300 ; + sample #, MOD sample name : ANSI string

; ID3v1 tag Structure
Structure TAG_ID3
id.a[3]
title.a[30]
artist.a[30]
album.a[30]
year.a[4]
comment.a[30]
genre.b
EndStructure

; Binary APE tag Structure
Structure TAG_APE_BINARY
*key
*Data
length.l
EndStructure

; BWF "bext" tag Structure
Structure TAG_BEXT
Description.a[256] ; description
Originator.a[32] ; name of the originator
OriginatorReference.a[32] ; reference of the originator
OriginationDate.a[10] ; date of creation (yyyy-mm-dd)
OriginationTime.a[8] ; time of creation (hh-mm-ss)
TimeReference.q ; first sample count since midnight (little-endian)
Version.w ; BWF version (little-endian)
UMID.b[64] ; SMPTE UMID
Reserved.b[190]
EndStructure

; BWF "cart" tag structures

Structure TAG_CART_TIMER
dwUsage.l ; FOURCC timer usage ID
dwValue.l ; timer value in samples from head
EndStructure

Structure TAG_CART
Version.a[4] ; version of the data structure
Title.a[64] ; title of cart audio sequence
Artist.a[64] ; artist or creator name
CutID.a[64] ; cut number identification
ClientID.a[64] ; client identification
Category.a[64] ; category ID, PSA, NEWS, etc
Classification.a[64] ; classification or auxiliary key
OutCue.a[64] ; out cue text
StartDate.a[10] ; yyyy-mm-dd
StartTime.a[8] ; hh:mm:ss
EndDate.a[10] ; yyyy-mm-dd
EndTime.a[8] ; hh:mm:ss
ProducerAppID.a[64] ; name of vendor or application
ProducerAppVersion.a[64] ; version of producer application
UserDef.a[64] ; user defined text
dwLevelReference.l ; sample value for 0 dB reference
PostTimer.TAG_CART_TIMER[8] ; 8 time markers after head
Reserved.a[276]
URL.a[1024] ; uniform resource locator
TagText.a[1] ; free form text for scripts or tags
EndStructure

; RIFF "cue " tag structures
Structure TAG_CUE_POINT
dwName.l
dwPosition.l
fccChunk.l
dwChunkStart.l
dwBlockStart.l
dwSampleOffset.l
EndStructure

Structure TAG_CUE
dwCuePoints.l
CuePoints.TAG_CUE_POINT[1]
EndStructure

; RIFF "smpl" tag structures
Structure TAG_SMPL_LOOP
 dwIdentifier.l
dwType.l
dwStart.l
dwEnd.l
dwFraction.l
dwPlayCount.l
EndStructure

Structure TAG_SMPL
dwManufacturer.l
dwProduct.l
dwSamplePeriod.l
dwMIDIUnityNote.l
dwMIDIPitchFraction.l
dwSMPTEFormat.l
dwSMPTEOffset.l
cSampleLoops.l
cbSamplerData.l
SampleLoops.TAG_SMPL_LOOP[1]
EndStructure

; CoreAudio codec info Structure
Structure TAG_CA_CODEC
ftype.l ; file format
atype.l ; audio format
*name ; description
EndStructure

CompilerIf Defined(WAVEFORMATEX, #PB_Structure) = #False
	Structure WAVEFORMATEX
wFormatTag.u
nChannels.u
nSamplesPerSec.l
nAvgBytesPerSec.l
nBlockAlign.u
wBitsPerSample.u
cbSize.u
EndStructure
CompilerEndIf

; BASS_ChannelGetLength/GetPosition/SetPosition modes
#BASS_POS_BYTE = 0 ; byte position
#BASS_POS_MUSIC_ORDER = 1 ; order.row position, MAKELONG(order,row)
#BASS_POS_OGG = 3 ; OGG bitstream number
#BASS_POS_RESET = $2000000 ; flag: reset user file buffers
#BASS_POS_RELATIVE = $4000000 ; flag: seek relative To the current position
#BASS_POS_INEXACT = $8000000 ; flag: allow seeking To inexact position
#BASS_POS_DECODE = $10000000 ; flag: get the decoding (Not playing) position
#BASS_POS_DECODETO = $20000000 ; flag: decode To the position instead of seeking
#BASS_POS_SCAN = $40000000 ; flag: scan To the position

; BASS_ChannelSetDevice/GetDevice option
#BASS_NODEVICE = $20000

; BASS_RecordSetInput flags
#BASS_INPUT_OFF = $10000
#BASS_INPUT_ON = $20000
#BASS_INPUT_TYPE_MASK = $ff000000
#BASS_INPUT_TYPE_UNDEF = $00000000
#BASS_INPUT_TYPE_DIGITAL = $01000000
#BASS_INPUT_TYPE_LINE = $02000000
#BASS_INPUT_TYPE_MIC = $03000000
#BASS_INPUT_TYPE_SYNTH = $04000000
#BASS_INPUT_TYPE_CD = $05000000
#BASS_INPUT_TYPE_PHONE = $06000000
#BASS_INPUT_TYPE_SPEAKER = $07000000
#BASS_INPUT_TYPE_WAVE = $08000000
#BASS_INPUT_TYPE_AUX = $09000000
#BASS_INPUT_TYPE_ANALOG = $0a000000

; BASS_ChannelSetFX effect types
#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

Structure BASS_DX8_CHORUS
fWetDryMix.f
fDepth.f
fFeedback.f
fFrequency.f
lWaveform.l ; 0=triangle, 1=sine
fDelay.f
lPhase.l ; BASS_DX8_PHASE_xxx
 EndStructure
 
Structure BASS_DX8_COMPRESSOR
fGain.f
fAttack.f
fRelease.f
fThreshold.f
fRatio.f
fPredelay.f
EndStructure

Structure BASS_DX8_DISTORTION
fGain.f
fEdge.f
fPostEQCenterFrequency.f
fPostEQBandwidth.f
fPreLowpassCutoff.f
EndStructure

Structure BASS_DX8_ECHO
fWetDryMix.f
fFeedback.f
fLeftDelay.f
fRightDelay.f
lPanDelay.l
EndStructure

Structure BASS_DX8_FLANGER
fWetDryMix.f
fDepth.f
fFeedback.f
fFrequency.f
lWaveform.l ; 0=triangle, 1=sine
fDelay.f
lPhase.l ; BASS_DX8_PHASE_xxx
EndStructure

Structure BASS_DX8_GARGLE
dwRateHz.l ; Rate of modulation in hz
dwWaveShape.l ; 0=triangle, 1=square
EndStructure

Structure BASS_DX8_I3DL2REVERB
lRoom.i ; [-10000, 0] default: -1000 mB
lRoomHF.i ; [-10000, 0] default: 0 mB
flRoomRolloffFactor.f ; [0.0, 10.0] default: 0.0
flDecayTime.f ; [0.1, 20.0] default: 1.49s
flDecayHFRatio.f ; [0.1, 2.0] default: 0.83
lReflections.i ; [-10000, 1000] default: -2602 mB
flReflectionsDelay.f ; [0.0, 0.3] default: 0.007 s
lReverb.i ; [-10000, 2000] default: 200 mB
flReverbDelay.f ; [0.0, 0.1] default: 0.011 s
flDiffusion.f ; [0.0, 100.0] default: 100.0 %
flDensity.f ; [0.0, 100.0] default: 100.0 %
flHFReference.f ; [20.0, 20000.0] default: 5000.0 Hz
EndStructure

Structure BASS_DX8_PARAMEQ
fCenter.f
fBandwidth.f
fGain.f
EndStructure

Structure BASS_DX8_REVERB
fInGain.f ; [-96.0,0.0] default: 0.0 dB
fReverbMix.f ; [-96.0,0.0] default: 0.0 db
fReverbTime.f ; [0.001,3000.0] default: 1000.0 ms
fHighFreqRTRatio.f ; [0.001,0.999] default: 0.001
EndStructure

#BASS_DX8_PHASE_NEG_180 = 0
#BASS_DX8_PHASE_NEG_90 = 1
#BASS_DX8_PHASE_ZERO = 2
#BASS_DX8_PHASE_90 = 3
#BASS_DX8_PHASE_180 = 4

Structure BASS_FX_VOLUME_PARAM
fTarget.f
fCurrent.f
fTime.f
lCurve.l
EndStructure

Define bass_library_ = OpenLibrary(#PB_Any, "bass.dll")

Prototype.l BASS_SetConfig(option.l, value.l)
Global BASS_SetConfig.BASS_SetConfig = GetFunction(bass_library_, "BASS_SetConfig")

Prototype.l BASS_GetConfig(option.l)
Global BASS_GetConfig.BASS_GetConfig = GetFunction(bass_library_, "BASS_GetConfig")

Prototype.l BASS_SetConfigPtr(option.l, *value)
Global BASS_SetConfigPtr.BASS_SetConfigPtr = GetFunction(bass_library_, "BASS_SetConfigPtr")

Prototype.i BASS_GetConfigPtr(option.l)
Global BASS_GetConfigPtr.BASS_GetConfigPtr = GetFunction(bass_library_, "BASS_GetConfigPtr")

Prototype.l BASS_GetVersion()
Global BASS_GetVersion.BASS_GetVersion = GetFunction(bass_library_, "BASS_GetVersion")

Prototype.l BASS_ErrorGetCode()
Global BASS_ErrorGetCode.BASS_ErrorGetCode = GetFunction(bass_library_, "BASS_ErrorGetCode")

Prototype.l BASS_GetDeviceInfo(device.l, *BASS_DEVICEINFO)
Global BASS_GetDeviceInfo.BASS_GetDeviceInfo = GetFunction(bass_library_, "BASS_GetDeviceInfo")

Prototype.l BASS_Init(device.l, freq.l, flags.l, *win, *dsguid)
Global BASS_Init.BASS_Init = GetFunction(bass_library_, "BASS_Init")

Prototype.l BASS_SetDevice(device.l)
Global BASS_SetDevice.BASS_SetDevice = GetFunction(bass_library_, "BASS_SetDevice")

Prototype.l BASS_GetDevice()
Global BASS_GetDevice.BASS_GetDevice = GetFunction(bass_library_, "BASS_GetDevice")

Prototype.l BASS_Free()
Global BASS_Free.BASS_Free = GetFunction(bass_library_, "BASS_Free")

CompilerIf #PB_Compiler_OS = #PB_OS_Windows
	Prototype.i BASS_GetDSoundObject(object.l)
Global BASS_GetDSoundObject.BASS_GetDSoundObject = GetFunction(bass_library_, "BASS_GetDSoundObject")
CompilerEndIf

Prototype.l BASS_GetInfo(*BASS_INFO)
Global BASS_GetInfo.BASS_GetInfo = GetFunction(bass_library_, "BASS_GetInfo")

Prototype.l BASS_Update(length.l)
Global BASS_Update.BASS_Update = GetFunction(bass_library_, "BASS_Update")

Prototype.f BASS_GetCPU()
Global BASS_GetCPU.BASS_GetCPU = GetFunction(bass_library_, "BASS_GetCPU")

Prototype.l BASS_Start()
Global BASS_Start.BASS_Start = GetFunction(bass_library_, "BASS_Start")

Prototype.l BASS_Stop()
Global BASS_Stop.BASS_Stop = GetFunction(bass_library_, "BASS_Stop")

Prototype.l BASS_Pause()
Global BASS_Pause.BASS_Pause = GetFunction(bass_library_, "BASS_Pause")

Prototype.l BASS_IsStarted()
Global BASS_IsStarted.BASS_IsStarted = GetFunction(bass_library_, "BASS_IsStarted")

Prototype.l BASS_SetVolume(volume.f)
Global BASS_SetVolume.BASS_SetVolume = GetFunction(bass_library_, "BASS_SetVolume")

Prototype.f BASS_GetVolume()
Global BASS_GetVolume.BASS_GetVolume = GetFunction(bass_library_, "BASS_GetVolume")

Prototype.l BASS_PluginLoad(*file, flags.l)
Global BASS_PluginLoad.BASS_PluginLoad = GetFunction(bass_library_, "BASS_PluginLoad")

Prototype.l BASS_PluginFree(handle.l)
Global BASS_PluginFree.BASS_PluginFree = GetFunction(bass_library_, "BASS_PluginFree")

Prototype.i BASS_PluginGetInfo(handle.l)
Global BASS_PluginGetInfo.BASS_PluginGetInfo = GetFunction(bass_library_, "BASS_PluginGetInfo")

Prototype.l BASS_Set3DFactors(distf.f, rollf.f, doppf.f)
Global BASS_Set3DFactors.BASS_Set3DFactors = GetFunction(bass_library_, "BASS_Set3DFactors")

Prototype.l BASS_Get3DFactors(*distf, *rollf, *doppf)
Global BASS_Get3DFactors.BASS_Get3DFactors = GetFunction(bass_library_, "BASS_Get3DFactors")

Prototype.l BASS_Set3DPosition(*pos, *vel, *front, *top)
Global BASS_Set3DPosition.BASS_Set3DPosition = GetFunction(bass_library_, "BASS_Set3DPosition")

Prototype.l BASS_Get3DPosition(*pos, *vel, *front, *top)
Global BASS_Get3DPosition.BASS_Get3DPosition = GetFunction(bass_library_, "BASS_Get3DPosition")

Prototype.i BASS_Apply3D()
Global BASS_Apply3D.BASS_Apply3D = GetFunction(bass_library_, "BASS_Apply3D")

CompilerIf #PB_Compiler_OS = #PB_OS_Windows
Prototype.l BASS_SetEAXParameters(env.l, vol.f, decay.f, damp.f)
Global BASS_SetEAXParameters.BASS_SetEAXParameters = GetFunction(bass_library_, "BASS_SetEAXParameters")

Prototype.l BASS_GetEAXParameters(*env, *vol, *decay, *damp)
Global BASS_GetEAXParameters.BASS_GetEAXParameters = GetFunction(bass_library_, "BASS_GetEAXParameters")
CompilerEndIf

Prototype.l BASS_MusicLoad(mem.l, *file, offset.q, length.l, flags.l, freq.l)
Global BASS_MusicLoad.BASS_MusicLoad = GetFunction(bass_library_, "BASS_MusicLoad")

Prototype.l BASS_MusicFree(handle.l)
Global BASS_MusicFree.BASS_MusicFree = GetFunction(bass_library_, "BASS_MusicFree")

Prototype.l BASS_SampleLoad(mem.l, *file, offset.q, length.l, max.l, flags.l)
Global BASS_SampleLoad.BASS_SampleLoad = GetFunction(bass_library_, "BASS_SampleLoad")

Prototype.l BASS_SampleCreate(length.l, freq.l, chans.l, max.l, flags.l)
Global BASS_SampleCreate.BASS_SampleCreate = GetFunction(bass_library_, "BASS_SampleCreate")

Prototype.l BASS_SampleFree(handle.l)
Global BASS_SampleFree.BASS_SampleFree = GetFunction(bass_library_, "BASS_SampleFree")

Prototype.l BASS_SampleSetData(handle.l, *buffer)
Global BASS_SampleSetData.BASS_SampleSetData = GetFunction(bass_library_, "BASS_SampleSetData")

Prototype.l BASS_SampleGetData(handle.l, *buffer)
Global BASS_SampleGetData.BASS_SampleGetData = GetFunction(bass_library_, "BASS_SampleGetData")

Prototype.l BASS_SampleGetInfo(handle.l, *info);
Global BASS_SampleGetInfo.BASS_SampleGetInfo = GetFunction(bass_library_, "BASS_SampleGetInfo")

Prototype.l BASS_SampleSetInfo(handle.l, *info)
Global BASS_SampleSetInfo.BASS_SampleSetInfo = GetFunction(bass_library_, "BASS_SampleSetInfo")

Prototype.l BASS_SampleGetChannel(handle.l, onlynew.l)
Global BASS_SampleGetChannel.BASS_SampleGetChannel = GetFunction(bass_library_, "BASS_SampleGetChannel")

Prototype.l BASS_SampleGetChannels(handle.l, *channels)
Global BASS_SampleGetChannels.BASS_SampleGetChannels = GetFunction(bass_library_, "BASS_SampleGetChannels")

Prototype.l BASS_SampleStop(handle.l)
Global BASS_SampleStop.BASS_SampleStop = GetFunction(bass_library_, "BASS_SampleStop")

Prototype.l BASS_StreamCreate(freq.l, chans.l, flags.l, *proc, *user)
Global BASS_StreamCreate.BASS_StreamCreate = GetFunction(bass_library_, "BASS_StreamCreate")

Prototype.l BASS_StreamCreateFile(mem.l, *file, offset.q, length.q, flags.l)
Global BASS_StreamCreateFile.BASS_StreamCreateFile = GetFunction(bass_library_, "BASS_StreamCreateFile")

Prototype.l BASS_StreamCreateURL(*url, offset.l, flags.l, *proc, *user)
Global BASS_StreamCreateURL.BASS_StreamCreateURL = GetFunction(bass_library_, "BASS_StreamCreateURL")

Prototype.l BASS_StreamCreateFileUser(system.l, flags.l, *proc, *user)
Global BASS_StreamCreateFileUser.BASS_StreamCreateFileUser = GetFunction(bass_library_, "BASS_StreamCreateFileUser")

Prototype.l BASS_StreamFree(handle.l)
Global BASS_StreamFree.BASS_StreamFree = GetFunction(bass_library_, "BASS_StreamFree")

Prototype.q BASS_StreamGetFilePosition(handle.l, mode.l)
Global BASS_StreamGetFilePosition.BASS_StreamGetFilePosition = GetFunction(bass_library_, "BASS_StreamGetFilePosition")

Prototype.l BASS_StreamPutData(handle.l, *buffer, length.l)
Global BASS_StreamPutData.BASS_StreamPutData = GetFunction(bass_library_, "BASS_StreamPutData")

Prototype.l BASS_StreamPutFileData(handle.l, *buffer, length.l)
Global BASS_StreamPutFileData.BASS_StreamPutFileData = GetFunction(bass_library_, "BASS_StreamPutFileData")

Prototype.l BASS_RecordGetDeviceInfo(device.l, *info)
Global BASS_RecordGetDeviceInfo.BASS_RecordGetDeviceInfo = GetFunction(bass_library_, "BASS_RecordGetDeviceInfo")

Prototype.l BASS_RecordInit(device.l)
Global BASS_RecordInit.BASS_RecordInit = GetFunction(bass_library_, "BASS_RecordInit")

Prototype.l BASS_RecordSetDevice(device.l)
Global BASS_RecordSetDevice.BASS_RecordSetDevice = GetFunction(bass_library_, "BASS_RecordSetDevice")

Prototype.l BASS_RecordGetDevice()
Global BASS_RecordGetDevice.BASS_RecordGetDevice = GetFunction(bass_library_, "BASS_RecordGetDevice")

Prototype.l BASS_RecordFree()
Global BASS_RecordFree.BASS_RecordFree = GetFunction(bass_library_, "BASS_RecordFree")

Prototype.l BASS_RecordGetInfo(*info)
Global BASS_RecordGetInfo.BASS_RecordGetInfo = GetFunction(bass_library_, "BASS_RecordGetInfo")

Prototype.i BASS_RecordGetInputName(input.l)
Global BASS_RecordGetInputName.BASS_RecordGetInputName = GetFunction(bass_library_, "BASS_RecordGetInputName")

Prototype.l BASS_RecordSetInput(input.l, flags.l, volume.f)
Global BASS_RecordSetInput.BASS_RecordSetInput = GetFunction(bass_library_, "BASS_RecordSetInput")

Prototype.l BASS_RecordGetInput(input.l, *volume)
Global BASS_RecordGetInput.BASS_RecordGetInput = GetFunction(bass_library_, "BASS_RecordGetInput")

Prototype.l BASS_RecordStart(freq.l, chans.l, flags.l, *proc, *user)
Global BASS_RecordStart.BASS_RecordStart = GetFunction(bass_library_, "BASS_RecordStart")

Prototype.d BASS_ChannelBytes2Seconds(handle.l, pos.q)
Global BASS_ChannelBytes2Seconds.BASS_ChannelBytes2Seconds = GetFunction(bass_library_, "BASS_ChannelBytes2Seconds")

Prototype.q BASS_ChannelSeconds2Bytes(handle.l, pos.d)
Global BASS_ChannelSeconds2Bytes.BASS_ChannelSeconds2Bytes = GetFunction(bass_library_, "BASS_ChannelSeconds2Bytes")

Prototype.l BASS_ChannelGetDevice(handle.l)
Global BASS_ChannelGetDevice.BASS_ChannelGetDevice = GetFunction(bass_library_, "BASS_ChannelGetDevice")

Prototype.l BASS_ChannelSetDevice(handle.l, device.l)
Global BASS_ChannelSetDevice.BASS_ChannelSetDevice = GetFunction(bass_library_, "BASS_ChannelSetDevice")

Prototype.l BASS_ChannelIsActive(handle.l)
Global BASS_ChannelIsActive.BASS_ChannelIsActive = GetFunction(bass_library_, "BASS_ChannelIsActive")

Prototype.l BASS_ChannelGetInfo(handle.l, *info)
Global BASS_ChannelGetInfo.BASS_ChannelGetInfo = GetFunction(bass_library_, "BASS_ChannelGetInfo")

Prototype.i BASS_ChannelGetTags(handle.l, tags.l)
Global BASS_ChannelGetTags.BASS_ChannelGetTags = GetFunction(bass_library_, "BASS_ChannelGetTags")

Prototype.l BASS_ChannelFlags(handle.l, flags.l, mask.l)
Global BASS_ChannelFlags.BASS_ChannelFlags = GetFunction(bass_library_, "BASS_ChannelFlags")

Prototype.l BASS_ChannelUpdate(handle.l, length.l)
Global BASS_ChannelUpdate.BASS_ChannelUpdate = GetFunction(bass_library_, "BASS_ChannelUpdate")

Prototype.l BASS_ChannelLock(handle.l, lock.l)
Global BASS_ChannelLock.BASS_ChannelLock = GetFunction(bass_library_, "BASS_ChannelLock")

Prototype.l BASS_ChannelPlay(handle.l, restart.l)
Global BASS_ChannelPlay.BASS_ChannelPlay = GetFunction(bass_library_, "BASS_ChannelPlay")

Prototype.l BASS_ChannelStop(handle.l)
Global BASS_ChannelStop.BASS_ChannelStop = GetFunction(bass_library_, "BASS_ChannelStop")

Prototype.l BASS_ChannelPause(handle.l)
Global BASS_ChannelPause.BASS_ChannelPause = GetFunction(bass_library_, "BASS_ChannelPause")

Prototype.l BASS_ChannelSetAttribute(handle.l, attrib.l, value.f)
Global BASS_ChannelSetAttribute.BASS_ChannelSetAttribute = GetFunction(bass_library_, "BASS_ChannelSetAttribute")

Prototype.l BASS_ChannelGetAttribute(handle.l, attrib.l, *value)
Global BASS_ChannelGetAttribute.BASS_ChannelGetAttribute = GetFunction(bass_library_, "BASS_ChannelGetAttribute")

Prototype.l BASS_ChannelSlideAttribute(handle.l, attrib.l, value.f, time.l)
Global BASS_ChannelSlideAttribute.BASS_ChannelSlideAttribute = GetFunction(bass_library_, "BASS_ChannelSlideAttribute")

Prototype.l BASS_ChannelIsSliding(handle.l, attrib.l)
Global BASS_ChannelIsSliding.BASS_ChannelIsSliding = GetFunction( bass_library_, "BASS_ChannelIsSliding")

Prototype.l BASS_ChannelSetAttributeEx(handle.l, attrib.l, *value, size.l)
Global BASS_ChannelSetAttributeEx.BASS_ChannelSetAttributeEx = GetFunction(bass_library_, "BASS_ChannelSetAttributeEx")

Prototype.l BASS_ChannelGetAttributeEx(handle.l, attrib.l, *value, size.l)
Global BASS_ChannelGetAttributeEx.BASS_ChannelGetAttributeEx = GetFunction(bass_library_, "BASS_ChannelGetAttributeEx")

Prototype.l BASS_ChannelSet3DAttributes(handle.l, mode.l, min.f, max.f, iangle.l, oangle.l, outvol.f)
Global BASS_ChannelSet3DAttributes.BASS_ChannelSet3DAttributes = GetFunction(bass_library_, "BASS_ChannelSet3DAttributes")

Prototype.l BASS_ChannelGet3DAttributes(handle.l, *mode, *min, *max, *iangle, *oangle, *outvol)
Global BASS_ChannelGet3DAttributes.BASS_ChannelGet3DAttributes = GetFunction(bass_library_, "BASS_ChannelGet3DAttributes")

Prototype.l BASS_ChannelSet3DPosition(handle.l, *pos, *orient, *vel)
Global BASS_ChannelSet3DPosition.BASS_ChannelSet3DPosition = GetFunction(bass_library_, "BASS_ChannelSet3DPosition")

Prototype.l BASS_ChannelGet3DPosition(handle.l, *pos, *orient, *vel)
Global BASS_ChannelGet3DPosition.BASS_ChannelGet3DPosition = GetFunction(bass_library_, "BASS_ChannelGet3DPosition")

Prototype.q BASS_ChannelGetLength(handle.l, mode.l)
Global BASS_ChannelGetLength.BASS_ChannelGetLength = GetFunction(bass_library_, "BASS_ChannelGetLength")

Prototype.l BASS_ChannelSetPosition(handle.l, pos.q, mode.l)
Global BASS_ChannelSetPosition.BASS_ChannelSetPosition = GetFunction(bass_library_, "BASS_ChannelSetPosition")

Prototype.q BASS_ChannelGetPosition(handle.l, mode.l)
Global BASS_ChannelGetPosition.BASS_ChannelGetPosition = GetFunction(bass_library_, "BASS_ChannelGetPosition")

Prototype.l BASS_ChannelGetLevel(handle.l)
Global BASS_ChannelGetLevel.BASS_ChannelGetLevel = GetFunction(bass_library_, "BASS_ChannelGetLevel")

Prototype.l BASS_ChannelGetLevelEx(handle.l, *levels, length.f, flags.l)
Global BASS_ChannelGetLevelEx.BASS_ChannelGetLevelEx = GetFunction(bass_library_, "BASS_ChannelGetLevelEx")

Prototype.l BASS_ChannelGetData(handle.l, *buffer, length.l)
Global BASS_ChannelGetData.BASS_ChannelGetData = GetFunction(bass_library_, "BASS_ChannelGetData")

Prototype.l BASS_ChannelSetSync(handle.l, type.l, param.q, *proc, *user)
Global BASS_ChannelSetSync.BASS_ChannelSetSync = GetFunction(bass_library_, "BASS_ChannelSetSync")

Prototype.l BASS_ChannelRemoveSync(handle.l, sync.l)
Global BASS_ChannelRemoveSync.BASS_ChannelRemoveSync = GetFunction(bass_library_, "BASS_ChannelRemoveSync")

Prototype.l BASS_ChannelSetDSP(handle.l, *proc, *user, priority.l)
Global BASS_ChannelSetDSP.BASS_ChannelSetDSP = GetFunction(bass_library_, "BASS_ChannelSetDSP")

Prototype.l BASS_ChannelRemoveDSP(handle.l, dsp.l)
Global BASS_ChannelRemoveDSP.BASS_ChannelRemoveDSP = GetFunction(bass_library_, "BASS_ChannelRemoveDSP")

Prototype.l BASS_ChannelSetLink(handle.l, chan.l)
Global BASS_ChannelSetLink.BASS_ChannelSetLink = GetFunction(bass_library_, "BASS_ChannelSetLink")

Prototype.l BASS_ChannelRemoveLink(handle.l, chan.l)
Global BASS_ChannelRemoveLink.BASS_ChannelRemoveLink = GetFunction(bass_library_, "BASS_ChannelRemoveLink")

Prototype.l BASS_ChannelSetFX(handle.l, type.l, priority.l)
Global BASS_ChannelSetFX.BASS_ChannelSetFX = GetFunction(bass_library_, "BASS_ChannelSetFX")

Prototype.l BASS_ChannelRemoveFX(handle.l, fx.l)
Global BASS_ChannelRemoveFX.BASS_ChannelRemoveFX = GetFunction(bass_library_, "BASS_ChannelRemoveFX")

Prototype.l BASS_FXSetParameters(handle.l, *params)
Global BASS_FXSetParameters.BASS_FXSetParameters = GetFunction(bass_library_, "BASS_FXSetParameters")

Prototype.l BASS_FXGetParameters(handle.l, *params)
Global BASS_FXGetParameters.BASS_FXGetParameters = GetFunction(bass_library_, "BASS_FXGetParameters")

Prototype.l BASS_FXReset(handle.l)
Global BASS_FXReset.BASS_FXReset = GetFunction(bass_library_, "BASS_FXReset")

Prototype.l BASS_FXSetPriority(handle.l, priority.l)
Global BASS_FXSetPriority.BASS_FXSetPriority = GetFunction(bass_library_, "BASS_FXSetPriority")

; Debug Hex(BASS_GetVersion())
; Debug BASS_GetConfig(#BASS_CONFIG_UPDATEPERIOD)
; Debug BASS_GetDevice()
; Debug BASS_GetCPU()


; IDE Options = PureBasic 5.70 (Windows - x86)
; Folding = ------
Sory my bad english
Post Reply