Sample Display Library
Sample Display Library is a COM/DLL sample display creator for use with BASS, for use in Win32 and Win64 (Windows XP/Vista/7/8/10) software.
- Create sample display from various audio file formats BASS supports like MP3, Opus, FLAC, Ogg Vorbis and WAV format
- COM class usable by developer environments/platforms supporting COM classes like VBScript
- Full transparency support
- Supports using the SampleDisplay.dll itself natively without COM, Delphi example included
- As no external .exe is started the library is usable for Windows Store apps
Developer environment/platform supporting COM classes or DLLs.
Run an elevated command prompt, change dir into the folder where 'SampleDisplay.dll' is located, run the following: "regsvr32 SampleDisplay.dll". This should register the COM class. Do this for the desired Win32 and/or Win64 version.
bass.dll is needed on the search path, eg. beside your .exe, or copy the needed DLLs to \Windows\System32\ (Win64 DLLs on a 64 bit OS) and/or \Windows\SysWOW64\ (Win32 DLLs on a 64 bit OS) folder. If the OS is 32 bit then copy the needed DLLs to \Windows\System32\ (from the Win32 folder).
To use the library in VBScript, on a 64 bit OS, the VBScript process is 64 bit so the needed DLLs have to be from the Win64 folder, beside the .VBS file or in the System32 folder as written above.
After registering the DLL it can be accessed like:
VBScript usage example, 800 x 480 picture, dark color theme, 4x antialiasing, 32 bit PNG:
set myobject = createobject("SampleDisplay.CreateDisplay")
myobject.LoadBASSFormatPlugin "bass_ape.dll" 'optional, load needed BASS plugins here before calling 'CreatePicture()'
myobject.CreatePicture "G:\MP3z\Test.mp3", "E:\Test.png", 800, 480, &HFFFFFF00, &HFF00FF00, &HFF000000, &HFF888888, "My caption here for info", 4, 0, nothing
set myobject = nothing
Please see the Delphi tutorials on how to use the library with Delphi (and directly access the SampleDisplay.dll without COM).
- function CreatePicture (SourceFileName, OutputFileName: PChar; Width, Height: Integer; TopColor, BottomColor, BackgroundColor, CaptionColor: Cardinal; Caption: PChar; AALevel: Integer; Quantize: Integer; Progress: IProgress): HResult; stdcall;
- 'SourceFileName' is the audio file from which the sample display picture is created.
- 'OutputFileName' is the file name of the generated PNG image.
- All colors are in (hex) AARRGGBB format.
- 'Caption' is an optional text that will be drawn in the bottom-left corner.
- 'AALevel' is antialiasing level, reasonable values 1-4 (1 means no antialiasing).
- Setting 'Quantize' to non-zero value will create 256 color PNG files.
- 'Progress' is an interface callback for progress reporting. Set to nil if you don't wish to use a progress callback.
Using SampleDisplay.dll natively: There are 2 exported function:
- function CreatePictureHandle (const SourceFileName: WideString; Width, Height: Integer; TopColor, BottomColor, BackgroundColor, CaptionColor: OleVariant; const Caption: WideString; AALevel: Integer; out BitmapHandle: OleVariant; const Progress: IProgress): HResult; stdcall;
- The parameters are same as above but this function return a HBITMAP handle in 'BitmapHandle'.
- function SampleDisplay_CreatePicture(SourceFileName, OutputFileName: PChar; Width, Height: Integer; TopColor, BottomColor, BackgroundColor, CaptionColor: Cardinal; Caption: PChar; AALevel: Integer; Quantize: Integer; Progress: IProgress): HResult; stdcall;
- function SampleDisplay_CreatePictureHandle(SourceFileName: PChar; Width, Height: Integer; TopColor, BottomColor, BackgroundColor, CaptionColor: Cardinal; Caption: PChar; AALevel: Integer; var BitmapHandle: THandle; Progress: IProgress): HResult; stdcall;
HResult error codes
- S_OK: Success.
- S_FALSE: Unknown error occured or catastrophic failure.
- 3: bass.dll could not be loaded.
- 9: Input file could not be opened.
- 10: Output file could not be created.
- E_INVALIDARG: Parameters specified are invalid.
LAME Encoder Library in shareware and commercial software?
The component is free for use in free software. If you like it and use it in a shareware or commercial (or any other money making - advertising, in app. selling, etc.) product you need one of the licenses.