找传奇、传世资源到传世资源站!
VB编程 正文

VB MP3录音机 示例源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

用于录制电脑声音的软件,可自动转为MP3格式。VB MP3录音机 示例源码 VB编程-第1张

Attribute VB_Name = "modBass"'2.4“低音Visual Basic模块'版权(C)1999-2013 un4seen发展有限公司'DownLoad By http://www.veryhuo.com'“看到bass.chm文件更详细的文档'注意:VB不支持64位的整数,所以VB用户只能访问64位返回值的低32位。64位参数可以指定虽然,使用功能的“64版”。'注意:使用“strptr(文件名)”通过文件名的bass_musicload,bass_sampleload和bass_streamcreatefile功能。'注意:使用vbstrfromansiptr函数将“char *“VB”字符串".Global Const BASSVERSION = &H204 'API版本Global Const BASSVERSIONTEXT = "2.4"Global Const BASSTRUE As Long = 1 '用它代替VB布尔值Global Const BASSFALSE As Long = 0 '用它代替VB布尔值' 通过bass_errorgetcode返回错误码Global Const BASS_OK = 0 '都是OKGlobal Const BASS_ERROR_MEM = 1 '内存错误Global Const BASS_ERROR_FILEOPEN = 2 '无法打开文件Global Const BASS_ERROR_DRIVER = 3 '不能找到一个免费的声音驱动程序Global Const BASS_ERROR_BUFLOST = 4 'the sample buffer was lost(样品缓冲了)Global Const BASS_ERROR_HANDLE = 5 '无效的句柄Global Const BASS_ERROR_FORMAT = 6 '不支持的采样格式Global Const BASS_ERROR_POSITION = 7 '无效的位置Global Const BASS_ERROR_INIT = 8 'bass_init初始化尚未成功Global Const BASS_ERROR_START = 9 'bass_start尚未成功启动Global Const BASS_ERROR_ALREADY = 14 '已经初始化/暂停/什么Global Const BASS_ERROR_NOCHAN = 18 '不能得到一个免费频道Global Const BASS_ERROR_ILLTYPE = 19 '指定了一个非法的类型Global Const BASS_ERROR_ILLPARAM = 20 '指定了一个非法的参数Global Const BASS_ERROR_NO3D = 21 '不支持3DGlobal Const BASS_ERROR_NOEAX = 22 '没有eax支持Global Const BASS_ERROR_DEVICE = 23 '非法的设备号Global Const BASS_ERROR_NOPLAY = 24 '没有播放Global Const BASS_ERROR_FREQ = 25 '非法的采样率Global Const BASS_ERROR_NOTFILE = 27 '流不是一个文件流Global Const BASS_ERROR_NOHW = 29 '没有可用的硬件的声音Global Const BASS_ERROR_EMPTY = 31 'the MOD音乐有没有序列数据Global Const BASS_ERROR_NONET = 32 '没有互联网连接,可以打开Global Const BASS_ERROR_CREATE = 33 '无法创建文件Global Const BASS_ERROR_NOFX = 34 '效果是不可用Global Const BASS_ERROR_NOTAVAIL = 37 '请求的数据不可用Global Const BASS_ERROR_DECODE = 38 '通道是/不是“解码频道”Global Const BASS_ERROR_DX = 39 '没有安装足够的DirectX版本Global Const BASS_ERROR_TIMEOUT = 40 '连接超时Global Const BASS_ERROR_FILEFORM = 41 '不支持的文件格式Global Const BASS_ERROR_SPEAKER = 42 '不可用扬声器Global Const BASS_ERROR_VERSION = 43 '无效的低音版本(使用附件)Global Const BASS_ERROR_CODEC = 44 '编解码器/支持不在Global Const BASS_ERROR_ENDED = 45 '频道/文件已经结束Global Const BASS_ERROR_BUSY = 46 '该设备是繁忙的Global Const BASS_ERROR_UNKNOWN = -1 '其他一些神秘的问题' BASS_SetConfig选项Global Const BASS_CONFIG_BUFFER = 0Global Const BASS_CONFIG_UPDATEPERIOD = 1Global Const BASS_CONFIG_GVOL_SAMPLE = 4Global Const BASS_CONFIG_GVOL_STREAM = 5Global Const BASS_CONFIG_GVOL_MUSIC = 6Global Const BASS_CONFIG_CURVE_VOL = 7Global Const BASS_CONFIG_CURVE_PAN = 8Global Const BASS_CONFIG_FLOATDSP = 9Global Const BASS_CONFIG_3DALGORITHM = 10Global Const BASS_CONFIG_NET_TIMEOUT = 11Global Const BASS_CONFIG_NET_BUFFER = 12Global Const BASS_CONFIG_PAUSE_NOPLAY = 13Global Const BASS_CONFIG_NET_PREBUF = 15Global Const BASS_CONFIG_NET_PASSIVE = 18Global Const BASS_CONFIG_REC_BUFFER = 19Global Const BASS_CONFIG_NET_PLAYLIST = 21Global Const BASS_CONFIG_MUSIC_VIRTUAL = 22Global Const BASS_CONFIG_VERIFY = 23Global Const BASS_CONFIG_UPDATETHREADS = 24Global Const BASS_CONFIG_DEV_BUFFER = 27Global Const BASS_CONFIG_VISTA_TRUEPOS = 30Global Const BASS_CONFIG_DEV_DEFAULT = 36Global Const BASS_CONFIG_NET_READTIMEOUT = 37Global Const BASS_CONFIG_VISTA_SPEAKERS = 38Global Const BASS_CONFIG_HANDLES = 41Global Const BASS_CONFIG_UNICODE = 42Global Const BASS_CONFIG_SRC = 43Global Const BASS_CONFIG_SRC_SAMPLE = 44Global Const BASS_CONFIG_ASYNCFILE_BUFFER = 45Global Const BASS_CONFIG_OGG_PRESCAN = 47' BASS_SetConfigPtr备选办法Global Const BASS_CONFIG_NET_AGENT = 16Global Const BASS_CONFIG_NET_PROXY = 17' bass_asio_初始化标识Global Const BASS_DEVICE_8BITS = 1 '8位分辨率,其他16位Global Const BASS_DEVICE_MONO = 2 '单,否则立体Global Const BASS_DEVICE_3D = 4 '启用3D功能Global Const BASS_DEVICE_LATENCY = &H100 '计算设备延迟(bass_info结构)Global Const BASS_DEVICE_CPSPEAKERS = &H400 '检测扬声器通过Windows控制面板Global Const BASS_DEVICE_SPEAKERS = &H800 '力使扬声器分配Global Const BASS_DEVICE_NOSPEAKER = &O1000 '忽略的扬声器布置'DirectSound接口(使用bass_getdsoundobject)Global Const BASS_OBJECT_DS = 1 ' DirectSoundGlobal Const BASS_OBJECT_DS3DL = 2 'IDirectSound3DListener' 设备信息结构Type BASS_DEVICEINFO name As Long ' 描述 driver As Long ' 驱动程序 flags As LongEnd Type' bass_deviceinfo标识Global Const BASS_DEVICE_ENABLED = 1Global Const BASS_DEVICE_DEFAULT = 2Global Const BASS_DEVICE_INIT = 4Type BASS_INFO flags As Long '设备的能力(dscaps_xxx标志) hwsize As Long '总设备硬件的内存大小 hwfree As Long '免费设备硬件的内存大小 freesam As Long '在硬件上的免费样品槽数 free3d As Long '免费的3D样本槽在硬件数字 minrate As Long '最小采样率由硬件支持 maxrate As Long '硬件支持的最高采样率 eax As Long '如果设备支持?(总是bassfalse如果bass_device_3d不使用) minbuf As Long '推荐的最小缓冲区长度在MS(需要bass_device_latency) dsver As Long 'DirectSound版 latency As Long '延迟(毫秒)开始前播放(需要bass_device_latency) initflags As Long 'bass_init“标记”参数 speakers As Long '扬声器的数量 freq As Long '电流输出率End Type' BASS_INFO 标记 (从 DSOUND.H)Global Const DSCAPS_CONTINUOUSRATE = 16 ' 支持最小/ maxrate之间的所有采样率Global Const DSCAPS_EMULDRIVER = 32 ' 设备不支持的硬件实现Global Const DSCAPS_CERTIFIED = 64 ' 设备驱动程序已被证明微软Global Const DSCAPS_SECONDARYMONO = 256 ' 单Global Const DSCAPS_SECONDARYSTEREO = 512 ' 立体声Global Const DSCAPS_SECONDARY8BIT = 1024 ' 8 位Global Const DSCAPS_SECONDARY16BIT = 2048 ' 16位'记录装置的信息结构Type BASS_RECORDINFO flags As Long '设备的能力(dsccaps_xxx标志) formats As Long '支持的标准格式(wave_format_xxx标志) inputs As Long '输入的数量 singlein As Long 'basstrue = 1输入可在设定的时间 freq As Long '电流输入率End Type' BASS_RECORDINFO 标识 (从 DSOUND.H)Global Const DSCCAPS_EMULDRIVER = DSCAPS_EMULDRIVER '设备不支持硬件DirectSound的记录Global Const DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED '设备驱动程序已被证明微软' 定义格式bass_recordinfo领域(从mmsystem.H)Global Const WAVE_FORMAT_1M08 = &H1 ' 11.025 kHz, 单声道, 8-bitGlobal Const WAVE_FORMAT_1S08 = &H2 ' 11.025 kHz, 立体声, 8-bitGlobal Const WAVE_FORMAT_1M16 = &H4 ' 11.025 kHz, 单声道, 16-bitGlobal Const WAVE_FORMAT_1S16 = &H8 ' 11.025 kHz, 立体声, 16-bitGlobal Const WAVE_FORMAT_2M08 = &H10 ' 22.05 kHz, 单声道, 8-bitGlobal Const WAVE_FORMAT_2S08 = &H20 ' 22.05 kHz, 立体声, 8-bitGlobal Const WAVE_FORMAT_2M16 = &H40 ' 22.05 kHz, 单声道, 16-bitGlobal Const WAVE_FORMAT_2S16 = &H80 ' 22.05 kHz, 立体声, 16-bitGlobal Const WAVE_FORMAT_4M08 = &H100 ' 44.1 kHz, 单声道, 8-bitGlobal Const WAVE_FORMAT_4S08 = &H200 ' 44.1 kHz, 立体声, 8-bitGlobal Const WAVE_FORMAT_4M16 = &H400 ' 44.1 kHz, 单声道, 16-bitGlobal Const WAVE_FORMAT_4S16 = &H800 ' 44.1 kHz, 立体声, 16-bit'样品信息结构Type BASS_SAMPLE freq As Long '默认的播放速度 volume As Single '缺省音量(0-100) pan As Single '缺省pan (-100=左, 0=中, 100=右) flags As Long '低音_样品_ XXX标识 length As Long '长度(样品中,不是字节) max As Long '最大同时播放 origres As Long '原始分辨率 chans As Long '通道数 mingap As Long '最小间隙(MS)之间建立通道 mode3d As Long 'bass_3dmode_xxx模式 mindist As Single '最小距离 MAXDIST As Single '最大距离 iangle As Long '投影内锥角 oangle As Long '外投影锥角 outvol As Single ' delta-volume outside the projection cone vam As Long '声音分配/管理标识(BASS_VAM_xxx) priority As Long '优先级(0 =最低,&Hffffffff =最高)End TypeGlobal Const BASS_SAMPLE_8BITS = 1 ' 8 位Global Const BASS_SAMPLE_FLOAT = 256 ' 32位浮点数Global Const BASS_SAMPLE_MONO = 2 '单声道Global Const BASS_SAMPLE_LOOP = 4 ' 循环的Global Const BASS_SAMPLE_3D = 8 ' 3D功能Global Const BASS_SAMPLE_SOFTWARE = 16 ' 不使用硬件混合Global Const BASS_SAMPLE_MUTEMAX = 32 ' 静音在最大距离(仅仅3D)Global Const BASS_SAMPLE_VAM = 64 ' DX7声音分配与管理Global Const BASS_SAMPLE_FX = 128 '老implementation of DX8效应Global Const BASS_SAMPLE_OVER_VOL = &H10000 ' 最小体积参数Global Const BASS_SAMPLE_OVER_POS = &H20000 ' override longest playingGlobal Const BASS_SAMPLE_OVER_DIST = &H30000 '覆盖最远的听众(3D)Global Const BASS_STREAM_PRESCAN = &H20000 ' enable pin-point seeking/length (MP3/MP2/MP1)Global Const BASS_MP3_SETPOS = BASS_STREAM_PRESCANGlobal Const BASS_STREAM_AUTOFREE = &H40000 ' 自由流时自动停止/结束Global Const BASS_STREAM_RESTRATE = &H80000 ' 限制互联网文件流下载率Global Const BASS_STREAM_BLOCK = &H100000 ' 下载/小块发挥互联网文件流Global Const BASS_STREAM_DECODE = &H200000 '不播放流,只解码(bass_channelgetdata)Global Const BASS_STREAM_STATUS = &H800000 ' 给服务器状态信息(HTTP /ICY标签)下载程序Global Const BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOATGlobal Const BASS_MUSIC_MONO = BASS_SAMPLE_MONOGlobal Const BASS_MUSIC_LOOP = BASS_SAMPLE_LOOPGlobal Const BASS_MUSIC_3D = BASS_SAMPLE_3DGlobal Const BASS_MUSIC_FX = BASS_SAMPLE_FXGlobal Const BASS_MUSIC_AUTOFREE = BASS_STREAM_AUTOFREEGlobal Const BASS_MUSIC_DECODE = BASS_STREAM_DECODEGlobal Const BASS_MUSIC_PRESCAN = BASS_STREAM_PRESCAN '播放长度计算Global Const BASS_MUSIC_CALCLEN = BASS_MUSIC_PRESCANGlobal Const BASS_MUSIC_RAMP = &H200 '正常的斜坡Global Const BASS_MUSIC_RAMPS = &H400 '敏感的斜坡Global Const BASS_MUSIC_SURROUND = &H800 '环绕声Global Const BASS_MUSIC_SURROUND2 = &H1000 '环绕声(模式2)Global Const BASS_MUSIC_FT2MOD = &H2000 '播放MOD为FastTracker 2。Global Const BASS_MUSIC_PT1MOD = &H4000 ' play .MOD as ProTracker 1 doesGlobal Const BASS_MUSIC_NONINTER = &H10000 ' 非插值样混合Global Const BASS_MUSIC_SINCINTER = &H800000 'sinc插值样混合Global Const BASS_MUSIC_POSRESET = 32768 ' 停止所有的笔记时,移动位置Global Const BASS_MUSIC_POSRESETEX = &H400000 '停止所有的笔记和复位BMP /等移动时的位置Global Const BASS_MUSIC_STOPBACK = &H80000 ' 停在一个向后跳效果的音乐Global Const BASS_MUSIC_NOSAMPLE = &H100000 ' 不加载的样品'扬声器分配的标识Global Const BASS_SPEAKER_FRONT = &H1000000 '前置扬声器Global Const BASS_SPEAKER_REAR = &H2000000 '后面/侧面扬声器Global Const BASS_SPEAKER_CENLFE = &H3000000 '中心与speakers低频效果(5.1)Global Const BASS_SPEAKER_REAR2 = &H4000000 '后中心扬声器(7.1)Global Const BASS_SPEAKER_LEFT = &H10000000 '改性剂:左Global Const BASS_SPEAKER_RIGHT = &H20000000 '改性剂:右Global Const BASS_SPEAKER_FRONTLEFT = BASS_SPEAKER_FRONT Or BASS_SPEAKER_LEFTGlobal Const BASS_SPEAKER_FRONTRIGHT = BASS_SPEAKER_FRONT Or BASS_SPEAKER_RIGHTGlobal Const BASS_SPEAKER_REARLEFT = BASS_SPEAKER_REAR Or BASS_SPEAKER_LEFTGlobal Const BASS_SPEAKER_REARRIGHT = BASS_SPEAKER_REAR Or BASS_SPEAKER_RIGHTGlobal Const BASS_SPEAKER_CENTER = BASS_SPEAKER_CENLFE Or BASS_SPEAKER_LEFTGlobal Const BASS_SPEAKER_LFE = BASS_SPEAKER_CENLFE Or BASS_SPEAKER_RIGHTGlobal Const BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_REAR2 Or BASS_SPEAKER_LEFTGlobal Const BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_REAR2 Or BASS_SPEAKER_RIGHTGlobal Const BASS_ASYNCFILE = &H40000000Global Const BASS_UNICODE = &H80000000Global Const BASS_RECORD_PAUSE = 32768 '开始录制暂停'分配标识DX7的声音Global Const BASS_VAM_HARDWARE = 1Global Const BASS_VAM_SOFTWARE = 2Global Const BASS_VAM_TERM_TIME = 4Global Const BASS_VAM_TERM_DIST = 8Global Const BASS_VAM_TERM_PRIO = 16'通道信息结构Type BASS_CHANNELINFO freq As Long ' 默认的播放速度 chans As Long ' 通道 flags As Long ' bass_sample /流/音乐/扬声器的标识 ctype As Long ' 通道类型 origres As Long ' 原始分辨率 plugin As Long ' 插件 sample As Long ' 取样 filename As Long ' 文件名End Type'低音_ channelinfo类型Global Const BASS_CTYPE_SAMPLE = 1Global Const BASS_CTYPE_RECORD = 2Global Const BASS_CTYPE_STREAM = &H10000Global Const BASS_CTYPE_STREAM_OGG = &H10002Global Const BASS_CTYPE_STREAM_MP1 = &H10003Global Const BASS_CTYPE_STREAM_MP2 = &H10004Global Const BASS_CTYPE_STREAM_MP3 = &H10005Global Const BASS_CTYPE_STREAM_AIFF = &H10006Global Const BASS_CTYPE_STREAM_WAV = &H40000 '波标识,低=编解码器Global Const BASS_CTYPE_STREAM_WAV_PCM = &H50001Global Const BASS_CTYPE_STREAM_WAV_FLOAT = &H50003Global Const BASS_CTYPE_MUSIC_MOD = &H20000Global Const BASS_CTYPE_MUSIC_MTM = &H20001Global Const BASS_CTYPE_MUSIC_S3M = &H20002Global Const BASS_CTYPE_MUSIC_XM = &H20003Global Const BASS_CTYPE_MUSIC_IT = &H20004Global Const BASS_CTYPE_MUSIC_MO3 = &H100 ' MO3 标识Type BASS_PLUGINFORM ctype As Long ' 通道类型 name As Long ' 格式描述 exts As Long ' 文件扩展名的过滤器(*.EXT1;*.Ext2;等)End TypeType BASS_PLUGININFO Version As Long '版本(相同的形态有低音_ getversion) formatc As Long '数字格式 formats As Long '格式的数组End Type'三维向量(三维位置/速度/方向)Type BASS_3DVECTOR X As Single ' =right, -=left Y As Single ' =up, -=down z As Single ' =前面,-=后面End Type' 三维通道模式Global Const BASS_3DMODE_NORMAL = 0 '正常的3D处理Global Const BASS_3DMODE_RELATIVE = 1 '位置是相对于听众Global Const BASS_3DMODE_OFF = 2 '没有3D处理'软件的三维混合算法(用于bass_config_3dalgorithm)Global Const BASS_3DALG_DEFAULT = 0Global Const BASS_3DALG_OFF = 1Global Const BASS_3DALG_FULL = 2Global Const BASS_3DALG_LIGHT = 3'如果环境,使用bass_seteaxparametersGlobal Const EAX_ENVIRONMENT_GENERIC = 0Global Const EAX_ENVIRONMENT_PADDEDCELL = 1Global Const EAX_ENVIRONMENT_ROOM = 2Global Const EAX_ENVIRONMENT_BATHROOM = 3Global Const EAX_ENVIRONMENT_LIVINGROOM = 4Global Const EAX_ENVIRONMENT_STONEROOM = 5Global Const EAX_ENVIRONMENT_AUDITORIUM = 6Global Const EAX_ENVIRONMENT_CONCERTHALL = 7Global Const EAX_ENVIRONMENT_CAVE = 8Global Const EAX_ENVIRONMENT_ARENA = 9Global Const EAX_ENVIRONMENT_HANGAR = 10Global Const EAX_ENVIRONMENT_CARPETEDHALLWAY = 11Global Const EAX_ENVIRONMENT_HALLWAY = 12Global Const EAX_ENVIRONMENT_STONECORRIDOR = 13Global Const EAX_ENVIRONMENT_ALLEY = 14Global Const EAX_ENVIRONMENT_FOREST = 15Global Const EAX_ENVIRONMENT_CITY = 16Global Const EAX_ENVIRONMENT_MOUNTAINS = 17Global Const EAX_ENVIRONMENT_QUARRY = 18Global Const EAX_ENVIRONMENT_PLAIN = 19Global Const EAX_ENVIRONMENT_PARKINGLOT = 20Global Const EAX_ENVIRONMENT_SEWERPIPE = 21Global Const EAX_ENVIRONMENT_UNDERWATER = 22Global Const EAX_ENVIRONMENT_DRUGGED = 23Global Const EAX_ENVIRONMENT_DIZZY = 24Global Const EAX_ENVIRONMENT_PSYCHOTIC = 25Global Const EAX_ENVIRONMENT_COUNT = 26 '环境总人数Global Const BASS_STREAMPROC_END = &H80000000 ' 最终用户流的标识'特别streamprocsGlobal Const STREAMPROC_DUMMY = 0 ' “虚拟”流Global Const STREAMPROC_PUSH = -1 ' push 流'bass_streamcreatefileuser文件系统Global Const STREAMFILE_NOBUFFER = 0Global Const STREAMFILE_BUFFER = 1Global Const STREAMFILE_BUFFERPUSH = 2Type BASS_FILEPROCS close As Long length As Long read As Long seek As LongEnd Type' BASS_StreamPutFileData optionsGlobal Const BASS_FILEDATA_END = 0 ' end & close the file' BASS_StreamGetFilePosition模式Global Const BASS_FILEPOS_CURRENT = 0Global Const BASS_FILEPOS_DECODE = BASS_FILEPOS_CURRENTGlobal Const BASS_FILEPOS_DOWNLOAD = 1Global Const BASS_FILEPOS_END = 2Global Const BASS_FILEPOS_START = 3Global Const BASS_FILEPOS_CONNECTED = 4Global Const BASS_FILEPOS_BUFFER = 5' BASS_ChannelSetSync 类型Global Const BASS_SYNC_POS = 0Global Const BASS_SYNC_END = 2Global Const BASS_SYNC_META = 4Global Const BASS_SYNC_SLIDE = 5Global Const BASS_SYNC_STALL = 6Global Const BASS_SYNC_DOWNLOAD = 7Global Const BASS_SYNC_FREE = 8Global Const BASS_SYNC_SETPOS = 11Global Const BASS_SYNC_MUSICPOS = 10Global Const BASS_SYNC_MUSICINST = 1Global Const BASS_SYNC_MUSICFX = 3Global Const BASS_SYNC_OGG_CHANGE = 12Global Const BASS_SYNC_MIXTIME = &H40000000 ' 标识:同步在mixtime,别人在玩的时候Global Const BASS_SYNC_ONETIME = &H80000000 ' 标识:同步只有一次,else不断' BASS_ChannelIsActive返回值Global Const BASS_ACTIVE_STOPPED = 0Global Const BASS_ACTIVE_PLAYING = 1Global Const BASS_ACTIVE_STALLED = 2Global Const BASS_ACTIVE_PAUSED = 3'信道属性Global Const BASS_ATTRIB_FREQ = 1Global Const BASS_ATTRIB_VOL = 2Global Const BASS_ATTRIB_PAN = 3Global Const BASS_ATTRIB_EAXMIX = 4Global Const BASS_ATTRIB_NOBUFFER = 5Global Const BASS_ATTRIB_CPU = 7Global Const BASS_ATTRIB_SRC = 8Global Const BASS_ATTRIB_MUSIC_AMPLIFY = &H100Global Const BASS_ATTRIB_MUSIC_PANSEP = &H101Global Const BASS_ATTRIB_MUSIC_PSCALER = &H102Global Const BASS_ATTRIB_MUSIC_BPM = &H103Global Const BASS_ATTRIB_MUSIC_SPEED = &H104Global Const BASS_ATTRIB_MUSIC_VOL_GLOBAL = &H105Global Const BASS_ATTRIB_MUSIC_VOL_CHAN = &H200 ' 通道 #Global Const BASS_ATTRIB_MUSIC_VOL_INST = &H300 ' 仪器 #' BASS_ChannelGetData标识Global Const BASS_DATA_AVAILABLE = 0 ' 查询多少数据缓冲Global Const BASS_DATA_FLOAT = &H40000000 ' 标识:返回浮点样本数据Global Const BASS_DATA_FFT256 = &H80000000 ' 256 采样FFTGlobal Const BASS_DATA_FFT512 = &H80000001 ' 512 FFTGlobal Const BASS_DATA_FFT1024 = &H80000002 ' 1024 FFTGlobal Const BASS_DATA_FFT2048 = &H80000003 ' 2048 FFTGlobal Const BASS_DATA_FFT4096 = &H80000004 ' 4096 FFTGlobal Const BASS_DATA_FFT8192 = &H80000005 ' 8192 FFTGlobal Const BASS_DATA_FFT16384 = &H80000006 ' 16384 FFTGlobal Const BASS_DATA_FFT_INDIVIDUAL = &H10 ' FFT标识:FFT每个通道,其他的所有组合Global Const BASS_DATA_FFT_NOWINDOW = &H20 ' FFT标识: no Hanning windowGlobal Const BASS_DATA_FFT_REMOVEDC = &H40 ' FFT标识: 预消除直流BIAGlobal Const BASS_DATA_FFT_COMPLEX = &H80 ' FFT标识: 返回复杂的数据' “bass_channelgettags类型:什么是返回Global Const BASS_TAG_ID3 = 0 ' ID3v1标识 : TAG_ID3 结构Global Const BASS_TAG_ID3V2 = 1 ' ID3v2标识 : 可变长度块Global Const BASS_TAG_OGG = 2 ' ogg注释:空终止UTF-8字符串系列Global Const BASS_TAG_HTTP = 3 ' http 头域:ANSI字符串空端系列)Global Const BASS_TAG_ICY = 4 ' ICY 头域 :ANSI字符串空端系列)Global Const BASS_TAG_META = 5 ' ICY 元数据:ANSI字符串Global Const BASS_TAG_APE = 6 ' APEv2 标签:空终止UTF-8字符串系列Global Const BASS_TAG_MP4 = 7 ' MP4/iTunes元数据:空终止UTF-8字符串系列Global Const BASS_TAG_VENDOR = 9 ' OGG 编码器:UTF-8字符串Global Const BASS_TAG_LYRICS3 = 10 ' Lyric3v2 标签:ASCII字符串Global Const BASS_TAG_CA_CODEC = 11 ' coreaudio编解码器的信息:tag_ca_codec结构Global Const BASS_TAG_MF = 13 ' Media Foundation Series of标签:零终止UTF-8字符串Global Const BASS_TAG_WAVEFORMAT = 14 '波的形式:waveformateex结构Global Const BASS_TAG_RIFF_INFO = &H100 ' RIFF "INFO"标签:空终止的ANSI字符串系列Global Const BASS_TAG_RIFF_BEXT = &H101 ' RIFF/BWF "bext" 标签 : TAG_BEXT 状态Global Const BASS_TAG_RIFF_CART = &H102 ' RIFF/BWF "cart" 标签 : TAG_CART 状态Global Const BASS_TAG_RIFF_DISP = &H103 ' RIFF "DISP" text 标签 : ANSI 字符Global Const BASS_TAG_APE_BINARY = &H1000 ' index #, binary APEv2 tag : TAG_APE_二进制结构Global Const BASS_TAG_MUSIC_NAME = &H10000 ' MOD 音乐文件 : ANSI 字符Global Const BASS_TAG_MUSIC_ORDERS = &H10002 ' mod列表:字节阵列模式的阶数Global Const BASS_TAG_MUSIC_MESSAGE = &H10001 ' 国防部消息:ANSI字符串Global Const BASS_TAG_MUSIC_INST = &H10100 ' instrument #, MOD instrument name : ANSI stringGlobal Const BASS_TAG_MUSIC_SAMPLE = &H10300 ' sample #, MOD sample name : ANSI string' ID3v1 标签结构Type TAG_ID3 id As String * 3 title As String * 30 artist As String * 30 album As String * 30 year As String * 4 comment As String * 30 genre As ByteEnd Type'二进制APEv2标签结构Type TAG_APE_BINARY key As Long data As Long length As LongEnd Type' BWF "bext" 结构Type TAG_BEXT Description As String * 256 '描述 Originator As String * 32 '的人的姓名 OriginatorReference As String * 32 '发起人的参考 OriginationDate As String * 10 '创建日期(yyyy-mm-dd) OriginationTime As String * 8 '创建时间(hh-mm-ss) TimeReferenceLo As Long '第一个样本数的低32位自从(小端) TimeReferenceHi As Long '高32位的第一样本数自从(小端) Version As Integer ' BWF version (little-endian) UMID(0 To 63) As Byte ' SMPTE UMID Reserved(0 To 189) As Byte CodingHistory() As String '历史End Type'bass_channelgetlength / getposition /位置模式Global Const BASS_POS_BYTE = 0 ' 字节的位置Global Const BASS_POS_MUSIC_ORDER = 1 ' order.row位置,进行(订单,行)Global Const BASS_POS_OGG = 3 ' Ogg码流数Global Const BASS_POS_DECODE = &H10000000 ' 标记:得到的解码(不是在播放)的位置Global Const BASS_POS_DECODETO = &H20000000 '标识:解码的位置,而不是寻求' BASS_RecordSetInput 标识Global Const BASS_INPUT_OFF = &H10000Global Const BASS_INPUT_ON = &H20000Global Const BASS_INPUT_TYPE_MASK = &HFF000000Global Const BASS_INPUT_TYPE_UNDEF = &H0Global Const BASS_INPUT_TYPE_DIGITAL = &H1000000Global Const BASS_INPUT_TYPE_LINE = &H2000000Global Const BASS_INPUT_TYPE_MIC = &H3000000Global Const BASS_INPUT_TYPE_SYNTH = &H4000000Global Const BASS_INPUT_TYPE_CD = &H5000000Global Const BASS_INPUT_TYPE_PHONE = &H6000000Global Const BASS_INPUT_TYPE_SPEAKER = &H7000000Global Const BASS_INPUT_TYPE_WAVE = &H8000000Global Const BASS_INPUT_TYPE_AUX = &H9000000Global Const BASS_INPUT_TYPE_ANALOG = &HA000000'DX8效应类型,使用BASS_ChannelSetFXGlobal Const BASS_FX_DX8_CHORUS = 0Global Const BASS_FX_DX8_COMPRESSOR = 1Global Const BASS_FX_DX8_DISTORTION = 2Global Const BASS_FX_DX8_ECHO = 3Global Const BASS_FX_DX8_FLANGER = 4Global Const BASS_FX_DX8_GARGLE = 5Global Const BASS_FX_DX8_I3DL2REVERB = 6Global Const BASS_FX_DX8_PARAMEQ = 7Global Const BASS_FX_DX8_REVERB = 8Type BASS_DX8_CHORUS fWetDryMix As Single fDepth As Single fFeedback As Single fFrequency As Single lWaveform As Long '0 =三角形,1 =正弦 fDelay As Single lPhase As Long ' BASS_DX8_PHASE_xxxEnd TypeType BASS_DX8_COMPRESSOR fGain As Single fAttack As Single fRelease As Single fThreshold As Single fRatio As Single fPredelay As SingleEnd TypeType BASS_DX8_DISTORTION fGain As Single fEdge As Single fPostEQCenterFrequency As Single fPostEQBandwidth As Single fPreLowpassCutoff As SingleEnd TypeType BASS_DX8_ECHO fWetDryMix As Single fFeedback As Single fLeftDelay As Single fRightDelay As Single lPanDelay As LongEnd TypeType BASS_DX8_FLANGER fWetDryMix As Single fDepth As Single fFeedback As Single fFrequency As Single lWaveform As Long '0 =三角形,1 =正弦 fDelay As Single lPhase As Long ' BASS_DX8_PHASE_xxxEnd TypeType BASS_DX8_GARGLE dwRateHz As Long ' 在频率调制方式 dwWaveShape As Long ' 0 =三角形,1 =平方End TypeType BASS_DX8_I3DL2REVERB lRoom As Long ' [-10000, 0] default: -1000 mB lRoomHF As Long ' [-10000, 0] default: 0 mB flRoomRolloffFactor As Single ' [0.0, 10.0] default: 0.0 flDecayTime As Single ' [0.1, 20.0] default: 1.49s flDecayHFRatio As Single ' [0.1, 2.0] default: 0.83 lReflections As Long ' [-10000, 1000] default: -2602 mB flReflectionsDelay As Single ' [0.0, 0.3] default: 0.007 s lReverb As Long ' [-10000, 2000] default: 200 mB flReverbDelay As Single ' [0.0, 0.1] default: 0.011 s flDiffusion As Single ' [0.0, 100.0] default: 100.0 % flDensity As Single ' [0.0, 100.0] default: 100.0 % flHFReference As Single ' [20.0, 20000.0] default: 5000.0 HzEnd TypeType BASS_DX8_PARAMEQ fCenter As Single fBandwidth As Single fGain As SingleEnd TypeType BASS_DX8_REVERB fInGain As Single ' [-96.0,0.0] default: 0.0 dB fReverbMix As Single ' [-96.0,0.0] default: 0.0 db fReverbTime As Single ' [0.001,3000.0] default: 1000.0 ms fHighFreqRTRatio As Single ' [0.001,0.999] default: 0.001End TypeGlobal Const BASS_DX8_PHASE_NEG_180 = 0Global Const BASS_DX8_PHASE_NEG_90 = 1Global Const BASS_DX8_PHASE_ZERO = 2Global Const BASS_DX8_PHASE_90 = 3Global Const BASS_DX8_PHASE_180 = 4Type GUID '用bass_init使用varptr(GUID)在CLSID参数 Data1 As Long Data2 As Integer Data3 As Integer Data4(0 To 7) As ByteEnd TypeDeclare Function BASS_SetConfig Lib "bass.dll" (ByVal opt As Long, ByVal value As Long) As LongDeclare Function BASS_GetConfig Lib "bass.dll" (ByVal opt As Long) As LongDeclare Function BASS_SetConfigPtr Lib "bass.dll" (ByVal opt As Long, ByVal value As Any) As LongDeclare Function BASS_GetConfigPtr Lib "bass.dll" (ByVal opt As Long) As LongDeclare Function BASS_GetVersion Lib "bass.dll" () As LongDeclare Function BASS_ErrorGetCode Lib "bass.dll" () As LongDeclare Function BASS_GetDeviceInfo Lib "bass.dll" (ByVal device As Long, ByRef info As BASS_DEVICEINFO) As LongDeclare Function BASS_Init Lib "bass.dll" (ByVal device As Long, ByVal freq As Long, ByVal flags As Long, ByVal win As Long, ByVal clsid As Long) As LongDeclare Function BASS_SetDevice Lib "bass.dll" (ByVal device As Long) As LongDeclare Function BASS_GetDevice Lib "bass.dll" () As LongDeclare Function BASS_Free Lib "bass.dll" () As LongDeclare Function BASS_GetDSoundObject Lib "bass.dll" (ByVal object As Long) As LongDeclare Function BASS_GetInfo Lib "bass.dll" (ByRef info As BASS_INFO) As LongDeclare Function BASS_Update Lib "bass.dll" (ByVal legnth As Long) As LongDeclare Function BASS_GetCPU Lib "bass.dll" () As SingleDeclare Function BASS_Start Lib "bass.dll" () As LongDeclare Function BASS_Stop Lib "bass.dll" () As LongDeclare Function BASS_Pause Lib "bass.dll" () As LongDeclare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Single) As LongDeclare Function BASS_GetVolume Lib "bass.dll" () As SingleDeclare Function BASS_PluginLoad Lib "bass.dll" (ByVal filename As String, ByVal flags As Long) As LongDeclare Function BASS_PluginFree Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_PluginGetInfo_ Lib "bass.dll" Alias "BASS_PluginGetInfo" (ByVal handle As Long) As LongDeclare Function BASS_Set3DFactors Lib "bass.dll" (ByVal distf As Single, ByVal rollf As Single, ByVal doppf As Single) As LongDeclare Function BASS_Get3DFactors Lib "bass.dll" (ByRef distf As Single, ByRef rollf As Single, ByRef doppf As Single) As LongDeclare Function BASS_Set3DPosition Lib "bass.dll" (ByRef pos As Any, ByRef vel As Any, ByRef front As Any, ByRef top As Any) As LongDeclare Function BASS_Get3DPosition Lib "bass.dll" (ByRef pos As Any, ByRef vel As Any, ByRef front As Any, ByRef top As Any) As LongDeclare Function BASS_Apply3D Lib "bass.dll" () As LongDeclare Function BASS_SetEAXParameters Lib "bass.dll" (ByVal env As Long, ByVal vol As Single, ByVal decay As Single, ByVal damp As Single) As LongDeclare Function BASS_GetEAXParameters Lib "bass.dll" (ByRef env As Long, ByRef vol As Single, ByRef decay As Single, ByRef damp As Single) As LongDeclare Function BASS_MusicLoad64 Lib "bass.dll" Alias "BASS_MusicLoad" (ByVal mem As Long, ByVal file As Any, ByVal offset As Long, ByVal offsethigh As Long, ByVal length As Long, ByVal flags As Long, ByVal freq As Long) As LongDeclare Function BASS_MusicFree Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_SampleLoad64 Lib "bass.dll" Alias "BASS_SampleLoad" (ByVal mem As Long, ByVal file As Any, ByVal offset As Long, ByVal offsethigh As Long, ByVal length As Long, ByVal max As Long, ByVal flags As Long) As LongDeclare Function BASS_SampleCreate Lib "bass.dll" (ByVal length As Long, ByVal freq As Long, ByVal chans As Long, ByVal max As Long, ByVal flags As Long) As LongDeclare Function BASS_SampleFree Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_SampleSetData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any) As LongDeclare Function BASS_SampleGetData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any) As LongDeclare Function BASS_SampleGetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_SAMPLE) As LongDeclare Function BASS_SampleSetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_SAMPLE) As LongDeclare Function BASS_SampleGetChannel Lib "bass.dll" (ByVal handle As Long, ByVal onlynew As Long) As LongDeclare Function BASS_SampleGetChannels Lib "bass.dll" (ByVal handle As Long, ByRef channels As Long) As LongDeclare Function BASS_SampleStop Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_StreamCreate Lib "bass.dll" (ByVal freq As Long, ByVal chans As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As LongDeclare Function BASS_StreamCreateFile64 Lib "bass.dll" Alias "BASS_StreamCreateFile" (ByVal mem As Long, ByVal file As Any, ByVal offset As Long, ByVal offsethigh As Long, ByVal length As Long, ByVal lengthhigh As Long, ByVal flags As Long) As LongDeclare Function BASS_StreamCreateURL Lib "bass.dll" (ByVal url As String, ByVal offset As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As LongDeclare Function BASS_StreamCreateFileUser Lib "bass.dll" (ByVal system As Long, ByVal flags As Long, ByVal procs As Long, ByVal user As Long) As LongDeclare Function BASS_StreamFree Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_StreamGetFilePosition Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long) As LongDeclare Function BASS_StreamPutData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any, ByVal length As Long) As LongDeclare Function BASS_StreamPutFileData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any, ByVal length As Long) As LongDeclare Function BASS_RecordGetDeviceInfo Lib "bass.dll" (ByVal device As Long, ByRef info As BASS_DEVICEINFO) As LongDeclare Function BASS_RecordInit Lib "bass.dll" (ByVal device As Long) As LongDeclare Function BASS_RecordSetDevice Lib "bass.dll" (ByVal device As Long) As LongDeclare Function BASS_RecordGetDevice Lib "bass.dll" () As LongDeclare Function BASS_RecordFree Lib "bass.dll" () As LongDeclare Function BASS_RecordGetInfo Lib "bass.dll" (ByRef info As BASS_RECORDINFO) As LongDeclare Function BASS_RecordGetInputName Lib "bass.dll" (ByVal inputn As Long) As LongDeclare Function BASS_RecordSetInput Lib "bass.dll" (ByVal inputn As Long, ByVal flags As Long, ByVal volume As Single) As LongDeclare Function BASS_RecordGetInput Lib "bass.dll" (ByVal inputn As Long, ByRef volume As Single) As LongDeclare Function BASS_RecordStart Lib "bass.dll" (ByVal freq As Long, ByVal chans As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As LongDeclare Function BASS_ChannelBytes2Seconds64 Lib "bass.dll" Alias "BASS_ChannelBytes2Seconds" (ByVal handle As Long, ByVal pos As Long, ByVal poshigh As Long) As DoubleDeclare Function BASS_ChannelSeconds2Bytes Lib "bass.dll" (ByVal handle As Long, ByVal pos As Double) As LongDeclare Function BASS_ChannelGetDevice Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_ChannelSetDevice Lib "bass.dll" (ByVal handle As Long, ByVal device As Long) As LongDeclare Function BASS_ChannelIsActive Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_ChannelGetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_CHANNELINFO) As LongDeclare Function BASS_ChannelGetTags Lib "bass.dll" (ByVal handle As Long, ByVal tags As Long) As LongDeclare Function BASS_ChannelFlags Lib "bass.dll" (ByVal handle As Long, ByVal flags As Long, ByVal mask As Long) As LongDeclare Function BASS_ChannelUpdate Lib "bass.dll" (ByVal handle As Long, ByVal length As Long) As LongDeclare Function BASS_ChannelLock Lib "bass.dll" (ByVal handle As Long, ByVal lock_ As Long) As LongDeclare Function BASS_ChannelPlay Lib "bass.dll" (ByVal handle As Long, ByVal restart As Long) As LongDeclare Function BASS_ChannelStop Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_ChannelPause Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_ChannelSetAttribute Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByVal value As Single) As LongDeclare Function BASS_ChannelGetAttribute Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByRef value As Single) As LongDeclare Function BASS_ChannelSlideAttribute Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByVal value As Single, ByVal time As Long) As LongDeclare Function BASS_ChannelIsSliding Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long) As LongDeclare Function BASS_ChannelSet3DAttributes Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long, ByVal min As Single, ByVal max As Single, ByVal iangle As Long, ByVal oangle As Long, ByVal outvol As Single) As LongDeclare Function BASS_ChannelGet3DAttributes Lib "bass.dll" (ByVal handle As Long, ByRef mode As Long, ByRef min As Single, ByRef max As Single, ByRef iangle As Long, ByRef oangle As Long, ByRef outvol As Single) As LongDeclare Function BASS_ChannelSet3DPosition Lib "bass.dll" (ByVal handle As Long, ByRef pos As Any, ByRef orient As Any, ByRef vel As Any) As LongDeclare Function BASS_ChannelGet3DPosition Lib "bass.dll" (ByVal handle As Long, ByRef pos As Any, ByRef orient As Any, ByRef vel As Any) As LongDeclare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long) As LongDeclare Function BASS_ChannelSetPosition64 Lib "bass.dll" Alias "BASS_ChannelSetPosition" (ByVal handle As Long, ByVal pos As Long, ByVal poshigh As Long, ByVal mode As Long) As LongDeclare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long) As LongDeclare Function BASS_ChannelGetLevel Lib "bass.dll" (ByVal handle As Long) As LongDeclare Function BASS_ChannelGetData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any, ByVal length As Long) As LongDeclare Function BASS_ChannelSetSync64 Lib "bass.dll" Alias "BASS_ChannelSetSync" (ByVal handle As Long, ByVal type_ As Long, ByVal param As Long, ByVal paramhigh As Long, ByVal proc As Long, ByVal user As Long) As LongDeclare Function BASS_ChannelRemoveSync Lib "bass.dll" (ByVal handle As Long, ByVal sync As Long) As LongDeclare Function BASS_ChannelSetDSP Lib "bass.dll" (ByVal handle As Long, ByVal proc As Long, ByVal user As Long, ByVal priority As Long) As LongDeclare Function BASS_ChannelRemoveDSP Lib "bass.dll" (ByVal handle As Long, ByVal dsp As Long) As LongDeclare Function BASS_ChannelSetLink Lib "bass.dll" (ByVal handle As Long, ByVal chan As Long) As LongDeclare Function BASS_ChannelRemoveLink Lib "bass.dll" (ByVal handle As Long, ByVal chan As Long) As LongDeclare Function BASS_ChannelSetFX Lib "bass.dll" (ByVal handle As Long, ByVal type_ As Long, ByVal priority As Long) As LongDeclare Function BASS_ChannelRemoveFX Lib "bass.dll" (ByVal handle As Long, ByVal fx As Long) As LongDeclare Function BASS_FXSetParameters Lib "bass.dll" (ByVal handle As Long, ByRef par As Any) As LongDeclare Function BASS_FXGetParameters Lib "bass.dll" (ByVal handle As Long, ByRef par As Any) As LongDeclare Function BASS_FXReset Lib "bass.dll" (ByVal handle As Long) As LongPrivate Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal length As Long)Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As Long) As LongPublic Function BASS_SPEAKER_N(ByVal n As Long) As LongBASS_SPEAKER_N = n * (2 ^ 24)End Function'32位包装64位低音功能Function BASS_MusicLoad(ByVal mem As Long, ByVal file As Long, ByVal offset As Long, ByVal length As Long, ByVal flags As Long, ByVal freq As Long) As LongBASS_MusicLoad = BASS_MusicLoad64(mem, file, offset, 0, length, flags Or BASS_UNICODE, freq)End FunctionFunction BASS_SampleLoad(ByVal mem As Long, ByVal file As Long, ByVal offset As Long, ByVal length As Long, ByVal max As Long, ByVal flags As Long) As LongBASS_SampleLoad = BASS_SampleLoad64(mem, file, offset, 0, length, max, flags Or BASS_UNICODE)End FunctionFunction BASS_StreamCreateFile(ByVal mem As Long, ByVal file As Long, ByVal offset As Long, ByVal length As Long, ByVal flags As Long) As LongBASS_StreamCreateFile = BASS_StreamCreateFile64(mem, file, offset, 0, length, 0, flags Or BASS_UNICODE)End FunctionFunction BASS_ChannelBytes2Seconds(ByVal handle As Long, ByVal pos As Long) As DoubleBASS_ChannelBytes2Seconds = BASS_ChannelBytes2Seconds64(handle, pos, 0)End FunctionFunction BASS_ChannelSetPosition(ByVal handle As Long, ByVal pos As Long, ByVal mode As Long) As LongBASS_ChannelSetPosition = BASS_ChannelSetPosition64(handle, pos, 0, mode)End FunctionFunction BASS_ChannelSetSync(ByVal handle As Long, ByVal type_ As Long, ByVal param As Long, ByVal proc As Long, ByVal user As Long) As LongBASS_ChannelSetSync = BASS_ChannelSetSync64(handle, type_, param, 0, proc, user)End Function'bass_plugingetinfo包装Function BASS_PluginGetInfo(ByVal handle As Long) As BASS_PLUGININFODim pinfo As BASS_PLUGININFO, plug As Longplug = BASS_PluginGetInfo_(handle)If plug Then Call CopyMemory(pinfo, ByVal plug, LenB(pinfo))End IfBASS_PluginGetInfo = pinfoEnd FunctionFunction BASS_PluginGetInfoFormat(ByVal handle As Long, ByVal index As Long) As BASS_PLUGINFORMDim pform As BASS_PLUGINFORM, plug As Longplug = BASS_PluginGetInfo(handle).formatsIf plug Then plug = plug (index * LenB(pform)) Call CopyMemory(pform, ByVal plug, LenB(pform))End IfBASS_PluginGetInfoFormat = pformEnd Function'回调函数Function STREAMPROC(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long 'CALLBACK FUNCTION !!! ' 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. End FunctionSub DOWNLOADPROC(ByVal buffer As Long, ByVal length As Long, ByVal user As Long) 'CALLBACK FUNCTION !!! ' 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 given when calling BASS_StreamCreateURL End SubSub SYNCPROC(ByVal handle As Long, ByVal channel As Long, ByVal data As Long, ByVal user As Long) 'CALLBACK FUNCTION !!! 'Similarly in here, write what to do when sync function 'is called, i.e screen flash etc. ' NOTE: a sync callback function should be very quick as other ' syncs cannot be processed until it has finished. ' 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 */ End SubSub DSPPROC(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) 'CALLBACK FUNCTION !!! ' VB doesn't support pointers, so you should copy the buffer into an array, ' process it, and then copy it back into the buffer. ' 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 End SubFunction RECORDPROC(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long 'CALLBACK FUNCTION !!! ' Recording callback function. ' handle : The recording handle ' buffer : Buffer containing the recorded samples ' length : Number of bytes ' user : The 'user' parameter value given when calling BASS_RecordStart ' RETURN : BASSTRUE = continue recording, BASSFALSE = stopEnd Function' 用户文件流的回调函数(bass_fileprocs)Sub FILECLOSEPROC(ByVal user As Long)End SubFunction FILELENPROC(ByVal user As Long) As Currency ' ???End FunctionFunction FILEREADPROC(ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As LongEnd FunctionFunction FILESEEKPROC(ByVal offset As Long, ByVal offsethigh As Long, ByVal user As Long) As LongEnd FunctionFunction BASS_SetEAXPreset(preset) As Long'这个函数是一个解决方案,因为VB不支持多个逗号分离“每个全局常量参数,简单地把eax_environment_xxx值函数'而bass_seteaxparameters你会在C / C Select Case presetSelect Case True Case EAX_ENVIRONMENT_GENERIC BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_GENERIC, 0.5, 1.493, 0.5) Case EAX_ENVIRONMENT_PADDEDCELL BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PADDEDCELL, 0.25, 0.1, 0) Case EAX_ENVIRONMENT_ROOM BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ROOM, 0.417, 0.4, 0.666) Case EAX_ENVIRONMENT_BATHROOM BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_BATHROOM, 0.653, 1.499, 0.166) Case EAX_ENVIRONMENT_LIVINGROOM BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_LIVINGROOM, 0.208, 0.478, 0) Case EAX_ENVIRONMENT_STONEROOM BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_STONEROOM, 0.5, 2.309, 0.888) Case EAX_ENVIRONMENT_AUDITORIUM BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_AUDITORIUM, 0.403, 4.279, 0.5) Case EAX_ENVIRONMENT_CONCERTHALL BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CONCERTHALL, 0.5, 3.961, 0.5) Case EAX_ENVIRONMENT_CAVE BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CAVE, 0.5, 2.886, 1.304) Case EAX_ENVIRONMENT_ARENA BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ARENA, 0.361, 7.284, 0.332) Case EAX_ENVIRONMENT_HANGAR BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_HANGAR, 0.5, 10, 0.3) Case EAX_ENVIRONMENT_CARPETEDHALLWAY BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153, 0.259, 2) Case EAX_ENVIRONMENT_HALLWAY BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_HALLWAY, 0.361, 1.493, 0) Case EAX_ENVIRONMENT_STONECORRIDOR BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_STONECORRIDOR, 0.444, 2.697, 0.638) Case EAX_ENVIRONMENT_ALLEY BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ALLEY, 0.25, 1.752, 0.776) Case EAX_ENVIRONMENT_FOREST BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_FOREST, 0.111, 3.145, 0.472) Case EAX_ENVIRONMENT_CITY BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CITY, 0.111, 2.767, 0.224) Case EAX_ENVIRONMENT_MOUNTAINS BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_MOUNTAINS, 0.194, 7.841, 0.472) Case EAX_ENVIRONMENT_QUARRY BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_QUARRY, 1, 1.499, 0.5) Case EAX_ENVIRONMENT_PLAIN BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PLAIN, 0.097, 2.767, 0.224) Case EAX_ENVIRONMENT_PARKINGLOT BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PARKINGLOT, 0.208, 1.652, 1.5) Case EAX_ENVIRONMENT_SEWERPIPE BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_SEWERPIPE, 0.652, 2.886, 0.25) Case EAX_ENVIRONMENT_UNDERWATER BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_UNDERWATER, 1, 1.499, 0) Case EAX_ENVIRONMENT_DRUGGED BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_DRUGGED, 0.875, 8.392, 1.388) Case EAX_ENVIRONMENT_DIZZY BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_DIZZY, 0.139, 17.234, 0.666) Case EAX_ENVIRONMENT_PSYCHOTIC BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PSYCHOTIC, 0.486, 7.563, 0.806)End SelectEnd FunctionPublic Function LoByte(ByVal lparam As Long) As LongLoByte = lparam And &HFF&End FunctionPublic Function HiByte(ByVal lparam As Long) As LongHiByte = (lparam And &HFF00&) / &H100&End FunctionPublic Function LoWord(ByVal lparam As Long) As LongLoWord = lparam And &HFFFF&End FunctionPublic Function HiWord(ByVal lparam As Long) As LongIf lparam < 0 Then HiWord = (lparam \ &H10000 - 1) And &HFFFF&Else HiWord = lparam \ &H10000End IfEnd FunctionFunction MakeWord(ByVal LoByte As Long, ByVal HiByte As Long) As LongMakeWord = (LoByte And &HFF&) Or ((HiByte And &HFF&) * &H100&)End FunctionFunction MakeLong(ByVal LoWord As Long, ByVal HiWord As Long) As LongMakeLong = LoWord And &HFFFF&HiWord = HiWord And &HFFFF&If HiWord And &H8000& Then MakeLong = MakeLong Or (((HiWord And &H7FFF&) * &H10000) Or &H80000000)Else MakeLong = MakeLong Or (HiWord * &H10000)End IfEnd FunctionPublic Function VBStrFromAnsiPtr(ByVal lpStr As Long) As StringDim bStr() As ByteDim cChars As LongOn Error Resume Next'获得缓冲区中的字符数cChars = lstrlen(lpStr)If cChars Then '调整大小的字节数组。 ReDim bStr(0 To cChars - 1) As Byte '抓住ANSI缓冲 Call CopyMemory(bStr(0), ByVal lpStr, cChars)End If'现在一个Unicode字符串转换为VBVBStrFromAnsiPtr = StrConv(bStr, vbUnicode)End Function

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复