BASS.NET API for the Un4seen BASS Audio Library

Utils Class

BASS.NET API for the Un4seen BASS Audio Library
BASS.NET API helper and misc. class containing some general useful methods.
Inheritance Hierarchy

SystemObject
  Un4seen.BassUtils

Namespace:  Un4seen.Bass
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

public sealed class Utils

The Utils type exposes the following members.

Properties

  NameDescription
Public propertyStatic memberIs64Bit
Returns , if running in a 64-bit environment - else false (32-bit).
Top
Methods

  NameDescription
Public methodStatic memberAbsSignMax(Int16, Int16)
Returns the absolute signed maximum value of two values.
Public methodStatic memberAbsSignMax(Single, Single)
Returns the absolute signed maximum value of two values.
Public methodStatic memberCode exampleBASSAddOnGetPluginFileFilter(DictionaryInt32, String, String)
Returns a file filter which can be used in a standard 'OpenFileDialog'.
Public methodStatic memberCode exampleBASSAddOnGetPluginFileFilter(DictionaryInt32, String, String, Boolean)
Returns a file filter which can be used in a standard 'OpenFileDialog'.
Public methodStatic memberBASSAddOnGetSupportedFileExtensions(String)
Returns the supported stream file extensions of the given add-on file (e.g. "bassflac.dll").

Use to retrieve the native supported stream file extensions of Bass.

Use "music" to retrive the native supported music file extensions of Bass.

Public methodStatic memberCode exampleBASSAddOnGetSupportedFileExtensions(DictionaryInt32, String, Boolean)
Returns the supported stream file extensions for all loaded plugins.
Public methodStatic memberCode exampleBASSAddOnGetSupportedFileFilter(DictionaryInt32, String, String)
Returns a file filter which can be used in a standard 'OpenFileDialog'.
Public methodStatic memberCode exampleBASSAddOnGetSupportedFileFilter(DictionaryInt32, String, String, Boolean)
Returns a file filter which can be used in a standard 'OpenFileDialog'.
Public methodStatic memberBASSAddOnGetSupportedFileFilter(DictionaryInt32, String, String, Boolean, DictionaryString, String)
Returns a file filter which can be used in a standard 'OpenFileDialog'.
Public methodStatic memberBASSAddOnGetSupportedFileName
Returns the supported stream file name of the given add-on file (e.g. "bassflac.dll").

Use to retrieve the native supported stream file name of Bass.

Use "music" to retrive the native supported music name of Bass.

