BASS Library - extreme AHK multimedia power!
BASS for powerful extensible AHK multimedia >:D !
It gives AHK power to play on-the-fly soundfiles, stream, recording, mixing, adding effects using EAX, DX8 etc everything in a tiny 96KB dll.
BASS can be extended with plugins, supporting many sound format. It can load VST and Winamp plugins for effects DSP, read ID3v1, ID3v2.2/3/4,OGG/FLAC, WMA, APE, OFR, MPC, AAC tags etc. And even video playback!
BASS Streamable built-in (*.mp3;*.mp2;*.mp1;*.ogg;*.oga;*.wav;*.aif;*.aiff;*.aifc;)
BASS Modules built-in (*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;)
CD Audio (*.cda;)
Free Lossless Audio Codec (*.flac;)
MIDI (*.midi;*.mid;*.mus;*.rmi;*.kar;)
Windows Media Audio (*.wma;*.wmv;*.wmp;*.asf;)
AAC (*.aac;*.mp4;*.m4a;*.m4b;*.m4p;)
WavPack Audio Codec (*.wv;*.wvc;)
Monkey's Audio (*.ape;)
MusePack (*.mpc;*.mpp;*.mp+;)
Dolby Digital (*.ac3;)
Apple Lossless (*.mp4;*.m4a;*.m4b;*.m4p;)
Speex (*.spx;*.wav;*.oga;*.ogg;)
The True Audio (*.tta;)
OptimFROG (*.ofr;)
Video (*.avi;*.mkv;*.mp4;*.wmv;*.mpeg;*.mpg;)
*The list refers to the supported fileformats with BASS and its native plugins
**Video supported filetypes are still being listed, also its video codecs handling.
___
[ information ]
- Official WebSite of BASS Lib
- BASS code developer WebSite
___
[ related projects ]
- Trout Player
[ profile ]
I look forward to to the final version. Keep us informed.-BASS Library is _f_huge, it has many features. Currently I've wrapped 25% of it (going to release as revision 1), please wait.
Hmm, shouldn't there be a way to keep the DLL within the memory at all times, so that you don't have to write it to the HDD?
(Was this thread deleted or something iirc I replied to this )
Hmm, shouldn't there be a way to keep the DLL within the memory at all times, so that you don't have to write it to the HDD?
You are probably confusing this thread with the BASSMOD Library
Yes it would be a nice idea to wrap the DLL, but you don't need to write, just download it once.
[ profile ]
You are probably confusing this thread with the BASSMOD Library
Yes it would be a nice idea to wrap the DLL, but you don't need to write, just download it once.
Oh, lulz, keke. yeah, dw using a external dll isn't such a big deal...
You are probably confusing this thread with the BASSMOD Library
Yes it would be a nice idea to wrap the DLL, but you don't need to write, just download it once.
Oh, lulz, keke. yeah, dw using a external dll isn't such a big deal...
what is not big deal? many sound players uses bass as core.
what is not big deal? many sound players uses bass as core.
Bah, didn't feel like pressuring him into doing it...
Notes: the SVN is current down and more examples coming soon for the non-basic functions test. Stay in BASS tune!
[ profile ]
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?
i need some help. I'm trying to use bass_aac.dll after BASS_Init()
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:
/* 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!
[ profile ]
BASS_ChannelGetTags(handle,tags,return_type="Str"){ global Return DllCall(BASS_DLLPATH . BASS_DLL . "\BASS_ChannelGetTags", UInt, handle, UInt, tags, return_type) } BASS_ChannelGetTags_List(handle,tags,delim){ ptr := BASS_ChannelGetTags(handle,tags,"Int") Loop { item := DllCall("MulDiv", Int, ptr, Int, 1, Int, 1, Str) if item = break list .= item delim ptr += StrLen(item) + 1 } return SubStr(list,1,-StrLen(delim)) }Below are examples of usage and output.
MsgBox % BASS_ChannelGetTags( hStream, BASS_TAG_HTTP ) /* HTTP/1.0 200 OK */ MsgBox % BASS_ChannelGetTags_List( hStream, BASS_TAG_HTTP, "`n" ) /* HTTP/1.0 200 OK Content-Type: audio/mpeg icy-br:192 ice-audio-info: ice-samplerate=44100;ice-bitrate=192;ice-channels=2 icy-br:192 icy-description:This is my server description icy-genre:Rock icy-name:This is my server name icy-private:0 icy-pub:1 icy-url:http://www.oddsock.org Server: Icecast 2.3.2 Cache-Control: no-cache icy-metaint:16000 */
Also a warning about bass.dll callbacks: they are typically called by a worker thread. Even if no other thread is executing script, it is not guaranteed to work correctly. If the callback is too slow or calls a command that checks for messages, the thread may deadlock. Placing Critical N (where the callback will not run for N ms) on the first line of the callback function is a partial solution.
A proper solution would be to use a DLL or machine code to "route" the call to the proper thread.
(I've been helping Skwire with callbacks set via BASS_StreamCreateURL and BASS_ChannelSetSync.)
Thanks very much! I appreciate always your great help!
I still have some questions about callbacks and I hope I can be taught by you.
(Yes, I'm working with Skwire, I'm supporting fully his AHK Amp project :D)
___
Assimilated: BASS_ChannelGetTagsList - by Lexikos
[ profile ]
BASS_Free(){ global [color=red]DllCall("FreeLibrary", UInt, BASS_DLLCALL)[/color] Return DllCall(BASS_DLLPATH . BASS_DLL . "\BASS_Free"[color=red], UInt, true[/color]) }Bass.dll should not be freed until after you call BASS_Free. If the DLL is actually freed, any structures, handles, pointers, etc. that BASS_Free uses will be gone.
BASS_Free does not accept any arguments. This was very easy to spot with DllCallDebugger() in use.
I believe the following works correctly:
BASS_Free(){ global return DllCall(BASS_DLLPATH . BASS_DLL . "\BASS_Free") , DllCall("FreeLibrary", UInt, BASS_DLLCALL) }(Note the comma trick: FreeLibrary is called last, but the result of BASS_Free is returned.)
i'm currently fixing all malformed functions and going to update it asap
i plan to finish the library asap. currently adding encode, mixing, synth and external plugins functions.
[ profile ]