BASS.NET API for the Un4seen BASS Audio LibraryUpgrading from Previous VersionsBASS.NET API for the Un4seen BASS Audio Library

Content:

As with every release, all classes, methods, members, delegates, enumerations etc. affected by a change are listed in the Version History section. Make sure to study these changes as well. To make upgrading existing code simple, some brief guidelines are listed below:

From Version 2.4.8.0 to 2.4.8.1

As the folder structure for the Bass.Net assemblies has been changed with this release, make sure to correct this within your project settings to ensure that you are referencing the correct target platform!

Note, that there are four Bass.Net assemblies available (side-by-side): one targeting the .Net v2.0 Framework and one targeting the .Net v4.0 Framework, plus a special CE and iPhone/iPad version. These versions are installed underneath the selected 'install-directory' within the following sub-folders:

Sub-Folder

.Net Target Version

.\v2.0

Bass.Net for .Net 2.0 (Bass.Net.dll)

Targeting x86 and x64, Windows, Linux or Apple OSX development.

.\v4.0

Bass.Net for .Net 4.0 (Bass.Net.dll)

Targeting x86 and x64, Windows, Linux or Apple OSX development.

.\compact

Bass.Net CE for .Net CompactFramework 3.5 (Bass.Net.compact.dll)

Targeting Windows CE development.

.\iphone

Bass.Net iPhone for .Net CompactFramework 3.5 (Bass.Net.iphone.dll)

Targeting Apple iPhone/iPad development (static, __Internal linking).

The previous Bass.Net version just contained the Bass.Net for .Net 2.0 assembly version and was installed directly to the root of the selected 'install-directory'. As such, please delete any Bass.Net.dll and Bass.Net.xml file from within the root 'install-directory'.

After that correct the reference link (References) in your project settings and make sure you are now using one of the new Bass.Net assembly versions from the above mentioned sub-folders.