Public methodStatic memberBASSAddOnIsFileSupported
Checks if a certain file is supported by the currently loaded add-ons.
Public methodStatic memberBASSChannelTypeToString
Converts a BASSChannelType to a character representation describing the channel type or file type. Returns e.g. 'WMA', 'FLAC', 'MP3' etc.
Public methodStatic memberBASSTagTypeToString
Converts a BASSTag to a character representation describing the tag type. Returns e.g. 'ID3v1', 'ID3v2', 'WMA', 'APE' etc.
Public methodStatic memberBPM2Seconds
Calculates the length of one beat for a given BPM value.
Public methodStatic memberByteToHex
Converts a byte array to a hex string.
Public methodStatic memberChannelNumberToString
Converts a channel number to a string.
Public methodStatic memberDBToLevel(Double, Double)
Converts any dB level value to its level value (double).
Public methodStatic memberDBToLevel(Double, Int32)
Converts any dB level value to its level value (integer).
Public methodStatic memberDecodeAllData
Decodes all the available data of the given channel right away.
Public methodStatic memberDetectCuePoints(Int32, Single, Double, Double, Double, Double, Int32)
Detects the cue-in and -out points of a given decoding stream.
Public methodStatic memberDetectCuePoints(String, Single, Double, Double, Double, Double, Int32)
Detects the cue-in and -out points of a given audio file.
Public methodStatic memberDetectNextLevel
Finds the next position with a certain volume level.
Public methodStatic memberDMACopyMemory
DMA (kernel32.dll) - The CopyMemory function copies a block of memory from one location to another.
Public methodStatic memberDMAFillMemory
DMA (kernel32.dll) - The FillMemory macro fills a block of memory with a specified value.
Public methodStatic memberDMAMoveMemory
DMA (kernel32.dll) - The MoveMemory function moves a block of memory from one location to another.
Public methodStatic memberDMAZeroMemory
DMA (kernel32.dll) - The ZeroMemory macro fills a block of memory with zeros.
Public methodStatic memberFFTFrequency2Index
Returns the index of a specific frequency for FFT data.
Public methodStatic memberFFTIndex2Frequency
Returns the frequency of a specific index in FFT data.
Public methodStatic memberFixTimespan(Double)
Converts a second value as reveived by BASS_ChannelBytes2Seconds(Int32, Int64) to a string representation.
Public methodStatic memberFixTimespan(Double, String)
Converts a second value as reveived by BASS_ChannelBytes2Seconds(Int32, Int64) to a string representation.
Public methodStatic memberGetLevel(Byte, Int32, Int32, Int32)
Equivalent to BASS_ChannelGetLevel(Int32), but with individual offset and length.
Public methodStatic memberGetLevel(Int16, Int32, Int32, Int32)
Equivalent to BASS_ChannelGetLevel(Int32), but with individual offset and length.
Public methodStatic memberGetLevel(Single, Int32, Int32, Int32)
Equivalent to BASS_ChannelGetLevel(Int32), but with individual offset and length.
Public methodStatic memberGetLevel(IntPtr, Int32, Int32, Int32, Int32)
Equivalent to BASS_ChannelGetLevel(Int32), but with individual offset and length.
Public methodStatic memberGetLevel2(Byte, Int32, Int32, Int32)
Equivalent to BASS_ChannelGetLevel(Int32), but with individual offset and length.
Public methodStatic memberGetLevel2(Int16, Int32, Int32, Int32)
Equivalent to BASS_ChannelGetLevel(Int32), but with individual offset and length.
Public methodStatic memberGetLevel2(Single, Int32, Int32, Int32)
Equivalent to BASS_ChannelGetLevel(Int32), but with individual offset and length.
Public methodStatic memberGetLevel2(IntPtr, Int32, Int32, Int32, Int32)
Equivalent to BASS_ChannelGetLevel(Int32), but with individual offset and length.
Public methodStatic memberGetNormalizationGain
Determines a gain factor (normalization), so that the maximum peak level of the stream will be at 0 dB.
Public methodStatic memberGetVersion
Returns the version of the BASS.NET API (Bass.Net.dll)
Public methodStatic memberHexToByte
Converts a hex string to a byte array.
Public methodStatic memberHighWord(Int32)
Returns the higher 16-bit of an signed Int32 as a short value.
Public methodStatic memberHighWord(Int64)
Returns the higher 32-bit of an signed Int64 as an integer value.
Public methodStatic memberHighWord32
Returns the higher 16-bit of an signed Int32 as an integer value.
Public methodStatic memberIntAsObject
Translates an IntPtr into a .NET managed object of a given Type.

Sometime BASS returns a pointer which actually represents a memory block containing a structured object. This method does this translation for you and returns the actual object.

Public methodStatic memberIntPtrAsStringAnsi(IntPtr)
Translates an IntPtr into a .NET managed string.

Sometime BASS returns an IntPtr which actually represents a pointer to a memory block containing a null-terminated Ansi *char (string, 8-bit). This method does this translation for you and returns the actual string.

Public methodStatic memberIntPtrAsStringAnsi(IntPtr, Int32)
Translates an IntPtr into a .NET managed string.

Sometime BASS returns an IntPtr which actually represents a pointer to a memory block containing a null-terminated Ansi *char (string, 8-bit). This method does this translation for you and returns the actual string.

Public methodStatic memberIntPtrAsStringLatin1
Translates an IntPtr into a .NET managed string.

