WankaUSR wrote:
i need some help. I'm trying to use bass_aac.dll after BASS_Init()
Code:
dll=bass_aac.dll
BASS_%dll%_Init()
I have tried using only aac and bass_aac as the dll var but it doesn't recognize the stream. what am I doing wrong?
Please pay attention before posting: in the moment you posted your question, bassaac.ahk wasn't released yet and wasn't supported.
Note you don't need to #include plugin libraries anymore. All you need to do is to call bass.ahk
From example3:
Code:
/*
BASS Library - Stream GUI (AAC Only) Example
by k3ph
required files: bass.dll, bass_aac.dll, bass.ahk, bassaac.ahk
if apple lossless is required, add: bass_alac.dll, bassalac.ahk and dont forget to call BASS_ALAC_Init() and free it with BASS_ALAC_Free()
*/
#NoEnv
#SingleInstance Force
#Persistent
Critical,On
onexit, exit
; include bass :)
#Include bass.ahk
; load bass :)
BASS_Load()
; you can load anything, anytime
BASS_Init(-1,44100,0,0,0)
BASS_AAC_Init()
; gui things
PM_gui = 1
PM_ControlID = own
PM_widthInSegments = 200
PM_height = 100
PM_color = green
PM_bgcolor = gray
PM_xpos = 0
PM_ypos = 0
Add_ProgressMeter(PM_gui, PM_ControlID, PM_widthInSegments, PM_height, PM_color, PM_bgcolor, PM_xpos, PM_ypos)
SetTimer, showstream, 250
gosub visualstream
gosub openstream
; some hotkeys
#IfWinActive Stream GUI
r::gosub reverb
c::gosub chorus
^c::gosub compressor
p::gosub parameq
d::gosub distortion
e::gosub echo
f::gosub flanger
g::gosub gargle
i::gosub i3dl2reverb
o::gosub openstream
!F4::gosub exit
^F4::reload
#IfWinActive
return
reverb:
;BASS_FXSetParameters(BASS_FX_DX8_REVERB,0.001)
BASS_ChannelSetFX(stream,BASS_FX_DX8_REVERB,0)
return
chorus:
BASS_ChannelSetFX(stream,BASS_FX_DX8_CHORUS,0)
return
compressor:
BASS_ChannelSetFX(stream,BASS_FX_DX8_COMPRESSOR,0)
return
distortion:
BASS_ChannelSetFX(stream,BASS_FX_DX8_DISTORTION,0)
return
echo:
BASS_ChannelSetFX(stream,BASS_FX_DX8_ECHO,0)
return
flanger:
BASS_ChannelSetFX(stream,BASS_FX_DX8_FLANGER,0)
return
gargle:
BASS_ChannelSetFX(stream,BASS_FX_DX8_GARGLE,0)
return
i3dl2reverb:
BASS_ChannelSetFX(stream,BASS_FX_DX8_I3DL2REVERB,0)
return
parameq:
BASS_ChannelSetFX(stream,BASS_FX_DX8_PARAMEQ,0)
return
openstream:
BASS_ChannelStop(stream)
fileselectfile, file, 1, , select a song,(*.mp3;*.mp2;*.mp1;*.ogg;*.oga;*.wav;*.aiff;*.aac;*.mp4;*.m4a)
if file =
traytip, , please select a file
else
bass=bass.dll
stream:=BASS_StreamCreateFile(false,file,0,0,4)
BASS_ChannelPlay(stream,0)
return
visualstream:
Gui, %PM_gui%:+AlwaysOnTop +Owner
Gui, %PM_gui%:Show, NoActivate, Stream GUI
return
showstream:
kchannellevel := 10000000*2.5
channellevel := BASS_ChannelGetLevel( stream )
if (channellevel = "-1")
level2progress = 0
level2progress := abs(channellevel) / kchannellevel
Update_ProgressMeter(PM_gui, PM_ControlID, level2progress)
return
/*
zed gecko's gui code
Add_ProgressMeter adds a "progress-meter" Control to a Gui.
It can only be used on a Gui with a number (like Gui, 1: or Gui, 99:)but not on a unnumbered Gui.
The generated control can disply the fluctuation of value in a range from 0 - 100.
Usage : Add_ProgressMeter(PM_gui, PM_ControlID, PM_widthInSegments, PM_height, PM_color, PM_bgcolor, PM_xpos, PM_ypos)
PM_gui = the number of the Gui
PM_ControlID = the name of the progress meter control. Use the same name with the "Update_ProgressMeter"-function
PM_widthInSegments = the width of the control in segments. (Each segment is of 2 pixel width)
PM_height = the height of the control in pixel
PM_color = the color of the progress-meter
PM_bgcolor = the background-color of the progress-meter
PM_xpos = the X-position of the controls top-left corner
PM_ypos = the Y-position of the controls top-left corner
(if the X and Y position are both omited or set to 0, the control uses automatic positioning)
*/
Add_ProgressMeter(PM_gui, PM_ControlID, PM_widthInSegments, PM_height, PM_color, PM_bgcolor, PM_xpos = 0, PM_ypos = 0)
{
global
PM_segmentspace = 2 ;this is the visible size of on segment in pixel
PM_segmentsize := (PM_segmentspace + 1)
PM_widthInSegments += -1
%PM_ControlID%_Segments := PM_widthInSegments
if (PM_xpos = 0 AND PM_ypos = 0)
{
Gui, %PM_gui%:Add, Progress, v%PM_ControlID%0 w%PM_segmentsize% h%PM_height% c%PM_color% Background%PM_bgcolor% Vertical,
}
else
{
Gui, %PM_gui%:Add, Progress, v%PM_ControlID%0 w%PM_segmentsize% h%PM_height% x%PM_xpos% y%PM_ypos% c%PM_color% Background%PM_bgcolor% Vertical,
}
Loop, %PM_widthInSegments%
{
Gui, %PM_gui%:Add, Progress, v%PM_ControlID%%A_Index% w%PM_segmentsize% h%PM_height% xp+%PM_segmentspace% c%PM_color% Background%PM_bgcolor% Vertical,
}
}
/*
Update_ProgressMeter puts new contents in the progress-meter control created by Add_ProgressMeter.
Usage: Update_ProgressMeter(PM_gui, PM_ControlID, PM_NewContent)
PM_gui = the number of the Gui the control is located in.
PM_ControlID = the name of the progress meter control. Use the name that was used in the "Add_ProgressMeter"-function
PM_NewContent = the new content of the control. it must be a number between 0 and 100.
the new content will be displayed in the most-right segment.
*/
Update_ProgressMeter(PM_gui, PM_ControlID, PM_NewContent = 0)
{
PM_oldSegments := %PM_ControlID%_Segments
Loop, %PM_oldSegments%
{
PM_NewSegment := A_Index - 1
GuiControlGet, PM_Transfervar, %PM_gui%:, %PM_ControlID%%A_Index%
GuiControl,%PM_gui%:, %PM_ControlID%%PM_NewSegment%, %PM_Transfervar%
}
GuiControl,%PM_gui%:, %PM_ControlID%%PM_oldSegments%, %PM_NewContent%
}
return
guiclose1:
guiescape:
guiclose:
goto exit
return
exit:
; stops the stream
BASS_ChannelStop(stream)
; flushes what was loaded before
BASS_AAC_Free()
BASS_Free()
ExitApp
(note that apple lossless m4a isnt supported by the bass_aac but its supported by bass_alac !)
Enjoy!