Code: Select all
#NoEnv
SetBatchLines -1
ListLines Off
BASS_DLLCALL:= DllCall("LoadLibrary","str",A_ScriptDir "\bass.dll") ; Load Bass.dll
BASS_Init:= DllCall(A_ScriptDir . "\bass.dll\BASS_Init",Int,-1,UInt,44100,Int,0,UInt,0,UInt,0) ; initialise Bass
song:= DllCall(A_ScriptDir "\bass.dll\BASS_StreamCreateFile", Int, 0, Astr, "2.ogg", Uint, 0, Uint, 0, Uint, 0, Uint, 0) ; Create Stream or Buff in Memory; song is the handle
BASS_ChannelFlags:=DllCall(A_ScriptDir . "\bass.dll\BASS_ChannelFlags", UInt, song, Astr, BASS_SAMPLE_LOOP, Astr, BASS_SAMPLE_LOOP) ; Loops the file
BASS_ChannelPlay:=DllCall(A_ScriptDir . "\bass.dll\BASS_ChannelPlay", UInt, song, Int, 1) ; Starts playback
return
q::
DllCall(A_ScriptDir "\bass.dll\BASS_Free") ; Free Bass Contents
ExitApp
return