Sometime BASS returns an IntPtr which actually represents a pointer to a memory block containing a null-terminated Latin-1 (ISO-8859-1) *char (string, 8-bit). This method does this translation for you and returns the actual string.

Public methodStatic memberIntPtrAsStringUnicode(IntPtr)
Translates an IntPtr into a .NET managed string.

Sometime BASS returns an IntPtr which actually represents a pointer to a memory block containing a null-terminated Unicode *char (string, 16-bit). This method does this translation for you and returns the actual string.

Public methodStatic memberIntPtrAsStringUnicode(IntPtr, Int32)
Translates an IntPtr into a .NET managed string.

Sometime BASS returns an IntPtr which actually represents a pointer to a memory block containing a null-terminated Unicode *char (string, 16-bit). This method does this translation for you and returns the actual string.

Public methodStatic memberIntPtrAsStringUtf8(IntPtr)
Translates an IntPtr into a .NET managed string.

Sometime BASS returns an IntPtr which actually represents a pointer to a memory block containing a null-terminated UTF-8 *char (string, 8-bit). This method does this translation for you and returns the actual string.

Public methodStatic memberIntPtrAsStringUtf8(IntPtr, Int32)
Translates an IntPtr into a .NET managed string.

Sometime BASS returns an IntPtr which actually represents a pointer to a memory block containing a null-terminated UTF-8 *char (string, 8-bit). This method does this translation for you and returns the actual string.

Public methodStatic memberIntPtrAsStringUtf8orLatin1
Translates an IntPtr into a .NET managed string.

Sometime BASS returns an IntPtr which actually represents a pointer to a memory block containing either a null-terminated UTF-8 or Latin-1 *char (string, 8-bit). This method does this translation for you and returns the actual string.

Public methodStatic memberIntPtrToArrayNullTermAnsi
Retrieves an array of strings from a given unmanaged memory location.

NOTE: This method evaluates the pointer as 'a series/array of null-terminated Ansi strings.

Public methodStatic memberIntPtrToArrayNullTermInt16
Retrieves an array of int from a given unmanaged memory location.

NOTE: This method evaluates the pointer as 'a series/array of Int16 values terminated by a 0 value.

Public methodStatic memberIntPtrToArrayNullTermInt32
Retrieves an array of int from a given unmanaged memory location.

NOTE: This method evaluates the pointer as 'a series/array of Int32 values terminated by a 0 value.

Public methodStatic memberIntPtrToArrayNullTermUnicode
Retrieves an array of strings from a given unmanaged memory location.

NOTE: This method evaluates the pointer as 'a series/array of null-terminated UNICODE strings.

Public methodStatic memberIntPtrToArrayNullTermUtf8
Retrieves an array of strings from a given unmanaged memory location.

NOTE: This method evaluates the pointer as 'a series/array of null-terminated UTF-8 strings.

