^ What's the point?
^ Requirements
^ Installation
^ Usage
^ HResult error codes
^ BASS COM Management
^ Licenses
^ Useful information

Download :: Top
COM BASS Mixer Library

COM BASS Mixer Library is an audio file mixer COM class wrapper around BASS, BASSMix and BASSEnc, for use in Win32 and Win64 (Windows XP/Vista/7/8/10) software.

Features:
  • Mix various audio file formats together BASS supports like MP3, Opus, FLAC, Ogg Vorbis and WAV format
  • Multiple input files are supported per processing (virtually unlimited)
  • Every input file has it's own matrix mixing setting
  • Specify output file channel count, resolution and bit depth
  • COM class is usable by developer environments/platforms supporting COM classes like VBScript or Delphi
  • Delphi header file and VBScript tutorial included



Requirements

Developer environment/platform supporting COM classes.


Installation

Run an elevated command prompt, change dir into the folder where 'COMBASSMixer.dll' is located, run the following: "regsvr32 COMBASSMixer.dll". This should register the COM class. Do this for the desired Win32 and/or Win64 version.
bass.dll, bassmix.dll and bassenc.dll is needed on the search path, eg. beside your .exe (or VBScript file), 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.


Usage

After registering the DLL it can be accessed like:
    createobject("COMBASSFX.BASSFX")
VBScript usage example, mix 2 files, second at 2 seconds:
	option explicit
	dim myobject
	set myobject = createobject("COMBASSMixer.BASSMixer")
	myobject.AddAudioFile "Alarm01.wav", 0, "1 0 0 1"
	myobject.AddAudioFile "Test1.wav", 2.0, "1 0 0 1"
	myobject.GenerateAudioFile "Mix.wav", 2, 44100, ""
	set myobject=nothing
The SaveFile() function's last parameters:
  • -32bitfloat
  • -32bitinteger
  • -24bitinteger
  • -16bitinteger
  • -8bitinteger
  • -noRF64
  • -noWFEXT
These specify the generated WAV file's properties.


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.

BASS COM Management

BASSCOMManagement.dll first must be registered before using it, please see 'Installation' section.

BASS COM Management class should be used when running the COM classes in a multi-threded environment and using COM BASS Mixer Library together with for example BASS Encoder Library.
The individual components don't know of each other's state and they are both using BASS. To overcome this issue 'BASSCOMManagement.BASSManagement' COM class should be used when starting the process to initialize BASS for all the COM classes.
There are only 2 functions: 'BASSInitialize' and 'BASSFree'. 'BASSInitialize' expects only one parameter, the audio device number, it should be '0', the COM classes need to have BASS initialized for 0, the "no sound device".
When starting the process use:
	option explicit
	dim myobject
	set myobject = createobject("BASSCOMManagement.BASSManagement")
	myobject.BASSInitialize 0
	set myobject=nothing
And just before the process exits call:
	option explicit
	dim myobject
	set myobject = createobject("BASSCOMManagement.BASSManagement")
	myobject.BASSFree
	set myobject=nothing
	
The state is stored globally per process, and is valid until unloading the 'BASSCOMManagement.dll' from the process. Also the initialization and free calls are reference counted.

A simpler solution is to never free BASS - BASS will free itself when the BASS.dll is unloaded anyway. Use 'FreeBASS(1)' to set it to free it when freeing the COM BASS Mixer Library class. The default state is '0'.

When not using a scripting language it's only needed to call BASS_Init() manually (with device '0') on your program startup, and BASS_Free() on program exit, directly with BASS.dll.


COM BASS Mixer Library in freeware, shareware and commercial software?

The component can be freely evaluated. If you like it and use it in a freeware, shareware or commercial (or any other money making - advertising, in app. selling, etc.) product one of the licenses is needed.


Useful information


[Top]