📄 internet_music_bass.bas
字号:
Attribute VB_Name = "internet_Music_Bass"
'BASS 2.3 Visual Basic API, (c) 1999-2006 Ian Luck.
'Please report bugs/suggestions/etc... to bass@un4seen.com
'See the BASS.CHM file for detailed documentation
'NOTE: VB does not support 64-bit integers, so VB users only have access
' to the low 32-bits of 64-bit return values. 64-bit parameters can
' be specified though, using the "64" version of the function.
'NOTE: Use the VBStrFromAnsiPtr function to convert "char *" to VB "String".
Global Const BASSVERSION = &H203 'API version
Global Const BASSTRUE As Long = 1 'Use this instead of VB Booleans
Global Const BASSFALSE As Long = 0 'Use this instead of VB Booleans
'***********************************************
'* Error codes returned by BASS_ErrorGetCode() *
'***********************************************
Global Const BASS_OK = 0 'all is OK
Global Const BASS_ERROR_MEM = 1 'memory error
Global Const BASS_ERROR_FILEOPEN = 2 'can't open the file
Global Const BASS_ERROR_DRIVER = 3 'can't find a free sound driver
Global Const BASS_ERROR_BUFLOST = 4 'the sample buffer was lost
Global Const BASS_ERROR_HANDLE = 5 'invalid handle
Global Const BASS_ERROR_FORMAT = 6 'unsupported sample format
Global Const BASS_ERROR_POSITION = 7 'invalid playback position
Global Const BASS_ERROR_INIT = 8 'BASS_Init has not been successfully called
Global Const BASS_ERROR_START = 9 'BASS_Start has not been successfully called
Global Const BASS_ERROR_ALREADY = 14 'already initialized/paused/whatever
Global Const BASS_ERROR_NOPAUSE = 16 'not paused
Global Const BASS_ERROR_NOCHAN = 18 'can't get a free channel
Global Const BASS_ERROR_ILLTYPE = 19 'an illegal type was specified
Global Const BASS_ERROR_ILLPARAM = 20 'an illegal parameter was specified
Global Const BASS_ERROR_NO3D = 21 'no 3D support
Global Const BASS_ERROR_NOEAX = 22 'no EAX support
Global Const BASS_ERROR_DEVICE = 23 'illegal device number
Global Const BASS_ERROR_NOPLAY = 24 'not playing
Global Const BASS_ERROR_FREQ = 25 'illegal sample rate
Global Const BASS_ERROR_NOTFILE = 27 'the stream is not a file stream
Global Const BASS_ERROR_NOHW = 29 'no hardware voices available
Global Const BASS_ERROR_EMPTY = 31 'the MOD music has no sequence data
Global Const BASS_ERROR_NONET = 32 'no internet connection could be opened
Global Const BASS_ERROR_CREATE = 33 'couldn't create the file
Global Const BASS_ERROR_NOFX = 34 'effects are not available
Global Const BASS_ERROR_PLAYING = 35 'the channel is playing
Global Const BASS_ERROR_NOTAVAIL = 37 'requested data is not available
Global Const BASS_ERROR_DECODE = 38 'the channel is a "decoding channel"
Global Const BASS_ERROR_DX = 39 'a sufficient DirectX version is not installed
Global Const BASS_ERROR_TIMEOUT = 40 'connection timedout
Global Const BASS_ERROR_FILEFORM = 41 'unsupported file format
Global Const BASS_ERROR_SPEAKER = 42 'unavailable speaker
Global Const BASS_ERROR_VERSION = 43 'invalid BASS version (used by add-ons)
Global Const BASS_ERROR_CODEC = 44 'codec is not available/supported
Global Const BASS_ERROR_UNKNOWN = -1 'some other mystery error
'************************
'* Initialization flags *
'************************
Global Const BASS_DEVICE_8BITS = 1 'use 8 bit resolution, else 16 bit
Global Const BASS_DEVICE_MONO = 2 'use mono, else stereo
Global Const BASS_DEVICE_3D = 4 'enable 3D functionality
' If the BASS_DEVICE_3D flag is not specified when initilizing BASS,
' then the 3D flags (BASS_SAMPLE_3D and BASS_MUSIC_3D) are ignored when
' loading/creating a sample/stream/music.
Global Const BASS_DEVICE_LATENCY = 256 'calculate device latency (BASS_INFO struct)
Global Const BASS_DEVICE_SPEAKERS = 2048 'force enabling of speaker assignment
Global Const BASS_DEVICE_NOSPEAKER = 4096 'ignore speaker arrangement
'***********************************
'* BASS_INFO flags (from DSOUND.H) *
'***********************************
Global Const DSCAPS_CONTINUOUSRATE = 16
' supports all sample rates between min/maxrate
Global Const DSCAPS_EMULDRIVER = 32
' device does NOT have hardware DirectSound support
Global Const DSCAPS_CERTIFIED = 64
' device driver has been certified by Microsoft
' The following flags tell what type of samples are supported by HARDWARE
' mixing, all these formats are supported by SOFTWARE mixing
Global Const DSCAPS_SECONDARYMONO = 256 ' mono
Global Const DSCAPS_SECONDARYSTEREO = 512 ' stereo
Global Const DSCAPS_SECONDARY8BIT = 1024 ' 8 bit
Global Const DSCAPS_SECONDARY16BIT = 2048 ' 16 bit
'*****************************************
'* BASS_RECORDINFO flags (from DSOUND.H) *
'*****************************************
Global Const DSCCAPS_EMULDRIVER = DSCAPS_EMULDRIVER
' device does NOT have hardware DirectSound recording support
Global Const DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED
' device driver has been certified by Microsoft
'******************************************************************
'* defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) *
'******************************************************************
Global Const WAVE_FORMAT_1M08 = &H1 ' 11.025 kHz, Mono, 8-bit
Global Const WAVE_FORMAT_1S08 = &H2 ' 11.025 kHz, Stereo, 8-bit
Global Const WAVE_FORMAT_1M16 = &H4 ' 11.025 kHz, Mono, 16-bit
Global Const WAVE_FORMAT_1S16 = &H8 ' 11.025 kHz, Stereo, 16-bit
Global Const WAVE_FORMAT_2M08 = &H10 ' 22.05 kHz, Mono, 8-bit
Global Const WAVE_FORMAT_2S08 = &H20 ' 22.05 kHz, Stereo, 8-bit
Global Const WAVE_FORMAT_2M16 = &H40 ' 22.05 kHz, Mono, 16-bit
Global Const WAVE_FORMAT_2S16 = &H80 ' 22.05 kHz, Stereo, 16-bit
Global Const WAVE_FORMAT_4M08 = &H100 ' 44.1 kHz, Mono, 8-bit
Global Const WAVE_FORMAT_4S08 = &H200 ' 44.1 kHz, Stereo, 8-bit
Global Const WAVE_FORMAT_4M16 = &H400 ' 44.1 kHz, Mono, 16-bit
Global Const WAVE_FORMAT_4S16 = &H800 ' 44.1 kHz, Stereo, 16-bit
'*********************
'* Sample info flags *
'*********************
Global Const BASS_SAMPLE_8BITS = 1 ' 8 bit
Global Const BASS_SAMPLE_FLOAT = 256 ' 32-bit floating-point
Global Const BASS_SAMPLE_MONO = 2 ' mono, else stereo
Global Const BASS_SAMPLE_LOOP = 4 ' looped
Global Const BASS_SAMPLE_3D = 8 ' 3D functionality enabled
Global Const BASS_SAMPLE_SOFTWARE = 16 ' it's NOT using hardware mixing
Global Const BASS_SAMPLE_MUTEMAX = 32 ' muted at max distance (3D only)
Global Const BASS_SAMPLE_VAM = 64 ' uses the DX7 voice allocation & management
Global Const BASS_SAMPLE_FX = 128 ' old implementation of DX8 effects are enabled
Global Const BASS_SAMPLE_OVER_VOL = &H10000 ' override lowest volume
Global Const BASS_SAMPLE_OVER_POS = &H20000 ' override longest playing
Global Const BASS_SAMPLE_OVER_DIST = &H30000 ' override furthest from listener (3D only)
Global Const BASS_STREAM_PRESCAN = &H20000 ' enable pin-point seeking (MP3/MP2/MP1)
Global Const BASS_MP3_SETPOS = BASS_STREAM_PRESCAN
Global Const BASS_STREAM_AUTOFREE = &H40000 ' automatically free the stream when it stop/ends
Global Const BASS_STREAM_RESTRATE = &H80000 ' restrict the download rate of internet file streams
Global Const BASS_STREAM_BLOCK = &H100000 ' download/play internet file stream in small blocks
Global Const BASS_STREAM_DECODE = &H200000 ' don't play the stream, only decode (BASS_ChannelGetData)
Global Const BASS_STREAM_STATUS = &H800000 ' give server status info (HTTP/ICY tags) in DOWNLOADPROC
Global Const BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOAT ' 32-bit floating-point
Global Const BASS_MUSIC_MONO = BASS_SAMPLE_MONO ' force mono mixing (less CPU usage)
Global Const BASS_MUSIC_LOOP = BASS_SAMPLE_LOOP ' loop music
Global Const BASS_MUSIC_3D = BASS_SAMPLE_3D ' enable 3D functionality
Global Const BASS_MUSIC_FX = BASS_SAMPLE_FX ' enable old implementation of DX8 effects
Global Const BASS_MUSIC_AUTOFREE = BASS_STREAM_AUTOFREE ' automatically free the music when it stop/ends
Global Const BASS_MUSIC_DECODE = BASS_STREAM_DECODE ' don't play the music, only decode (BASS_ChannelGetData)
Global Const BASS_MUSIC_PRESCAN = BASS_STREAM_PRESCAN ' calculate playback length
Global Const BASS_MUSIC_CALCLEN = BASS_MUSIC_PRESCAN
Global Const BASS_MUSIC_RAMP = &H200 ' normal ramping
Global Const BASS_MUSIC_RAMPS = &H400 ' sensitive ramping
Global Const BASS_MUSIC_SURROUND = &H800 ' surround sound
Global Const BASS_MUSIC_SURROUND2 = &H1000 ' surround sound (mode 2)
Global Const BASS_MUSIC_FT2MOD = &H2000 ' play .MOD as FastTracker 2 does
Global Const BASS_MUSIC_PT1MOD = &H4000 ' play .MOD as ProTracker 1 does
Global Const BASS_MUSIC_NONINTER = &H10000 ' non-interpolated mixing
Global Const BASS_MUSIC_POSRESET = 32768 ' stop all notes when moving position
Global Const BASS_MUSIC_POSRESETEX = &H400000 ' stop all notes and reset bmp/etc when moving position
Global Const BASS_MUSIC_STOPBACK = &H80000 ' stop the music on a backwards jump effect
Global Const BASS_MUSIC_NOSAMPLE = &H100000 ' don't load the samples
' Speaker assignment flags
Global Const BASS_SPEAKER_FRONT = &H1000000 ' front speakers
Global Const BASS_SPEAKER_REAR = &H2000000 ' rear/side speakers
Global Const BASS_SPEAKER_CENLFE = &H3000000 ' center & LFE speakers (5.1)
Global Const BASS_SPEAKER_REAR2 = &H4000000 ' rear center speakers (7.1)
Global Const BASS_SPEAKER_LEFT = &H10000000 ' modifier: left
Global Const BASS_SPEAKER_RIGHT = &H20000000 ' modifier: right
Global Const BASS_SPEAKER_FRONTLEFT = BASS_SPEAKER_FRONT Or BASS_SPEAKER_LEFT
Global Const BASS_SPEAKER_FRONTRIGHT = BASS_SPEAKER_FRONT Or BASS_SPEAKER_RIGHT
Global Const BASS_SPEAKER_REARLEFT = BASS_SPEAKER_REAR Or BASS_SPEAKER_LEFT
Global Const BASS_SPEAKER_REARRIGHT = BASS_SPEAKER_REAR Or BASS_SPEAKER_RIGHT
Global Const BASS_SPEAKER_CENTER = BASS_SPEAKER_CENLFE Or BASS_SPEAKER_LEFT
Global Const BASS_SPEAKER_LFE = BASS_SPEAKER_CENLFE Or BASS_SPEAKER_RIGHT
Global Const BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_REAR2 Or BASS_SPEAKER_LEFT
Global Const BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_REAR2 Or BASS_SPEAKER_RIGHT
Global Const BASS_UNICODE = &H80000000
Global Const BASS_RECORD_PAUSE = 32768 ' start recording paused
'***********************************************
'* BASS_ChannelGetTags types : what's returned *
'***********************************************
Global Const BASS_TAG_ID3 = 0 'ID3v1 tags : 128 byte block
Global Const BASS_TAG_ID3V2 = 1 'ID3v2 tags : variable length block
Global Const BASS_TAG_OGG = 2 'OGG comments : array of null-terminated UTF-8 strings
Global Const BASS_TAG_HTTP = 3 'HTTP headers : array of null-terminated ANSI strings
Global Const BASS_TAG_ICY = 4 'ICY headers : array of null-terminated ANSI strings
Global Const BASS_TAG_META = 5 'ICY metadata : ANSI string
Global Const BASS_TAG_VENDOR = 9 ' OGG encoder : UTF-8 string
Global Const BASS_TAG_RIFF_INFO = &H100 'RIFF/WAVE tags : array of null-terminated ANSI strings
Global Const BASS_TAG_MUSIC_NAME = &H10000 'MOD music name : ANSI string
Global Const BASS_TAG_MUSIC_MESSAGE = &H10001 'MOD message : ANSI string
Global Const BASS_TAG_MUSIC_INST = &H10100 '+ instrument #, MOD instrument name : ANSI string
Global Const BASS_TAG_MUSIC_SAMPLE = &H10300 '+ sample #, MOD sample name : ANSI string
'********************
'* 3D channel modes *
'********************
Global Const BASS_3DMODE_NORMAL = 0
' normal 3D processing
Global Const BASS_3DMODE_RELATIVE = 1
' The channel's 3D position (position/velocity/orientation) are relative to
' the listener. When the listener's position/velocity/orientation is changed
' with BASS_Set3DPosition, the channel's position relative to the listener does
' not change.
Global Const BASS_3DMODE_OFF = 2
' Turn off 3D processing on the channel, the sound will be played
' in the center.
'****************************************************
'* EAX environments, use with BASS_SetEAXParameters *
'****************************************************
Global Const EAX_ENVIRONMENT_GENERIC = 0
Global Const EAX_ENVIRONMENT_PADDEDCELL = 1
Global Const EAX_ENVIRONMENT_ROOM = 2
Global Const EAX_ENVIRONMENT_BATHROOM = 3
Global Const EAX_ENVIRONMENT_LIVINGROOM = 4
Global Const EAX_ENVIRONMENT_STONEROOM = 5
Global Const EAX_ENVIRONMENT_AUDITORIUM = 6
Global Const EAX_ENVIRONMENT_CONCERTHALL = 7
Global Const EAX_ENVIRONMENT_CAVE = 8
Global Const EAX_ENVIRONMENT_ARENA = 9
Global Const EAX_ENVIRONMENT_HANGAR = 10
Global Const EAX_ENVIRONMENT_CARPETEDHALLWAY = 11
Global Const EAX_ENVIRONMENT_HALLWAY = 12
Global Const EAX_ENVIRONMENT_STONECORRIDOR = 13
Global Const EAX_ENVIRONMENT_ALLEY = 14
Global Const EAX_ENVIRONMENT_FOREST = 15
Global Const EAX_ENVIRONMENT_CITY = 16
Global Const EAX_ENVIRONMENT_MOUNTAINS = 17
Global Const EAX_ENVIRONMENT_QUARRY = 18
Global Const EAX_ENVIRONMENT_PLAIN = 19
Global Const EAX_ENVIRONMENT_PARKINGLOT = 20
Global Const EAX_ENVIRONMENT_SEWERPIPE = 21
Global Const EAX_ENVIRONMENT_UNDERWATER = 22
Global Const EAX_ENVIRONMENT_DRUGGED = 23
Global Const EAX_ENVIRONMENT_DIZZY = 24
Global Const EAX_ENVIRONMENT_PSYCHOTIC = 25
' total number of environments
Global Const EAX_ENVIRONMENT_COUNT = 26
'**********************************************************************
'* Sync types (with BASS_ChannelSetSync() "param" and SYNCPROC "data" *
'* definitions) & flags. *
'**********************************************************************
Global Const BASS_SYNC_POS = 0
' Sync when a channel reaches a position.
' param: position in bytes
' data : not used
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -