音频支持库
bass可以免费用于非商业程序
获取最后一次调用BASS接口发生的错误代码
获取最后一次调用BASS接口发生的错误名
参数指定设备名,返回设备索引
返回音频设备索引
返回可用设备音频信息数组
初始化设备,
所有参数为可选参数,
参数 @device 可指定设备索引或设备名称,1表示第一个音频输出设备,
参数 @freq 用一个数值指定输出采样率,默认为 192000Hz
其他参数请参考BASS文档
成功返回 true,失败可用 bass.errorCode 或 errorName 获取错误原因
指定音频设备索引,
参数为 bass.getDeviceInfos 返回的音频设备数组中对应设备的数组索引值,1 为第 1 个设备。
参数指定的设备索引如果未初始化则自动调用 bass.init 函数初始化,
在打开音频前调用才会改变该音频默认输出设备
_BASS_3DALG_DEFAULT=0
_BASS_3DALG_FULL=2
_BASS_3DALG_LIGHT=3
_BASS_3DALG_OFF=1
_BASS_3DMODE_NORMAL=0
_BASS_3DMODE_OFF=2
_BASS_3DMODE_RELATIVE=1
_BASS_ACTIVE_PAUSED=3
_BASS_ACTIVE_PAUSED_DEVICE=4
_BASS_ACTIVE_PLAYING=1
_BASS_ACTIVE_STALLED=2
_BASS_ACTIVE_STOPPED=0
_BASS_ASYNCFILE=0x40000000
_BASS_ATTRIB_BITRATE=0xC
_BASS_ATTRIB_BUFFER=0xD
_BASS_ATTRIB_CPU=7
_BASS_ATTRIB_EAXMIX=4
_BASS_ATTRIB_FREQ=1
_BASS_ATTRIB_MUSIC_ACTIVE=0x106
_BASS_ATTRIB_MUSIC_AMPLIFY=0x100
_BASS_ATTRIB_MUSIC_BPM=0x103
_BASS_ATTRIB_MUSIC_PANSEP=0x101
_BASS_ATTRIB_MUSIC_PSCALER=0x102
_BASS_ATTRIB_MUSIC_SPEED=0x104
_BASS_ATTRIB_MUSIC_VOL_CHAN=0x200
_BASS_ATTRIB_MUSIC_VOL_GLOBAL=0x105
_BASS_ATTRIB_MUSIC_VOL_INST=0x300
_BASS_ATTRIB_NET_RESUME=9
_BASS_ATTRIB_NOBUFFER=5
_BASS_ATTRIB_NORAMP=0xB
_BASS_ATTRIB_PAN=3
_BASS_ATTRIB_SCANINFO=0xA
_BASS_ATTRIB_SRC=8
_BASS_ATTRIB_VBR=6
_BASS_ATTRIB_VOL=2
_BASS_CONFIG_3DALGORITHM=0xA
_BASS_CONFIG_AIRPLAY=0x31
_BASS_CONFIG_AM_DISABLE=0x3A
_BASS_CONFIG_ASYNCFILE_BUFFER=0x2D
_BASS_CONFIG_BUFFER=0
_BASS_CONFIG_CURVE_PAN=8
_BASS_CONFIG_CURVE_VOL=7
_BASS_CONFIG_DEV_BUFFER=0x1B
_BASS_CONFIG_DEV_DEFAULT=0x24
_BASS_CONFIG_DEV_NONSTOP=0x32
_BASS_CONFIG_DEV_PERIOD=0x35
_BASS_CONFIG_FLOAT=0x36
_BASS_CONFIG_FLOATDSP=9
_BASS_CONFIG_GVOL_MUSIC=6
_BASS_CONFIG_GVOL_SAMPLE=4
_BASS_CONFIG_GVOL_STREAM=5
_BASS_CONFIG_HANDLES=0x29
_BASS_CONFIG_IOS_MIXAUDIO=0x22
_BASS_CONFIG_IOS_NOCATEGORY=0x33
_BASS_CONFIG_IOS_NOTIFY=0x2E
_BASS_CONFIG_IOS_SPEAKER=0x27
_BASS_CONFIG_LIBSSL=0x40
_BASS_CONFIG_MF_DISABLE=0x28
_BASS_CONFIG_MF_VIDEO=0x30
_BASS_CONFIG_MUSIC_VIRTUAL=0x16
_BASS_CONFIG_NET_AGENT=0x10
_BASS_CONFIG_NET_BUFFER=0xC
_BASS_CONFIG_NET_PASSIVE=0x12
_BASS_CONFIG_NET_PLAYLIST=0x15
_BASS_CONFIG_NET_PLAYLIST_DEPTH=0x3B
_BASS_CONFIG_NET_PREBUF=0xF
_BASS_CONFIG_NET_PREBUF_WAIT=0x3C
_BASS_CONFIG_NET_PROXY=0x11
_BASS_CONFIG_NET_READTIMEOUT=0x25
_BASS_CONFIG_NET_SEEK=0x38
_BASS_CONFIG_NET_TIMEOUT=0xB
_BASS_CONFIG_OGG_PRESCAN=0x2F
_BASS_CONFIG_PAUSE_NOPLAY=0xD
_BASS_CONFIG_REC_BUFFER=0x13
_BASS_CONFIG_REC_LOOPBACK=0x1C
_BASS_CONFIG_REC_WASAPI=0x42
_BASS_CONFIG_SRC=0x2B
_BASS_CONFIG_SRC_SAMPLE=0x2C
_BASS_CONFIG_UNICODE=0x2A
_BASS_CONFIG_UPDATEPERIOD=1
_BASS_CONFIG_UPDATETHREADS=0x18
_BASS_CONFIG_VERIFY=0x17
_BASS_CONFIG_VERIFY_NET=0x34
_BASS_CONFIG_VISTA_SPEAKERS=0x26
_BASS_CONFIG_VISTA_TRUEPOS=0x1E
_BASS_CONFIG_WASAPI_PERSIST=0x41
_BASS_CTYPE_MUSIC_IT=0x20004
_BASS_CTYPE_MUSIC_MOD=0x20000
_BASS_CTYPE_MUSIC_MTM=0x20001
_BASS_CTYPE_MUSIC_S3M=0x20002
_BASS_CTYPE_MUSIC_XM=0x20003
_BASS_CTYPE_RECORD=2
_BASS_CTYPE_SAMPLE=1
_BASS_CTYPE_STREAM=0x10000
_BASS_CTYPE_STREAM_AIFF=0x10006
_BASS_CTYPE_STREAM_AM=0x10009
_BASS_CTYPE_STREAM_CA=0x10007
_BASS_CTYPE_STREAM_DEVICE=0x18001
_BASS_CTYPE_STREAM_DUMMY=0x18000
_BASS_CTYPE_STREAM_MF=0x10008
_BASS_CTYPE_STREAM_MP1=0x10003
_BASS_CTYPE_STREAM_MP2=0x10004
_BASS_CTYPE_STREAM_MP3=0x10005
_BASS_CTYPE_STREAM_OGG=0x10002
_BASS_CTYPE_STREAM_WAV=0x40000
_BASS_CTYPE_STREAM_WAV_FLOAT=0x50003
_BASS_CTYPE_STREAM_WAV_PCM=0x50001
_BASS_DATA_AVAILABLE=0
_BASS_DATA_FFT1024=0x80000002
_BASS_DATA_FFT16384=0x80000006
_BASS_DATA_FFT2048=0x80000003
_BASS_DATA_FFT256=0x80000000
_BASS_DATA_FFT32768=0x80000007
_BASS_DATA_FFT4096=0x80000004
_BASS_DATA_FFT512=0x80000001
_BASS_DATA_FFT8192=0x80000005
_BASS_DATA_FFT_COMPLEX=0x80
_BASS_DATA_FFT_INDIVIDUAL=0x10
_BASS_DATA_FFT_NOWINDOW=0x20
_BASS_DATA_FFT_NYQUIST=0x100
_BASS_DATA_FFT_REMOVEDC=0x40
_BASS_DATA_FIXED=0x20000000
_BASS_DATA_FLOAT=0x40000000
_BASS_DEVICES_AIRPLAY=0x1000000
_BASS_DEVICE_16BITS=8
_BASS_DEVICE_3D=4
_BASS_DEVICE_8BITS=1
_BASS_DEVICE_AUDIOTRACK=0x20000
_BASS_DEVICE_CPSPEAKERS=0x400
_BASS_DEVICE_DEFAULT=2
_BASS_DEVICE_DMIX=0x2000
_BASS_DEVICE_DSOUND=0x40000
_BASS_DEVICE_ENABLED=1
_BASS_DEVICE_FREQ=0x4000
_BASS_DEVICE_HOG=0x10000
_BASS_DEVICE_INIT=4
_BASS_DEVICE_LATENCY=0x100
_BASS_DEVICE_LOOPBACK=8
_BASS_DEVICE_MONO=2
_BASS_DEVICE_NOSPEAKER=0x1000
_BASS_DEVICE_SPEAKERS=0x800
_BASS_DEVICE_STEREO=0x8000
_BASS_DEVICE_TYPE_DIGITAL=0x8000000
_BASS_DEVICE_TYPE_DISPLAYPORT=0x40000000
_BASS_DEVICE_TYPE_HANDSET=0x7000000
_BASS_DEVICE_TYPE_HDMI=0xA000000
_BASS_DEVICE_TYPE_HEADPHONES=0x4000000
_BASS_DEVICE_TYPE_HEADSET=0x6000000
_BASS_DEVICE_TYPE_LINE=0x3000000
_BASS_DEVICE_TYPE_MASK=0xFF000000
_BASS_DEVICE_TYPE_MICROPHONE=0x5000000
_BASS_DEVICE_TYPE_NETWORK=0x1000000
_BASS_DEVICE_TYPE_SPDIF=0x9000000
_BASS_DEVICE_TYPE_SPEAKERS=0x2000000
_BASS_DX8_PHASE_180=4
_BASS_DX8_PHASE_90=3
_BASS_DX8_PHASE_NEG_180=0
_BASS_DX8_PHASE_NEG_90=1
_BASS_DX8_PHASE_ZERO=2
_BASS_ERROR_ALREADY=0xE
_BASS_ERROR_BUFLOST=4
_BASS_ERROR_BUSY=0x2E
_BASS_ERROR_CODEC=0x2C
_BASS_ERROR_CREATE=0x21
_BASS_ERROR_DECODE=0x26
_BASS_ERROR_DEVICE=0x17
_BASS_ERROR_DRIVER=3
_BASS_ERROR_DX=0x27
_BASS_ERROR_EMPTY=0x1F
_BASS_ERROR_ENDED=0x2D
_BASS_ERROR_FILEFORM=0x29
_BASS_ERROR_FILEOPEN=2
_BASS_ERROR_FORMAT=6
_BASS_ERROR_FREQ=0x19
_BASS_ERROR_HANDLE=5
_BASS_ERROR_ILLPARAM=0x14
_BASS_ERROR_ILLTYPE=0x13
_BASS_ERROR_INIT=8
_BASS_ERROR_MEM=1
_BASS_ERROR_NO3D=0x15
_BASS_ERROR_NOCHAN=0x12
_BASS_ERROR_NOEAX=0x16
_BASS_ERROR_NOFX=0x22
_BASS_ERROR_NOHW=0x1D
_BASS_ERROR_NONET=0x20
_BASS_ERROR_NOPLAY=0x18
_BASS_ERROR_NOTAVAIL=0x25
_BASS_ERROR_NOTFILE=0x1B
_BASS_ERROR_POSITION=7
_BASS_ERROR_SPEAKER=0x2A
_BASS_ERROR_SSL=0xA
_BASS_ERROR_START=9
_BASS_ERROR_TIMEOUT=0x28
_BASS_ERROR_UNKNOWN=-1
_BASS_ERROR_VERSION=0x2B
_BASS_FILEDATA_END=0
_BASS_FILEPOS_ASYNCBUF=7
_BASS_FILEPOS_BUFFER=5
_BASS_FILEPOS_BUFFERING=9
_BASS_FILEPOS_CONNECTED=4
_BASS_FILEPOS_CURRENT=0
_BASS_FILEPOS_DECODE=0
_BASS_FILEPOS_DOWNLOAD=1
_BASS_FILEPOS_END=2
_BASS_FILEPOS_SIZE=8
_BASS_FILEPOS_SOCKET=6
_BASS_FILEPOS_START=3
_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
_BASS_INPUT_OFF=0x10000
_BASS_INPUT_ON=0x20000
_BASS_INPUT_TYPE_ANALOG=0xA000000
_BASS_INPUT_TYPE_AUX=0x9000000
_BASS_INPUT_TYPE_CD=0x5000000
_BASS_INPUT_TYPE_DIGITAL=0x1000000
_BASS_INPUT_TYPE_LINE=0x2000000
_BASS_INPUT_TYPE_MASK=0xFF000000
_BASS_INPUT_TYPE_MIC=0x3000000
_BASS_INPUT_TYPE_PHONE=0x6000000
_BASS_INPUT_TYPE_SPEAKER=0x7000000
_BASS_INPUT_TYPE_SYNTH=0x4000000
_BASS_INPUT_TYPE_UNDEF=0
_BASS_INPUT_TYPE_WAVE=0x8000000
_BASS_IOSNOTIFY_INTERRUPT_END=2
_BASS_LEVEL_MONO=1
_BASS_LEVEL_RMS=4
_BASS_LEVEL_STEREO=2
_BASS_LEVEL_VOLPAN=8
_BASS_MP3_IGNOREDELAY=0x200
_BASS_MP3_SETPOS=0x20000
_BASS_MUSIC_3D=8
_BASS_MUSIC_AUTOFREE=0x40000
_BASS_MUSIC_CALCLEN=0x20000
_BASS_MUSIC_DECODE=0x200000
_BASS_MUSIC_FLOAT=0x100
_BASS_MUSIC_FT2MOD=0x2000
_BASS_MUSIC_FT2PAN=0x2000
_BASS_MUSIC_FX=0x80
_BASS_MUSIC_LOOP=4
_BASS_MUSIC_MONO=2
_BASS_MUSIC_NONINTER=0x10000
_BASS_MUSIC_NOSAMPLE=0x100000
_BASS_MUSIC_POSRESET=0x8000
_BASS_MUSIC_POSRESETEX=0x400000
_BASS_MUSIC_PRESCAN=0x20000
_BASS_MUSIC_PT1MOD=0x4000
_BASS_MUSIC_RAMP=0x200
_BASS_MUSIC_RAMPS=0x400
_BASS_MUSIC_SINCINTER=0x800000
_BASS_MUSIC_STOPBACK=0x80000
_BASS_MUSIC_SURROUND=0x800
_BASS_MUSIC_SURROUND2=0x1000
_BASS_NODEVICE=0x20000
_BASS_OBJECT_DS=1
_BASS_OBJECT_DS3DL=2
_BASS_OK=0
_BASS_ORIGRES_FLOAT=0x10000
_BASS_POS_BYTE=0
_BASS_POS_DECODE=0x10000000
_BASS_POS_DECODETO=0x20000000
_BASS_POS_INEXACT=0x8000000
_BASS_POS_MUSIC_ORDER=1
_BASS_POS_OGG=3
_BASS_POS_RELATIVE=0x4000000
_BASS_POS_RESET=0x2000000
_BASS_POS_SCAN=0x40000000
_BASS_RECORD_AGC=0x4000
_BASS_RECORD_ECHOCANCEL=0x2000
_BASS_RECORD_PAUSE=0x8000
_BASS_SAMPLE_3D=8
_BASS_SAMPLE_8BITS=1
_BASS_SAMPLE_FLOAT=0x100
_BASS_SAMPLE_FX=0x80
_BASS_SAMPLE_LOOP=4
_BASS_SAMPLE_MONO=2
_BASS_SAMPLE_MUTEMAX=0x20
_BASS_SAMPLE_OVER_DIST=0x30000
_BASS_SAMPLE_OVER_POS=0x20000
_BASS_SAMPLE_OVER_VOL=0x10000
_BASS_SAMPLE_SOFTWARE=0x10
_BASS_SAMPLE_VAM=0x40
_BASS_SLIDE_LOG=0x1000000
_BASS_SPEAKER_CENLFE=0x3000000
_BASS_SPEAKER_CENTER=0x13000000
_BASS_SPEAKER_FRONT=0x1000000
_BASS_SPEAKER_FRONTLEFT=0x11000000
_BASS_SPEAKER_FRONTRIGHT=0x21000000
_BASS_SPEAKER_LEFT=0x10000000
_BASS_SPEAKER_LFE=0x23000000
_BASS_SPEAKER_REAR=0x2000000
_BASS_SPEAKER_REAR2=0x4000000
_BASS_SPEAKER_REAR2LEFT=0x14000000
_BASS_SPEAKER_REAR2RIGHT=0x24000000
_BASS_SPEAKER_REARLEFT=0x12000000
_BASS_SPEAKER_REARRIGHT=0x22000000
_BASS_SPEAKER_RIGHT=0x20000000
_BASS_STREAMPROC_END=0x80000000
_BASS_STREAM_AUTOFREE=0x40000
_BASS_STREAM_BLOCK=0x100000
_BASS_STREAM_DECODE=0x200000
_BASS_STREAM_PRESCAN=0x20000
_BASS_STREAM_RESTRATE=0x80000
_BASS_STREAM_STATUS=0x800000
_BASS_SYNC_DEV_FAIL=0xE
_BASS_SYNC_DEV_FORMAT=0xF
_BASS_SYNC_DOWNLOAD=7
_BASS_SYNC_END=2
_BASS_SYNC_FREE=8
_BASS_SYNC_META=4
_BASS_SYNC_MIXTIME=0x40000000
_BASS_SYNC_MUSICFX=3
_BASS_SYNC_MUSICINST=1
_BASS_SYNC_MUSICPOS=0xA
_BASS_SYNC_OGG_CHANGE=0xC
_BASS_SYNC_ONETIME=0x80000000
_BASS_SYNC_POS=0
_BASS_SYNC_SETPOS=0xB
_BASS_SYNC_SLIDE=5
_BASS_SYNC_STALL=6
_BASS_TAG_AM_MIME=0xF
_BASS_TAG_AM_NAME=0x10
_BASS_TAG_APE=6
_BASS_TAG_APE_BINARY=0x1000
_BASS_TAG_CA_CODEC=0xB
_BASS_TAG_HTTP=3
_BASS_TAG_ICY=4
_BASS_TAG_ID3=0
_BASS_TAG_ID3V2=1
_BASS_TAG_LYRICS3=0xA
_BASS_TAG_META=5
_BASS_TAG_MF=0xD
_BASS_TAG_MP4=7
_BASS_TAG_MUSIC_AUTH=0x10003
_BASS_TAG_MUSIC_INST=0x10100
_BASS_TAG_MUSIC_MESSAGE=0x10001
_BASS_TAG_MUSIC_NAME=0x10000
_BASS_TAG_MUSIC_ORDERS=0x10002
_BASS_TAG_MUSIC_SAMPLE=0x10300
_BASS_TAG_OGG=2
_BASS_TAG_RIFF_BEXT=0x101
_BASS_TAG_RIFF_CART=0x102
_BASS_TAG_RIFF_CUE=0x104
_BASS_TAG_RIFF_DISP=0x103
_BASS_TAG_RIFF_INFO=0x100
_BASS_TAG_RIFF_SMPL=0x105
_BASS_TAG_VENDOR=9
_BASS_TAG_WAVEFORMAT=0xE
_BASS_TAG_WMA=8
_BASS_UNICODE=0x80000000
_BASS_VAM_HARDWARE=1
_BASS_VAM_SOFTWARE=2
_BASS_VAM_TERM_DIST=8
_BASS_VAM_TERM_PRIO=0x10
_BASS_VAM_TERM_TIME=4
_DSCAPS_CERTIFIED=0x40
_DSCAPS_CONTINUOUSRATE=0x10
_DSCAPS_EMULDRIVER=0x20
_DSCAPS_SECONDARY16BIT=0x800
_DSCAPS_SECONDARY8BIT=0x400
_DSCAPS_SECONDARYMONO=0x100
_DSCAPS_SECONDARYSTEREO=0x200
_STREAMFILE_BUFFER=1
_STREAMFILE_BUFFERPUSH=2
_STREAMFILE_NOBUFFER=0
_STREAMPROC_DEVICE=-2
_STREAMPROC_DEVICE_3D=-3
_STREAMPROC_DUMMY=0
_STREAMPROC_PUSH=-1