From Version 2.3 to 2.4

  • BASS_GetDeviceDescription, BASS_RecordGetDeviceDescription

    These functions have been superseded by the new BASS_GetDeviceInfo and BASS_RecordGetDeviceInfo functions, respectively.

  • BASS_INFO, BASS_RECORDINFO

    The "driver" member has been moved to the new BASS_DEVICEINFO structure.

  • BASS_ChannelGetAttributes, BASS_ChannelSetAttributes, BASS_ChannelSlideAttributes

    These functions have been replaced by BASS_ChannelGetAttribute, BASS_ChannelSetAttribute and BASS_ChannelSlideAttribute, respectively.

  • BASS_MusicGetAttribute, BASS_MusicSetAttribute

    These functions have been incorporated into BASS_ChannelGetAttribute and BASS_ChannelSetAttribute. The attribute names have also changed slightly - the "MUSIC" and "ATTRIB" parts are swapped around.

  • BASSMusic, BASSStream, BASSSample, BASSRecord and BASSFXFlag

    These enummerations have been replaced by the new BASSFlag enummeration.

  • BASSErrorCode

    This enummerations has been renamed to BASSError.

  • BASS_ChannelGetLength, BASS_ChannelGetPosition, BASS_ChannelSetPosition

    A "mode" parameter has been added to these 3 functions. Set that to BASS_POS_BYTE to maintain previous functionality.

  • BASS_MusicGetOrders, BASS_MusicGetOrderPosition, MAKEMUSICPOS

    These functions have been incorporated into BASS_ChannelGetLength, BASS_ChannelGetPosition and BASS_ChannelSetPosition, via the BASS_POS_MUSIC_ORDER "mode".

  • BASS_MusicLoad

    The "offset" parameter is now 64-bit (long).

  • BASS_SampleLoad

    The "offset" parameter is now 64-bit (long).

  • BASS_SampleCreate

    This function now returns a sample handle. The sample's data can be set using the new BASS_SampleSetData function.

  • BASS_SampleCreateDone

    This function is no longer required following the change to BASS_SampleCreate.

  • BASS_StreamCreateFile

    The "offset" and "length" parameters are now 64-bit (long).

  • BASS_StreamGetFilePosition

    The return value is now 64-bit (long).

  • BASS_StreamCreateFileUser

    This function now uses a BASS_FILEPROCS class instead of a STREAMFILEPROC callback. This new BASS_FILEPROCS class lets you defines four different callbacks: FILECLOSEPROC, FILELENPROC, FILEREADPROC, FILESEEKPROC.

  • BASS_GetVolume, BASS_SetVolume

    The volume is now a floating-point value, with a range of 0 to 1.

  • BASS_CONFIG_MAXVOL

    This config option has been removed, as it is no longer needed following the advent of floating-point volume settings.

  • BASSConfig

    The global volume settings now have a range of 0 to 10000.

  • BASS_RecordGetInput, BASS_RecordSetInput

    The volume has been separated from the flags and made a floating-point value, with a range of 0 to 1.

  • BASS_Update

    A "length" parameter has been added.

  • BASS_ChannelPreBuf

    This function has been superseded by BASS_ChannelUpdate No parameter changes are required.

  • BASS_ChannelSetFlags

    This function has been superseded by BASS_ChannelFlags. For the same functionality, set the "mask" parameter to -1.

  • BASS_ChannelSetSync

    BASS_SYNC_META sync callbacks no longer receive the metadata via the "data" parameter. It can now be retrieved via BASS_ChannelGetTags (BASS_TAG_META) instead.

    The BASS_SYNC_META sync is also no longer triggered by a new logical bitstream in a chained OGG stream. A dedicated BASS_SYNC_OGG_CHANGE sync has been added for that purpose.

  • BASS_ChannelBytes2Seconds

    The return value is now 64-bit floating-point (double).

    This also effected: TAG_INFO, FixTimespan, DetectCuePoints.

  • BASS_ChannelSeconds2Bytes

    The "pos" parameter is now 64-bit floating-point (double).

    This also effected: BASS_ChannelSetPosition, EncodeFile.

  • BASSConfig

    Config options that deal with pointers, like these 2, are now handled by the new BASS_SetConfigPtr and BASS_GetConfigPtr functions.

  • BASS_CHANNELINFO

    "sample" and "file" members have been added.

  • All BASS_FX* effect structure classes have been renamed to BASS_DX8_*

    E.g. the effect structure "BASS_FXCHORUS" has been renamed to BASS_DX8_CHORUS. The BASSFXType enummeration members have been renamed accordingly.

  • DSPPROC, DOWNLOADPROC, RECORDPROC, STREAMPROC, SYNCPROC, BASS_FILEPROCS

    All callback function "user" parameters are now pointers (IntPtr) - this also applies to all methods taking such delegate as a parameter. If you still want to pass an Int32 value to the callbacks do the following:

    C#: Passing an Int32 user Parameter to a Callback
    private DSPPROC _myDSPProc;
    ...
    int myValue = 123;
    _myDSPProc = new DSPPROC(MyDSP);
    Bass.BASS_ChannelSetDSP(_stream, _myDSPProc, new IntPtr(myValue), 0);
    ...
    private void MyDSP(int handle, int channel, IntPtr buffer, int length, IntPtr user)
    {
      int userValue = user.ToInt32();
      // userValue now contains 123 again
      ...
    }
    VB.Net: Passing an Int32 user Parameter to a Callback
    Private _myDSPProc As DSPPROC
    ...
    Dim myValue As Integer =  123 
    _myDSPProc = New DSPPROC(AddressOf MyDSP)
    Bass.BASS_ChannelSetDSP(_stream, _myDSPProc, New IntPtr(myValue), 0)
    ...
    Private Sub MyDSP(ByVal handle As Integer, ByVal channel As Integer, ByVal buffer As IntPtr, 
                      ByVal length As Integer, ByVal user As IntPtr)
      Dim userValue As Integer =  user.ToInt32() 
      ' userValue now contains 123 again
      ...
    End Sub
  • BASS.NET: Support for .Net Framework version 1.1 ended

    Current and future version of BASS.NET do now support .Net Framework 2.0, 3.0 and 3.5.

  • BASS.NET: Various method overloads removed

    For simplicity and consistency various method overloads have been removed. This effects all those methods taking or returning an enummeration value as a parameter.

  • BASS.NET:BASS_ChannelGetData signature changed

    For simplicity the method overloads now accept a normal array reference - so remove your existing reference to the first array element, if you used that so far. Note to VB.Net users: If you have previously used the first array element to reference the array - DON'T SO ANYMORE, reference the full array now!!!

  • BASS.NET:BASS_Init signature changed

    For simplicity and consistency some method overloads have been removed.

  • BASS.NET:BASS_SampleGetChannels signature changed

    The method now expects a plain int array as a parameter for more ease of use. Note to VB.Net users: If you have previously used the first array element to reference the array - DON'T SO ANYMORE, reference the full array now!!!

  • BASS.NET:BASS_SampleGetChannels signature changed

    The method now expects a plain int array as a parameter for more ease of use. Note to VB.Net users: If you have previously used the first array element to reference the array - DON'T SO ANYMORE, reference the full array now!!!

  • BASS.NET:BASS_Mixer_ChannelGetMatrix/BASS_Mixer_ChannelSetMatrix signature changed

    Both methods now expect a plain float array as a parameter for more ease of use. Note to VB.Net users: If you have previously used the first array element to reference the array - DON'T SO ANYMORE, reference the full array now!!!

  • BASS.NET:Start signature changed

    The "Start" method signature of all Encoder Framework implementations was changed to allow any encoder to start paused.

  • BASS.NET:EncoderWMA behaviour changed

    The EncoderWMA now always uses a DSP callback to automatically write sample data to the encoder. The Write method was therefore removed. The new WMA_Notify property might be used to get notified if an error occurred when writing sample data to the encoder.

  • BASS.NET:WMAcast behaviour changed

    The WMAcast streaming server implementation now always sets the UseBASS property to TRUE. In addition the SendData method should not be used anymore and will always return the given length.

  • BASS.NET:BassAsioHandler reworked

    InputFX renamed to InputChannel, BassChannel renamed to OutputChannel

    The 'Default*' ASIOPROCs have been renamed and made virtual to support overloads

    AdditionalAsioProc property has been removed

    general performance and stability enhancements

  • BASS.NET:DSP_StreamCopy reworked

    StreamFlags renamed to StreamCopyFlags, StreamDevice renamed to StreamCopyDevice.

  • BASSenc:BASS_Encode_GetACMFormat

    The method signature was changed for more ease of use.

  • BASSCD: BASS_CD_GetDriveDescription and BASS_CD_GetDriveLetter removed

    Use BASS_CD_GetInfo to retrieve the drive letter and description.

  • BASS_FX: BASS_FX_CONFIG_DSP_RESET

    The config option has been removed as all FX functions are now integrated with BASS and the usage is the same as with BASS DX8/DMO effects.

  • BASS_FX: BASS_FX_DSP_xxx

    BASS_FX now uses the BASSFX plugin system (see BASS_ChannelSetFX, BASS_FXGetParameters, BASS_FXSetParameters, BASS_ChannelRemoveFX, BASS_FXReset). The effect names, structure names, flags are changed e.g: BASS_FX_DSPFX_PHASER to BASS_FX_BFX_PHASER, BASS_BFX_PHASER to BASS_BFX_PHASER (Exception BASS_FX_DSPFX_SWAP renamed to BASS_BFX_MIX; BASS_FX_DSPFX_S2M removed). The BASS_BFX_MIX effect also has a new behavior!

  • BASS_FX:BASS_BFX_PEAKEQ

    lFreq param changed from "int" to "float" and named fFreq.

  • BASS_FX:BASS_BFX_LPF

    lFreq param changed from "int" to "float" and named fFreq.

  • BASS_FX: BASS_FX_TempoSet, BASS_FX_TempoGet, BASS_FX_TempoSetOption, BASS_FX_TempoGetOption

    These methods have been removed. The funtions are now integrated with the BASS attribute system (see BASS_ChannelGetAttribute/BASS_ChannelSetAttribute).

  • BASS_FX: BASS_FX_ReverseSetDirection, BASS_FX_ReverseGetDirection

    These methods have been removed. The funtions are now integrated with the BASS attribute system (see BASS_ChannelGetAttribute/BASS_ChannelSetAttribute).

  • BASS_FX:BASS_FX_BPM_DecodeGet, BASS_FX_BPM_CallbackSet, BASS_FX_BPM_BeatDecodeGet, BPMBEATPROC

    Seconds parameters changed from "float" to "double".

  • BASS_FX:BASSFXBpm, BASSFXBpmTrans

    Flags splitted into the above two enumerations.

  • BASS_FX:BASSFXBpm, BASSFXBpmTrans

    Flags splitted into the above two enumerations.

  • BASS_FX:BASSFXChan

    The enumeration member names have been renamed to BASS_BFX_xxx.

  • BASS_FX:BPMPROC, BPMBEATPROC, BPMBEATPROC

    All callback function "user" parameters are now pointers (IntPtr) - this also applies to all methods taking such delegate as a parameter.

  • BASSmidi: BASS_MIDI_StreamGetMarks has been removed

    Use BASS_MIDI_StreamGetMark instead.

  • BASSmidi: Marker index passed to marker sync callbacks

    Instead of passing the marker pointer to the callback now the index is passed, which is to be used with BASS_MIDI_StreamGetMark.

  • BASS_Mixer_ChannelGetPosition, BASS_Mixer_ChannelSetPosition

    A "mode" parameter has been added to these 2 functions. Set that to BASS_POS_BYTE to maintain previous functionality.

So as with every release a good idea to convert your existing project to this version is to install the new version and recompile your project. This will give you already almost all errors which needs to be changed accordingly.

See Also

Other Resources