Public methodStatic memberLevelToDB(Double, Double)
Converts any level value to its dB value.
Public methodStatic memberLevelToDB(Int32, Int32)
Converts any integer level value to its dB value.
Public methodStatic memberLIBFreeLibrary
This function decrements the reference count of the loaded dynamic-link library (DLL) loaded via LIBLoadLibrary(String). When the reference count reaches zero, the module is unmapped from the address space of the calling process and the handle is no longer valid.
Public methodStatic memberLIBLoadLibrary
LIB (kernel32.dll) - Loads a native unmanaged library (dll) into the process of our executable.
Public methodStatic memberLowWord(Int32)
Returns the lower 16-bit of an signed Int32 as a short value.
Public methodStatic memberLowWord(Int64)
Returns the lower 32-bit of an signed Int64 as an integer value
Public methodStatic memberLowWord32
Returns the lower 16-bit of an signed Int32 as an integer value.
Public methodStatic memberMakeByte
Returns an unsigned byte value which is composed out of a low and high 4-bit.
Public methodStatic memberMakeLong(Int16, Int16)
Returns an signed Int32 value which is composed out of a low and high value.
Public methodStatic memberMakeLong(Int32, Int32)
Returns an signed Int32 value which is composed out of a low and high value.
Public methodStatic memberMakeLong64(Int32, Int32)
Returns an signed Int64 value which is composed out of a low and high value.
Public methodStatic memberMakeLong64(Int64, Int64)
Returns an signed Int64 value which is composed out of a low and high value.
Public methodStatic memberMakeWord
Returns an signed Int16 value which is composed out of a low and high byte.
Public methodStatic memberSampleDither
Applies a dither to a single sample value.
Public methodStatic memberSampleTo16Bit(Byte)
Converts an 8-bit unsigned sample to a 16-bit signed sample.
Public methodStatic memberSampleTo16Bit(Byte)
Converts a byte array (in "Little Endian" notation) to a 16-bit signed sample.
Public methodStatic memberSampleTo16Bit(Int16)
Converts a 16-bit signed sample to a 16-bit signed sample.
Public methodStatic memberSampleTo16Bit(Single)
Converts a float 32-bit signed sample to a 16-bit signed sample.
Public methodStatic memberSampleTo24Bit(Byte)
Converts an 8-bit unsigned sample to a 24-bit signed sample.
Public methodStatic memberSampleTo24Bit(Byte)
Converts a byte array (in "Little Endian" notation) to a 24-bit signed sample.
Public methodStatic memberSampleTo24Bit(Int16)
Converts a 16-bit signed sample to a 24-bit signed sample.
Public methodStatic memberSampleTo24Bit(Single)
Converts a float 32-bit signed sample to a 24-bit signed sample.
Public methodStatic memberSampleTo32Bit(Byte)
Converts an 8-bit unsigned sample to a float 32-bit signed sample.
Public methodStatic memberSampleTo32Bit(Byte)
Converts a byte array (in "Little Endian" notation) to a float 32-bit signed sample.
Public methodStatic memberSampleTo32Bit(Int16)
Converts a 16-bit signed sample to a float 32-bit signed sample.
Public methodStatic memberSampleTo8Bit(Byte)
Converts an 8-bit unsigned sample to an unsigned 8-bit sample.
Public methodStatic memberSampleTo8Bit(Byte)
Converts a byte array (in "Little Endian" notation) to an 8-bit unsigned sample.
Public methodStatic memberSampleTo8Bit(Int16)
Converts a 16-bit signed sample to an 8-bit unsigned sample.
Public methodStatic memberSampleTo8Bit(Single)
Converts a float 32-bit signed sample to an 8-bit unsigned sample.
Public methodStatic memberSeconds2BPM
Calculates the BPM value which represented the given length for one beat.
Public methodStatic memberSemitone2Samplerate
Calculates a new samplerate according to a shift of an original samplerate by a number of semitones.
Public methodStatic memberStringToNullTermAnsi(String, IntPtr)
Copies the contents of a managed string into unmanaged memory, converting into ANSI format as it copies and appends a null-terminator.
Public methodStatic memberStringToNullTermAnsi(String, IntPtr, Boolean)
Copies the contents of a managed string array into unmanaged memory, converting each element into ANSI format as it copies and appends a null-terminator.
Public methodStatic memberStringToNullTermUnicode(String, IntPtr)
Copies the contents of a managed string into unmanaged memory and appends a null-terminator.
Public methodStatic memberStringToNullTermUnicode(String, IntPtr, Boolean)
Copies the contents of a managed string array into unmanaged memory and appends a null-terminator.
Public methodStatic memberStringToNullTermUtf8(String, IntPtr)
Copies the contents of a managed string into unmanaged memory, converting into UFT-8 format as it copies and appends a null-terminator.
Public methodStatic memberStringToNullTermUtf8(String, IntPtr, Boolean)
Copies the contents of a managed string array into unmanaged memory, converting each element into UTF-8 format as it copies and appends a null-terminator.
Top
Remarks

Contains basically some generic converter utilities.
See Also

Reference