BlitzMax/Modules/BaH/BASS

BASS is an audio library for use in Windows and Mac OSX software. Its purpose is to provide developers with powerful and efficient sample, stream (MP3, MP2, MP1, OGG, WAV, AIFF, custom generated, and more via add-ons), MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), and recording functions.

This BlitzMax module, as well as the standard streaming functionality also supports the use of TStream, allowing even more flexibility than BASS already provides.

You can find the runtime libraries in the lib/^platform^ folder of the module distribution, where ^platform^ is either win32 or macos.

On Windows, you should place the bass.dll file in the same folder as your app.

On OS X, the libbass.dylib should be placed inside the application bundle. For example, if your application was called MyApp, then the library would need to be placed in MyApp.app/Contents/MacOS/.

=Types=

TBassInfo
Used with TBass.GetInfo to retrieve information on the current device.

OSX notes: Only the latency, minbuf, initflags, speakers and freq members are used. Hardware mixing and EAX are unavailable in OS X. The speakers and freq values will change as the device's output is changed, e.g. via its control panel.


 * GetFlags
 * GetHWSize
 * GetHWFree
 * GetFreeSam
 * GetFree3d
 * GetMinRate
 * GetMaxRate
 * GetEAX
 * GetMinBuf
 * GetDSVer
 * GetLatency
 * GetInitFlags
 * GetSpeakers
 * GetFreq

TBassInfo: Methods
Method GetFlags:Int

Description: flagsThe device's capabilities... a combination of these flags.

Method GetHWSize:Int

Description: The device's total amount of hardware memory.

Method GetHWFree:Int

Description: The device's amount of free hardware memory.

Method GetFreeSam:Int

Description: The number of free sample slots in the hardware.

Method GetFree3d:Int

Description: The number of free 3D sample slots in the hardware.

Method GetMinRate:Int

Description: The minimum sample rate supported by the hardware.

Method GetMaxRate:Int

Description: The maximum sample rate supported by the hardware.

Method GetEAX:Int

Description: The device supports EAX and has it enabled?

Information: The device's "Hardware acceleration" needs to be set to "Full" in its "Advanced Properties" setup, else EAX is disabled. This is always FALSE if BASS_DEVICE_3D was not specified when TBass.Init was called.

Method GetMinBuf:Int

Description: The minimum buffer length (rounded up to the nearest millisecond) recommended for use (with the BASS_CONFIG_BUFFER config option).

Information: Requires that BASS_DEVICE_LATENCY was used when TBass.Init was called

Method GetDSVer:Int

Description: DirectSound version...

Information: 9 = DX9/8/7/5 features are available, 8 = DX8/7/5 features are available, 7 = DX7/5 features are available, 5 = DX5 features are available. 0 = none of the DX9/8/7/5 features are available.

Method GetLatency:Int

Description: The average delay (rounded up to the nearest millisecond) for playback of TBassStream/TBassMusic channels to start and be heard.

Information: Requires that BASS_DEVICE_LATENCY was used when TBass.Init was called.

Method GetInitFlags:Int

Description: The flags parameter of the TBass.Init call.

Method GetSpeakers:Int

Description: The number of speakers the device/drivers supports...

Information: 2 means that there is no support for speaker assignment (this will always be the case with VxD drivers). It's also possible that it could mistakenly be 2 with some devices/drivers, when the device in fact supports more speakers. In that case the BASS_DEVICE_CPSPEAKERS flag can be used in the TBass.Init call to use the Windows control panel setting, or the BASS_DEVICE_SPEAKERS flag can be used to force the enabling of speaker assignment.

Method GetFreq:Int

Description: The device's current output sample rate.

Information: This is only available on Windows Vista and OS X.

TBassChannel
A "channel" can be a sample playback channel (TBassSample), a sample stream (TBassStream), a MOD music (TBassMusic), or a recording (TBassRecord). Each "Channel" function can be used with one or more of these channel types.


 * Play
 * Pause
 * Stop
 * GetLength
 * GetLevel
 * GetTags
 * IsActive
 * GetPosition
 * GetPositionLowHigh
 * Update
 * SlideAttribute
 * IsSliding
 * Bytes2Seconds
 * Flags
 * SetFX
 * GetAttribute
 * SetAttribute
 * SetLink
 * Get3DPosition
 * Set3DPosition
 * Set3DAttributes
 * Get3DAttributes
 * GetData
 * GetDevice
 * GetInfo
 * Lock
 * Seconds2Bytes
 * SetSync
 * SetPosition

TBassChannel: Methods
Method Play:Int(restart:Int = True)

Description: Starts (or resumes) playback of a sample, stream, MOD music, or recording.

Returns: If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Information: Parameters:
 * restart : Restart playback from the beginning? If channel is a user stream, its current buffer contents are cleared.
 * If it is a MOD music, its BPM/etc are reset to their initial values.

When streaming in blocks (BASS_STREAM_BLOCK), the restart parameter is ignored as it's not possible to go back to the start. The restart parameter is also of no consequence with recording channels.

Method Pause:Int

Description: Pauses a sample, stream, MOD music, or recording.

Returns: If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Information: Use Play to resume a paused channel. Stop can be used to stop a paused channel.

Method Stop:Int

Description: Stops a sample, stream, MOD music, or recording.

Method GetLength:Long(mode:Int)

Description: Retrieves the playback length of a channel.

Returns: If successful, then the channel's length is returned, else -1 is returned. Use TBass.ErrorGetCode to get the error code.

Information: The exact length of a stream will be returned once the whole file has been streamed, until then it's not always possible to 100% accurately estimate the length of a stream. The length is always exact for MP3/MP2/MP1 files when the BASS_STREAM_PRESCAN flag is used in the BASS_StreamCreateFile call. When the BASS_STREAM_PRESCAN flag is not used, the length is an (usually accurate) estimation based on the file size, until the whole file has been streamed. The length returned for OGG files will usually be exact (assuming the file is not corrupt), but for OGG files streamed from the internet (or "buffered" user file stream) it can be a very rough estimation until the whole file has been downloaded. Retrieving the byte length of a MOD music requires that the BASS_MUSIC_PRESCAN flag was used in the BASS_MusicLoad call. Parameters:
 * mode : How to retrieve the length. One of the following.

Method GetLevel:Int(leftLevel:Int Var, rightLevel:Int Var)

Description: Retrieves the level (peak amplitude) of a stream, MOD music or recording channel.

Information: This method measures the level of the channel's sample data, not the level of the channel in the final output mix, so the channel's volume (BASS_ATTRIB_VOL attribute) does not affect it. For channels that are more than stereo, the left level will include all left channels (e.g. front-left, rear-left, center), and the right will include all right (front-right, rear-right, LFE). If there are an odd number of channels then the left and right levels will include all channels. If the level of each individual channel is required, that can be calculated from the sample data that GetData provides. When used with a decoding channel, this method has to decode data (20ms worth) from the channel in order to calculate the level. Which means that data is gone, e.g. it is not available to GetData. If an error occurs, -1 is returned, use TBass.ErrorGetCode to get the error code. If successful, the level of the left channel is returned in the low word (low 16-bits), and the level of the right channel is returned in the high word (high 16-bits). If the channel is mono, then the low word is duplicated in the high word. The level ranges linearly from 0 (silent) to 32768 (max). 0 will be returned when a channel is stalled.

Method GetTags:String[](tags:Int)

Description: Retrieves tags/headers from a channel.

Returns: If successful, the requested tags are returned, else NULL is returned. Use TBass.ErrorGetCode to get the error code.

Information: Parameters:
 * tags : The tags/headers wanted... one of the following.

ID3v1 tags are located at the end of the file, so when streaming a file with ID3v1 tags from the internet, the tags will not be available until the download is complete. A BASS_SYNC_DOWNLOAD sync can be set via BASS_ChannelSetSync, to be informed of when the download is complete. A BASS_SYNC_META sync can be used to be informed of new Shoutcast metadata, and a BASS_SYNC_OGG_CHANGE sync for when a new logical bitstream begins in a chained OGG stream, which generally brings new OGG tags.

Method IsActive:Int

Description: Checks if a sample, stream, or MOD music is active (playing) or stalled.

Information: Can also check if a recording is in progress. When using this method with a decoding channel, BASS_ACTIVE_PLAYING will be returned while there is still data to decode. Once the end has been reached, BASS_ACTIVE_STOPPED will be returned. BASS_ACTIVE_STALLED is never returned for decoding channels; you can tell a decoding channel is stalled if BASS_ChannelGetData returns less data than requested, and this function still returns BASS_ACTIVE_PLAYING.

Method GetPosition:Long(mode:Int)

Description: Retrieves the playback position of a sample, stream, or MOD music.

Returns: If successful, then the channel's position is returned, else -1 is returned. Use TBass.ErrorGetCode to get the error code.

Information: Can also be used with a recording channel. Parameters:
 * mode : How to retrieve the position. One of the following.


 * Other modes may be supported by add-ons, see the documentation.

Method GetPositionLowHigh:Long(mode:Int, low:Int Var, high:Int Var)

Method Update:Int(length:Int)

Description: Updates the playback buffer of a stream or MOD music.

Returns: If successful, TRUE is returned, else FALSE is returned. Use ErrorGetCode to get the error code.

Information: Parameters:
 * length : The amount to render, in milliseconds... 0 = default (2 x update period). This is capped
 * at the space available in the buffer.

When starting playback of a stream or MOD music, after creating it or changing its position, there will be a slight delay while the initial data is decoded for playback. Usually the delay is not noticeable or important, but if you need playback to start instantly when you call Play, then use this method first. The length parameter should be at least equal to the update period. It may not always be possible to render the requested amount of data, in which case this method will still succeed. GetData(BASS_DATA_AVAILABLE) can be used to check how much data a channel has buffered for playback. When automatic updating is disabled (BASS_CONFIG_UPDATEPERIOD = 0), this method could be used instead of TBass.Update to implement different update periods for different channels, instead of a single update period for all. Unlike TBass.Update, this method can also be used while automatic updating is enabled. The CPU usage of this method is not included in the TBass.GetCPU reading.

Method SlideAttribute:Int(attrib:Int, value:Float, time:Int)

Description: Slides a channel's attribute from its current value to a new value.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: This method is similar to SetAttribute, except that the attribute is ramped to the value over the specified period of time. Another difference is that the value is not pre-checked. If it is invalid, the slide will simply end early. If an attribute is already sliding, then the old slide is stopped and replaced by the new one. IsSliding can be used to check if an attribute is currently sliding. A BASS_SYNC_SLIDE sync can also be set via SetSync, to be triggered at the end of a slide. The sync will not be triggered in the case of an existing slide being replaced by a new one. Attribute slides are unaffected by whether the channel is playing, paused or stopped. They carry on regardless.

Method IsSliding:Int(attrib:Int)

Description: Checks if an attribute (or any attribute) of a sample, stream, or MOD music is sliding.

Returns: If the attribute is sliding, then TRUE is returned, else FALSE is returned.

Method Bytes2Seconds:Double(pos:Long)

Description: Translates a byte position into time (seconds), based on a channel's format.

Returns: If successful, then the translated length is returned, else a negative value is returned. Use TBass.ErrorGetCode to get the error code.

Information: The translation is based on the channel's initial sample rate, when it was created.

Method Flags:Int(flags:Int, mask:Int)

Description: Modifies and retrieves a channel's flags.

Returns: If successful, the channel's updated flags are returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Information: Some flags may not be adjustable in some circumstances, so the return value should be checked to confirm any changes. The flags listed above are just the flags that can be modified, and there may be additional flags present in the return value. See the BASS_CHANNELINFO documentation for a full list of flags. Streams that are created by add-ons may have additional flags available. There is a limited number of possible flag values though, so some add-ons may use the same flag value for different things. This means that when using add-on specific flags with a stream created via the plugin system, it is a good idea to first confirm that the add-on is handling the stream, by checking its ctype via BASS_ChannelGetInfo. During playback, the effects of flag changes are not heard instantaneously, due to buffering. To reduce the delay, use the BASS_CONFIG_BUFFER config option to reduce the buffer length.

Method SetFX:TBassFX(fxType:Int, priority:Int)

Description: Sets an effect on a stream, MOD music, or recording channel.

Returns: If successful, then the new effect's handle is returned, else Null is returned. Use TBass.ErrorGetCode to get the error code.

Method GetAttribute:Int(attrib:Int, value:Float Var)

Description: Retrieves the value of a channel's attribute.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: Parameters:
 * attrib : The attribute to set the value of... one of the following.


 * Other attributes may be supported by add-ons, see the documentation.
 * value : A variable to receive the attribute value.

Method SetAttribute:Int(attrib:Int, value:Float)

Description: Sets the value of a channel's attribute.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: Parameters:
 * attrib : The attribute to set the value of... one of the following.


 * Other attributes may be supported by add-ons, see the documentation.
 * value : A variable to receive the attribute value.

Method SetLink:Int(channel:TBassChannel)

Description: Links two MOD music or stream channels together.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: Linked channels are started/stopped/paused/resumed together. Links are one-way, for example, channel chan will be started by channel handle, but not vice versa unless another link has been set in that direction. If a linked channel has reached the end, it will not be restarted when a channel it is linked to is started. If you want a linked channel to be restarted, you need to have resetted its position using SetPosition beforehand.

Method Get3DPosition:Int(pos:TBass3DVector = Null, orient:TBass3DVector = Null, vel:TBass3DVector = Null)

Description: Retrieves the 3D position of a sample, stream, or MOD music channel with 3D functionality.

Method Set3DPosition:Int(pos:TBass3DVector = Null, orient:TBass3DVector = Null, vel:TBass3DVector = Null)

Description: Sets the 3D position of a sample, stream, or MOD music channel with 3D functionality.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Method Set3DAttributes:Int(mode:Int = -1, minDist:Float = 0, maxDist:Float = 0, iangle:Int = -1, ..

Description: Sets the 3D attributes of a sample, stream, or MOD music channel with 3D functionality.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Method Get3DAttributes:Int(mode:Int Var, minDist:Float Var, maxDist:Float Var, iangle:Int Var, oangle:Int Var, ..

Description: Retrieves the 3D attributes of a sample, stream, or MOD music channel with 3D functionality.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Method GetData:Int(buffer:Byte Ptr, length:Int)

Description: Retrieves the immediate sample data (or an FFT representation of it) of a stream or MOD music channel.

Returns: If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. When requesting FFT data, the number of bytes read from the channel (to perform the FFT) is returned. When requesting sample data, the number of bytes written to buffer will be returned (not necessarily the same as the number of bytes read when using the BASS_DATA_FLOAT flag). When using the BASS_DATA_AVAILABLE flag, the number of bytes in the channel's buffer is returned.

Information: Can also be used with a recording channel. This method can only return as much data as has been written to the channel's buffer, so it may not always be possible to get the amount of data requested, especially if you request large amounts. If you really do need large amounts, then increase the buffer lengths (BASS_CONFIG_BUFFER). The BASS_DATA_AVAILABLE flag can be used to check how much data a channel's buffer contains at any time, including when stopped or stalled. When requesting data from a "decoding channel" (BASS_STREAM_DECODE or BASS_MUSIC_DECODE was used at creation), there are no intermediate buffers involved, so as much data as is available can be decoded in one go. When retrieving sample data, 8-bit samples are unsigned (0 to 255), 16-bit samples are signed (-32768 to 32767), 32-bit floating-point samples range from -1 to +1 (not clipped, so can actually be outside this range). That's unless the BASS_DATA_FLOAT flag is used, in which case, the sample data will be converted to 32-bit floating-point (if it isn't already). When requesting FFT data, floating-point values ranging from 0 to 1 are returned. Only the first half of the FFT is useful, so that's what BASS returns. For example, with a 2048 sample FFT, it will return 1024 values; the 1st value being the DC component, the 2nd being the amplitude at 1/2048 of the channel's sample rate, then the amplitude at 2/2048, 3/2048, etc... A Hann window is applied to the sample data to reduce leakage, unless the BASS_DATA_FFT_NOWINDOW flag is used. Channels that have 2 or more sample channels (i.e. stereo or above) may have FFT performed on each individual channel, using the BASS_DATA_FFT_INDIVIDUAL flag. Without this flag, all the channels are combined, and a single mono FFT is performed. Performing the extra individual FFTs of course increases the amount of processing required. The return values are interleaved in the same order as the channel's sample data, e.g. stereo = left, right,left,etc... This method is most useful if you wish to visualize (e.g. spectrum analyze) the sound.

Method GetDevice:Int

Description: Retrieves the device that a channel is using.

Returns: If successful, the device number is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Method GetInfo:TBassChannelInfo

Description: Retrieves information on a channel.

Method Lock:Int(value:Int)

Description: Locks a stream, MOD music or recording channel to the current thread.

Information: Locking a channel prevents other threads from performing most functions on it, including buffer updates. Other threads wanting to access a locked channel will block until it is unlocked, so a channel should only be locked very briefly. A channel must be unlocked in the same thread that it was locked.

Method Seconds2Bytes:Long(pos:Double)

Description: Translates a time (seconds) position into bytes, based on a channel's format.

Returns: If successful, then the translated length is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Information: The translation is based on the channel's initial sample rate, when it was created. The return value is rounded down to the position of the nearest sample.

Method SetSync(stype:Int, param:Long, syncData:TBassSyncData)

Method SetPosition:Int(pos:Long, mode:Int)

Description: Sets the playback position of a sample, MOD music, or stream.

Information: Setting the position of a MOD music in bytes (other than 0) requires that the BASS_MUSIC_PRESCAN flag was used in the BASS_MusicLoad call. When setting the position in orders and rows, the channel's byte position (as reported by BASS_ChannelGetPosition) is reset to 0. This is because it is not possible to get the byte position of an order/row position; it is possible that a position may never be played in the normal course of events, or it may be played multiple times. When setting the position of a MOD music, and the BASS_MUSIC_POSRESET flag is active, all notes that were playing before the position changed will be stopped. Otherwise, the notes will continue playing until they are stopped in the MOD music. When setting the position in bytes, the BPM, speed and global volume are updated to what they would normally be at the new position. Otherwise they are left as they were prior to the position change, unless the seek position is 0 (the start), in which case they are also reset to the starting values (with the BASS_MUSIC_POSRESET flag). When the BASS_MUSIC_POSRESETEX flag is active, the BPM, speed and global volume are reset with every seek. For MP3/MP2/MP1 streams, if the BASS_STREAM_PRESCAN flag was used when BASS_StreamCreateFile was called to create the stream, seeking will be accurate to the exact requested byte. Otherwise it will be an approximation, which is generally still quite accurate. Seeking in internet file (and "buffered" user file) streams is possible once the download has reached the requested position, so long as the file is not being streamed in blocks (BASS_STREAM_BLOCK flag).

TBassSyncData
Used in SetSync method.

TBassFX
Used in SetFX method.


 * Reset
 * GetParameters
 * SetParameters

TBassFX: Methods
Method Reset:Int

Description: Reset FX data.

Method GetParameters:TBassFXType

Description: Get current FX parameters.

Method SetParameters:Int(fx:TBassFXType)

Description: Set FX parameters.

TBassFXType
Used in GetParameters, SetParameters and FXForType methods.

TBassDX8Chorus
Not used.

TBassStream
Bass stream type.


 * Create
 * CreateFile
 * CreateMem
 * CreateFileUser
 * CreateURL
 * CreateTStream
 * GetFilePosition
 * PutData
 * PutFileData
 * Free


 * StreamCreate
 * StreamCreateFile
 * StreamCreateMem
 * StreamCreateFileUser
 * StreamCreateURL
 * StreamCreateTStream

TBassStream: Methods
Method Create:TBassStream(freq:Int, chans:Int, flags:Int, proc:Int(handle:TBassStream, buffer:Byte Ptr, length:Int, user:Object), user:Object)

Description: Creates a new stream.

Method CreateFile:TBassStream(filename:String, offset:Long, length:Long, flags:Int)

Description: Creates a new file.

Method CreateMem:TBassStream(mem:Byte Ptr, length:Long, flags:Int)

Description: Creates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file in memory.

Returns: If successful, the new stream's handle is returned, else 0 is returned. Use TBass.ErrorGetCode to get the error code.

Information: Parameters:
 * mem : Memory Location
 * length : Length of sample in memory.
 * flags : Any combination of these flags.

BASS has built-in support for MPEG, OGG, WAV and AIFF files. Support for additional formats is available via add-ons, which can be downloaded from the BASS website: http://www.un4seen.com/ MPEG 1.0, 2.0 and 2.5 layer 3 (MP3) files are supported, layers 1 (MP1) and 2 (MP2) are also supported. WAV files can be in standard PCM format or they can be compressed with any ACM codec, but the codec is required to be installed on the user's computer for the WAV to be decoded. So you should either distribute the codec with your software, or use a codec that comes with Windows (e.g. Microsoft ADPCM). All PCM formats from 8 to 32-bit are supported in WAV and AIFF files, but the output will be restricted to 16-bit unless the BASS_SAMPLE_FLOAT flag is used. The file's original resolution is available via GetInfo. Multi-channel (i.e. more than stereo) OGG, WAV and AIFF files are supported. Use GetInfo to retrieve information on the format (sample rate, resolution, channels) of the stream. The playback length of the stream can be retrieved using GetLength. When streaming from memory, the memory generally must not be freed before the stream is.

OSX notes: Filenames are in UTF-8 form, and the BASS_UNICODE flag has no effect. All mixing is done in software (by BASS), so the BASS_SAMPLE_SOFTWARE flag has no effect. Compressed WAV files are not supported, only standard PCM are.

Method CreateFileUser:TBassStream

Description: Not implemented yet.

Method CreateURL:TBassStream(url:String, offset:Int, flags:Int, proc(buffer:Byte Ptr, length:Int, data:Object), user:Object)

Description: Creates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file on the internet, optionally receiving the downloaded data in a callback function.

Method CreateTStream:TBassStream(stream:TStream, system:Int, flags:Int)

Description: Creates a standard stream.

Method GetFilePosition:Long(mode:Int)

Description: Retrieves the file position/status of a stream.

Method PutData(buffer:Byte Ptr, length:Int)

Description: Not implemented yet.

Method PutFileData(buffer:Byte Ptr, length:Int)

Description: Not implemented yet.

Method Free:Int

Description: Frees a sample stream's resources, including any sync/DSP/FX it has.

Returns: If successful, TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

TBassStream: Functions
Function StreamCreate:TBassStream(freq:Int, chans:Int, flags:Int, proc:Int(handle:TBassStream, buffer:Byte Ptr, length:Int, user:Object), user:Object)

Description: Creates a new stream.

Function StreamCreateFile:TBassStream(filename:String, offset:Int, length:Int, flags:Int)

Description: Creates a new file stream.

Function StreamCreateMem:TBassStream(mem:Byte Ptr, length:Long, flags:Int)

Description: Creates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file in memory.

Function StreamCreateFileUser:TBassStream

Description: Not implemented yet.

Function StreamCreateURL:TBassStream(url:String, offset:Int, flags:Int, proc(buffer:Byte Ptr, length:Int, user:Object), data:Object)

Description: Creates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file on the internet, optionally receiving the downloaded data in a callback function.

Function StreamCreateTStream:TBassStream(stream:TStream, system:Int, flags:Int)

Description: Creates a standard stream.

TBassSample
An audio sample.


 * Create
 * FileLoad
 * MemLoad
 * Free
 * GetChannel
 * Stop
 * GetInfo
 * SetInfo
 * GetData
 * SetData
 * GetChannels


 * SampleCreate
 * SampleFileLoad
 * SampleMemLoad

TBassSample: Methods
Method Create:TBassSample(length:Int, freq:Int, channels:Int, maxPlaybacks:Int, flags:Int)

Description: Creates a new sample.

Method FileLoad:TBassSample(file:String, offset:Long, length:Int, maxPlaybacks:Int, flags:Int)

Description: Loads a file sample.

Method MemLoad:TBassSample(mem:Byte Ptr, length:Int, maxPlaybacks:Int, flags:Int)

Description: Loads a file sample from memory.

Method Free:Int

Description: Frees a sample's resources.

Returns: If successful, TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Method GetChannel:TBassChannel(onlyNew:Int)

Description: Creates/initializes a playback channel for a sample.

Returns: If successful, the new channel is returned, else Null is returned. Use TBass.ErrorGetCode to get the error code.

Information: Use GetInfo and SetInfo to set a sample's default attributes, which are used when creating a channel. After creation, a channel's attributes can be changed via TBassChannel::SetAttribute, TBassChannel::Set3DAttributes and TBassChannel::Set3DPosition. TBass.Apply3D should be called before starting playback of a 3D sample, even if you just want to use the default settings. A sample channel is automatically freed when it's overridden by a new channel, or when stopped by TBassChannel::Stop, TBassSample::Stop or TBass::Stop. If you wish to stop a channel and re-use it, TBassChannel::Pause should be used to pause it instead. Determining whether a channel still exists can be done by trying to use the handle in a function call. A list of all the sample's existing channels can also be retrieved via TBassSample::GetChannels. The new channel will have an initial state of being paused (BASS_ACTIVE_PAUSED). This prevents the channel being claimed by another call of this function before it has been played, unless it gets overridden due to a lack of free channels. All of a sample's channels share the same sample data, and just have their own individual playback state information (volume/position/etc). Parameters:
 * onlyNew : Do not recycle/override one of the sample's existing channels?

Method Stop:Int

Description: Stops all instances of a sample.

Returns: If successful, TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: If a sample is playing simultaneously multiple times, calling this function will stop them all, which is obviously simpler than calling BASS_ChannelStop multiple times.

Method GetInfo:TBassSampleInfo

Description: Retrieves a sample's default attributes and other information.

Method SetInfo:Int(info:TBassSampleInfo)

Description: Sets a sample's default attributes.

Returns: If successful, True is returned, else False is returned. Use TBass.ErrorGetCode to get the error code.

Information: Use this method and GetInfo to edit a sample's default attributes. Changing a sample's default attributes does not affect any existing channels, it only affects channels subsequently created via GetChannel. The exception is the VAM settings, changes to that apply to all the sample's channels at their next playback (TBassChannel::Play). Use TBassChannel::SetAttribute and TBassChannel::Set3DAttributes to change the attributes of an existing sample channel. The length, max, origres and chans members of TBassSampleInfo can't be modified; any changes are ignored. The BASS_SAMPLE_8BITS, BASS_SAMPLE_MONO, BASS_SAMPLE_3D, BASS_SAMPLE_MUTEMAX, BASS_SAMPLE_SOFTWARE and BASS_SAMPLE_VAM flags also can't be changed.

Method GetData:Int(buffer:Byte Ptr)

Description: Retrieves a copy of a sample's data.

Information: Parameters:
 * buffer : Pointer to a buffer to receive the data. The buffer must be big enough to receive the sample's data,
 * the size of which can be retrieved via GetInfo.

Method SetData:Int(buffer:Byte Ptr)

Description: Sets a sample's data.

Returns: If successful, True is returned, else False is returned. Use TBass.ErrorGetCode to get the error code.

Information: The required length and format of the data can be retrieved via GetInfo. A sample's data can be set at any time, including during playback. Parameters:
 * buffer : Pointer to a buffer to receive the data.

Method GetChannels:TBassSample[]

Description: TODO

TBassSample: Functions
Function SampleCreate:TBassSample(length:Int, freq:Int, channels:Int, maxPlaybacks:Int, flags:Int)

Description: Creates a new sample.

Information: The sample's initial content is undefined. SetData should be used to set the sample's data. Unless the BASS_SAMPLE_SOFTWARE flag is used, the sample will use hardware mixing if hardware resources are available. Use BASS_GetInfo to see if there are hardware mixing resources available, and which sample formats are supported by the hardware. The BASS_SAMPLE_VAM flag allows a sample to be played by both hardware and software, with the decision made when the sample is played rather than when it's loaded. A sample's VAM options are set via SetInfo. To play a sample, first a channel must be obtained using GetChannel, which can then be played using TBassChannel::Play. If you want to play a large or one-off sample, then it would probably be better to stream it instead with TBassStream::Create.

Function SampleFileLoad:TBassSample(file:String, offset:Long, length:Int, maxPlaybacks:Int, flags:Int)

Description: Loads a file sample.

Function SampleMemLoad:TBassSample(mem:Byte Ptr, length:Int, maxPlaybacks:Int, flags:Int)

Description: Loads a file sample from memory.

TBassSampleInfo
Used with TBassSample::GetInfo and TBassSample::SetInfo to retrieve and set the default playback attributes of a sample.


 * GetFreq
 * SetFreq
 * GetVolume
 * SetVolume
 * GetPan
 * SetPan
 * GetFlags
 * SetFlags
 * GetLength
 * GetMax
 * GetOrigRes
 * GetChans
 * GetMinGap
 * SetMinGap
 * GetMode3D
 * SetMode3D
 * GetMinDist
 * SetMinDist
 * GetMaxDist
 * SetMaxDist
 * GetIAngle
 * SetIAngle
 * GetOAngle
 * SetOAngle
 * GetOutVol
 * SetOutVol
 * GetVAM
 * SetVAM
 * GetPriority
 * SetPriority

TBassSampleInfo: Methods
Method GetFreq:Int

Description: Default sample rate.

Method SetFreq(value:Int)

Description: Default sample rate.

Method GetVolume:Float

Description: Default volume... 0 (silent) to 1 (full).

Method SetVolume(value:Float)

Description: Default volume... 0 (silent) to 1 (full).

Method GetPan:Float

Description: Default panning position... -1 (full left) to +1 (full right), 0 = centre.

Method SetPan(value:Float)

Description: Default panning position... -1 (full left) to +1 (full right), 0 = centre.

Method GetFlags:Int

Description: A combination of these flags.

Information:

Method SetFlags(flags:Int)

Description: A combination of these flags.

Information:

Method GetLength:Int

Description: The length in bytes.

Method GetMax:Int

Description: Maximum number of simultaneous playbacks.

Method GetOrigRes:Int

Description: The original resolution (bits per sample)... 0 = undefined.

Method GetChans:Int

Description: Number of channels... 1 = mono, 2 = stereo, etc...

Method GetMinGap:Int

Description: Minimum time gap in milliseconds between creating channels using TBassSample.GetChannel.

Information: This can be used to prevent flanging effects caused by playing a sample multiple times very close to each other. The default setting, after loading/creating a sample, is 0 (disabled).

Method SetMinGap(value:Int)

Description: Minimum time gap in milliseconds between creating channels using TBassSample.GetChannel.

Information: This can be used to prevent flanging effects caused by playing a sample multiple times very close to each other. The default setting, after loading/creating a sample, is 0 (disabled).

Method GetMode3D:Int

Description: The 3D processing mode... one of these flags.

Information:

Method SetMode3D(value:Int)

Description: The 3D processing mode... one of these flags.

Information:

Method GetMinDist:Float

Description: The minimum distance.

Information: The sample's volume is at maximum when the listener is within this distance.

Method SetMinDist(value:Float)

Description: The minimum distance.

Information: The sample's volume is at maximum when the listener is within this distance.

Method GetMaxDist:Float

Description: The maximum distance.

Information: The sample's volume stops decreasing when the listener is beyond this distance.

Method SetMaxDist(value:Float)

Description: The maximum distance.

Information: The sample's volume stops decreasing when the listener is beyond this distance.

Method GetIAngle:Int

Description: The angle of the inside projection cone in degrees... 0 (no cone) to 360 (sphere).

Method SetIAngle(value:Int)

Description: The angle of the inside projection cone in degrees... 0 (no cone) to 360 (sphere).

Method GetOAngle:Int

Description: The angle of the outside projection cone in degrees... 0 (no cone) to 360 (sphere).

Method SetOAngle(value:Int)

Description: The angle of the outside projection cone in degrees... 0 (no cone) to 360 (sphere).

Method GetOutVol:Float

Description: The delta-volume outside the outer projection cone... 0 (silent) to 1 (full).

Method SetOutVol(value:Float)

Description: The delta-volume outside the outer projection cone... 0 (silent) to 1 (full).

Method GetVAM:Int

Description: Voice allocation/management flags... a combination of these

Method SetVAM(value:Int)

Description: Voice allocation/management flags... a combination of these

Method GetPriority:Int

Description: Priority, used with the BASS_VAM_TERM_PRIO flag... 0 (min) to $FFFFFFFF (max).

Method SetPriority(value:Int)

Description: Priority, used with the BASS_VAM_TERM_PRIO flag... 0 (min) to $FFFFFFFF (max).

TBassMusic
A Mod music file : MO3 / IT / XM / S3M / MTM / MOD / UMX formats.


 * FileLoad
 * MemLoad
 * Free


 * MusicFileLoad
 * MusicMemLoad

TBassMusic: Methods
Method FileLoad:TBassMusic(file:String, offset:Long, length:Int, flags:Int, freq:Int)

Description: Loads a MOD music file; MO3 / IT / XM / S3M / MTM / MOD / UMX formats.

Returns: If successful, the loaded MOD music's handle is returned, else Null is returned. Use TBass.ErrorGetCode to get the error code.

Method MemLoad:TBassMusic(mem:Byte Ptr, length:Int, flags:Int, freq:Int)

Description: Loads a MOD music file from memory; MO3 / IT / XM / S3M / MTM / MOD / UMX formats.

Returns: If successful, the loaded MOD music's handle is returned, else Null is returned. Use TBass.ErrorGetCode to get the error code.

Method Free:Int

Description: Frees a MOD music's resources, including any sync/DSP/FX it has.

Returns: If successful, TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

TBassMusic: Functions
Function MusicFileLoad:TBassMusic(file:String, offset:Long, length:Int, flags:Int, freq:Int)

Description: Loads a MOD music file; MO3 / IT / XM / S3M / MTM / MOD / UMX formats.

Returns: If successful, the loaded MOD music's handle is returned, else Null is returned. Use TBass.ErrorGetCode to get the error code.

Information: Parameters:
 * file : Filename
 * offset : File offset to load the MOD music from
 * length : Data length... 0 = use all data up to the end of file
 * flags : A combination of these flags.


 * freq : Sample rate to render/play the MOD music at... 0 = the rate specified in the TBass.Init call.

BASS uses the same code as XMPlay for its MOD music support, giving the most accurate reproduction of MO3 / IT / XM / S3M / MTM / MOD / UMX files available. MO3s are treated and used in exactly the same way as normal MOD musics. The advantage of MO3s is that they can be a lot smaller with virtually identical quality. Playing a MO3 does not use any more CPU power than playing the original MOD version does. The only difference is a slightly longer load time as the samples are being decoded. MO3 files are created using the MO3 encoder available at the BASS website. DMO effects (the same as available with BASS_ChannelSetFX) can be used in IT and XM files (and MO3 versions of them) created with Modplug Tracker. This allows effects to be added to a track without having to resort to an MP3 or OGG version, so it can remain small and still sound fancy. Of course, the effects require some CPU, so should not be used carelessly if performance is key. DirectX 8 (or above) is required for the effects to be heard; without that, the music can still be played, but the effects are disabled. Ramping doesn't take a lot of extra processing and improves the sound quality by removing "clicks". Sensitive ramping leaves sharp attacked samples, while normal ramping can cause them to lose a bit of their impact. Generally, normal ramping is recommended for XMs, and sensitive ramping for the other formats. But, some XMs may also sound better using sensitive ramping. After loading a MOD music from memory (mem = TRUE), the memory can safely be discarded.

OSX notes: Filenames are in UTF-8 form, and the BASS_UNICODE flag has no effect. All mixing is done in software (by BASS), so the BASS_SAMPLE_SOFTWARE flag has no effect.

Function MusicMemLoad:TBassMusic(mem:Byte Ptr, length:Int, flags:Int, freq:Int)

Description: Loads a MOD music file from memory; MO3 / IT / XM / S3M / MTM / MOD / UMX formats.

Returns: If successful, the loaded MOD music's handle is returned, else Null is returned. Use TBass.ErrorGetCode to get the error code.

TBassChannelInfo
Used with TBassChannel.GetInfo to retrieve information on a channel.

The BASS_SAMPLE_SOFTWARE flag indicates whether or not the channel's sample data is being mixed into the final output by the hardware. It does not indicate (in the case of a stream or MOD music) whether the processing required to generate the sample data is being done by the hardware, this processing is always done in software.

With a recording channel, the BASS_STREAM_DECODE flag indicates that it's not using a RECORDPROC callback function.

BASS supports 8/16/32-bit sample data, so if a WAV file, for example, uses another sample resolution, it'll have to be converted by BASS. The origres member can be used to check what the resolution originally was.


 * GetFreq
 * GetChannels
 * GetFlags
 * GetCType
 * GetOrigRes
 * GetSample
 * GetFilename

TBassChannelInfo: Methods
Method GetFreq:Int

Description: Default playback rate.

Method GetChannels:Int

Description: Number of channels... 1=mono, 2=stereo, etc...

Method GetFlags:Int

Description: A combination of these flags.

Information:

Method GetCType:Int

Description: The type of channel it is, which can be one of the following.

Information:

Method GetOrigRes:Int

Description: The original resolution (bits per sample)... 0 = undefined.

Method GetSample:TBassSample

Description: The sample that is playing on the channel. (HCHANNEL only)

Method GetFilename:String

Description: The filename associated with the channel. (HSTREAM only)

TBass
Bass data type.


 * Free
 * Init
 * ErrorGetCode
 * GetVolume
 * SetVolume
 * Start
 * SetDevice
 * GetDevice
 * GetCPU
 * Pause
 * GetVersion
 * Update
 * GetDeviceInfo
 * GetConfig
 * SetConfig
 * Apply3D
 * GetEAXParameters
 * SetEAXParameters
 * Get3DFactors
 * Set3DFactors
 * GetInfo
 * PluginLoad

TBass: Functions
Function Free:Int

Description: Frees all resources used by the output device, including all its samples, streams and MOD musics.

Function Init:Int(device:Int, freq:Int, flags:Int, win:Byte Ptr = Null, clsid:Byte Ptr = Null)

Description: Initializes an output device.

Returns: If the device was successfully initialized, True is returned, else False is returned. Use TBass.ErrorGetCode to get the error code.

Information: This function must be successfully called before using any sample, stream or MOD music functions. The recording functions may be used without having called this function. The "no sound" device allows loading and playing of MOD musics, but most other functions will fail. This is so that you can still use MOD musics as synchronizers when there is no soundcard present (or without DirectX installed). Decoding channels can also still be used with the "no sound" device. When using the "no sound" device, you should still set the other parameters as you would do normally. The format (sample rate, etc...) specified when calling this function only actually has effect on the device's output with VxD drivers. With WDM drivers, the output format is automatically set depending on the format of the channels that are played and what the device supports. While in Vista, the output format is determined by the user's choice in the control panel; BASS_GetInfo can be used to check what that is. For reference... Windows XP/2000 use only WDM drivers. Windows Me/98SE can use either WDM or the older VxD driver model. Windows 98/95 only use VxD drivers. When specifying a class identifier (clsid), after successful initialization, you can use BASS_GetDSoundObject to retrieve the DirectSound object, and through that access any special interfaces that the object may provide. Simultaneously using multiple devices is supported in the BASS API via a context switching system; instead of there being an extra "device" parameter in the function calls, the device to be used is set prior to calling the functions. SetDevice is used to switch the current device. When successful, BASS_Init automatically sets the current thread's device to the one that was just initialized. When using the default device (device = -1), GetDevice can be used to find out which device it was mapped to.

OSX notes: The win and clsid parameters are not used. The BASS_DEVICE_LATENCY, BASS_DEVICE_CPSPEAKERS and BASS_DEVICE_SPEAKERS flags are also ignored; the latency is calculated automatically and the number of speakers is always detected accurately. The sample format specified has no effect on the device output; BASS_GetInfo can be used to check what that is.

Function ErrorGetCode:Int

Description: Retrieves the error code for the most recent BASS function call in the current thread.

Function GetVolume:Float

Description: Retrieves the current master volume level.

Returns: If successful, the volume level is returned, else -1 is returned. Use TBass.ErrorGetCode to get the error code.

Function SetVolume:Int(volume:Float)

Description: Sets the output master volume.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: The actual volume level may not be exactly the same as requested, due to underlying precision differences. BASS_GetVolume can be used to confirm what the volume is. This function affects the volume level of all applications using the same output device. If you wish to only affect the level of your application's sounds, the BASS_ATTRIB_VOL attribute and/or the BASS_CONFIG_GVOL_MUSIC / BASS_CONFIG_GVOL_SAMPLE / BASS_CONFIG_GVOL_STREAM config options should be used instead. When using multiple devices, the current thread's device setting (as set with BASS_SetDevice) determines which device this function call applies to.

Function Start:Int

Description: Starts (or resumes) the output.

Returns: If successful, then True is returned, else False is returned. Use TBass.ErrorGetCode to get the error code.

Information: The output is automatically started by TBass.Init, so there is no need to use this function unless you've stopped or paused the output. When using multiple devices, the current thread's device setting (as set with TBass.SetDevice) determines which device this function call applies to.

Function SetDevice:Int(device:Int)

Description: Sets the device to use for subsequent calls.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Information: Simultaneously using multiple devices is supported in the BASS API via a context switching system; instead of there being an extra "device" parameter in the function calls, the device to be used is set prior to calling the functions. The functions that use the device selection are the following: Free, GetDSoundObject, GetInfo, Start, Stop, Pause, SetVolume, GetVolume, Set3DFactors, Get3DFactors, Set3DPosition, Get3DPosition, SetEAXParameters, GetEAXParameters. It also determines which device is used by a new sample/stream/music: BASS_MusicLoad, BASS_SampleLoad, BASS_StreamCreateFile, etc... When one of the above functions (or GetDevice) is called, BASS will check the device setting, and if no device is selected (or the selected device is not initialized), BASS will automatically select the lowest device that is initialized. This means that when using a single device, there is no need to use this function; BASS will automatically use the device that's initialized. Even if you free the device, and initialize another, BASS will automatically switch to the one that is initialized. Parameters:
 * device : The device to use... 0 = no sound, 1 = first real output device.

Function GetDevice:Int

Description: Retrieves the device setting of the current thread.

Returns: If successful, the device number is returned, else -1 is returned. Use TBass.ErrorGetCode to get the error code.

Function GetCPU:Float

Description: Retrieves the current CPU usage of BASS.

Returns: The BASS CPU usage as a percentage of total CPU time.

Information: This function includes the time taken to render stream (TBassStream) and MOD music (TBassMusic) channels during playback, and any DSP functions set on those channels. It does not include sample (TBassSample) channels, which are mixed by the output device (hardware accelerated) or DirectSound/drivers. The rendering of some add-on stream formats may not be entirely included, if they use additional decoding threads. See the add-on documentation for details. This function does not strictly tell the CPU usage, but rather how timely the buffer updates are. For example, if it takes 10ms to render 100ms of data, that would be 10. If the reported usage gets to 100, that means the channel data is being played faster than it can be rendered, and buffer underruns are likely to occur. If automatic updating is disabled, then the value returned by this function is only updated after each call to Update. TBassChannel.Update usage is not included.

OSX notes: The CPU usage does include sample playback.

Function Pause:Int

Description: Stops the output, pausing all musics/samples/streams.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: Use Start to resume the output and paused channels. When using multiple devices, the current thread's device setting (as set with SetDevice) determines which device this function call applies to.

Function GetVersion:Int

Description: Retrieves the version of BASS that is loaded.

Returns: The BASS version. For example, 0x02040103 (hex), would be version 2.4.1.3

Information: There is no guarantee that a previous or future version of BASS supports all the BASS functions that you are using, so you should always use this function to make sure the correct version is loaded. It is safe to assume that future revisions (indicated in the LOWORD) will be fully compatible. The BASS API includes a BASSVERSION constant, which can be used to check that the loaded BASS.DLL matches the API version used, ignoring revisions.

Function Update:Int(length:Int)

Description: Manually updates the TBassStream and TBassMusic channel playback buffers.

Returns: If successful, TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: Parameters:
 * length : The amount to render, in milliseconds.

When automatic updating is disabled, this function (or TBassChannel.Update) needs to be called to keep the playback buffers updated. The length parameter should include some safety margin, in case the next update cycle gets delayed. For example, if calling this function every 100ms, 200 would be a reasonable length parameter.

Function GetDeviceInfo:TBassDeviceInfo(device:Int)

Description: Retrieves information on an output device.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: This method can be used to enumerate the available devices for a setup dialog. Device 0 is always the "no sound" device, so if you should start at device 1 if you only want to list real devices.

Function GetConfig:Int(option:Int)

Description: Retrieves the value of a config option.

Returns: If successful, the value of the requested config option is returned, else -1 is returned. Use TBass.ErrorGetCode to get the error code.

Information: Retrieves the value of a config option. Parameters:
 * option :

Function SetConfig:Int(option:Int, value:Int)

Description: Sets the value of a config option.

Returns: If successful, TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: The option to set the value of... one of the following. Parameters:
 * option :


 * value : The new option setting. See the option's documentation for details on the possible values.

Function Apply3D

Description: Applies changes made to the 3D system.

Information: This function must be called to apply any changes made with TBass.Set3DFactors, TBass.Set3DPosition, TBassChannel.Set3DAttributes or TBassChannel.Set3DPosition. This allows multiple changes to be synchronized, and also improves performance. This function applies 3D changes on all the initialized devices. There is no need to re-call it for each individual device when using multiple devices.

Function GetEAXParameters:Int(env:Int Var, vol:Float Var, decay:Float Var, damp:Float Var)

Description: Retrieves the current type of EAX environment and its parameters.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Function SetEAXParameters:Int(env:Int, vol:Float, decay:Float, damp:Float)

Description: Sets the type of EAX environment and its parameters.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Function Get3DFactors:Int(distf:Float Var, rollf:Float Var, doppf:Float Var)

Description: Retrieves the factors that affect the calculations of 3D sound.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: Parameters:
 * distf : The distance factor
 * rollf : The rolloff factor
 * doppf : The doppler factor

When using multiple devices, the current thread's device setting (as set with BASS_SetDevice) determines which device this function call applies to.

Function Set3DFactors:Int(distf:Float, rollf:Float, doppf:Float)

Description: Sets the factors that affect the calculations of 3D sound.

Returns: If successful, then TRUE is returned, else FALSE is returned. Use TBass.ErrorGetCode to get the error code.

Information: Parameters
 * distf : The distance factor... 0 or less = leave current... examples: 1.0 = use meters,

0.9144 = use yards, 0.3048 = use feet. By default BASS measures distances in meters, you can change this
 * setting if you are using a different unit of measurement.
 * rollf : The rolloff factor, how fast the sound quietens with distance... 0.0 (min) - 10.0 (max),

less than 0.0 = leave current...
 * examples: 0.0 = no rolloff, 1.0 = real world, 2.0 = 2x real.
 * doppf : The doppler factor... 0.0 (min) - 10.0 (max), less than 0.0 = leave current... examples:

0.0 = no doppler, 1.0 = real world, 2.0 = 2x real. The doppler effect is the way a sound appears to change pitch when it is moving towards or away from you. The listener and sound velocity settings are used to
 * calculate this effect, this doppf value can be used to lessen or exaggerate the effect.

As with all 3D functions, use Apply3D to apply the changes. When using multiple devices, the current thread's device setting (as set with BASS_SetDevice) determines which device this function call applies to.

Function GetInfo:TBassInfo

Description: Retrieves information on the device being used.

Returns: If successful, a TBassInfo object is returned, otherwise Null.

Information: When using multiple devices, the current thread's device setting (as set with BASS_SetDevice) determines which device this function call applies to.

Function PluginLoad:Int(file:String, flags:Int)

Description: Plugs an "add-on" into the standard stream and sample creation functions.

TBassDeviceInfo
Used with TBass.GetDeviceInfo or TBassRecord.GetDeviceInfo to retrieve information on a device.

When a device is disabled/disconnected, it is still retained in the device list, but the BASS_DEVICE_ENABLED flag is removed from it. If the device is subsequently re-enabled, it may become available again with the same device number, or the system may add a new entry for it.

When a new device is connected, it can affect the other devices and result in the system moving them to new device entries. If an affected device is initialized, it will stop working and will need to be reinitialized using its new device number.

OSX notes: driver is not used.


 * GetName
 * GetDriver
 * GetFlags

TBassDeviceInfo: Methods
Method GetName:String

Description: Description of the device.

Method GetDriver:String

Description: The filename of the driver... NULL = no driver ("no sound" device).

Information: On systems that can use both VxD and WDM drivers (Windows Me/98SE), this will reveal which type of driver is being used. Further information can be obtained from the file using the GetFileVersionInfo Win32 API function.

Method GetFlags:Int

Description: The device's current status... a combination of these flags.

TBassRecord
Bass recording type.


 * Start


 * RecordStart
 * Free
 * GetRecordDevice
 * Init
 * SetDevice
 * SetInput
 * GetInput
 * GetInputName
 * GetRecordInfo

TBassRecord: Methods
Method Start:TBassRecord(freq:Int, chans:Int, flags:Int, proc:Int(handle:TBassRecord, buffer:Byte Ptr, length:Int, user:Object), user:Object)

Description: Starts a new recording.

TBassRecord: Functions
Function RecordStart:TBassRecord(freq:Int, chans:Int, flags:Int, proc:Int(handle:TBassRecord, buffer:Byte Ptr, length:Int, user:Object), user:Object)

Description: Starts a new recording.

Function Free:Int

Description: Frees a recording's resources.

Function GetRecordDevice:Int

Description: Get the current recording device.

Function Init:Int(device:Int)

Description: Initializes a recording device.

Function SetDevice:Int(device:Int)

Description: Sets the recording device to use for subsequent calls in the current thread.

Function SetInput:Int(inp:Int, flags:Int, volume:Float)

Description: Sets the settings for a recording input source.

Function GetInput:Int(inp:Int, volume:Float Var)

Description: Retrieves the current settings of a recording input source.

Function GetInputName:String(inp:Int)

Description: Retrieves the text description of a recording input source.

Function GetRecordInfo:TBassRecordInfo

Description: Gets the current recording information.

TBassRecordInfo
Bass recording information type.

The formats member does not represent all the formats supported by the device, just the "standard" ones.

If there is no DirectSound driver for the device (i.e. it's being emulated), then the driver member will contain something like "WaveIn" instead of a filename.

OSX notes: The flags and formats members are not used. singlein is always TRUE.


 * GetFlags
 * GetFormats
 * GetInputs
 * IsSingleIn
 * GetFreq

TBassRecordInfo: Methods
Method GetFlags:Int

Description: The device's capabilities... a combination of these flags.

Information:

Method GetFormats:Int

Description: The standard formats supported by the device... a combination of these flags.

Information:

Method GetInputs:Int

Description: The number of input sources available to the device.

Method IsSingleIn:Int

Description: TRUE = only one input may be active at a time.

Method GetFreq:Int

Description: The device's current input sample rate (available only on Windows Vista and OSX).

Information: Recording at this rate will give the best quality and performance, as no resampling is required.

TBass3DVector
Type used by the 3D functions to describe positions, velocities, and orientations.


 * CreateVector


 * Create
 * GetX
 * GetY
 * GetZ
 * SetX
 * SetY
 * SetZ
 * GetXYZ
 * SetXYZ

TBass3DVector: Functions
Function CreateVector:TBass3DVector(x:Float = 0, y:Float = 0, z:Float = 0)

Description: Creates a new 3D Vector object.

TBass3DVector: Methods
Method Create:TBass3DVector(x:Float = 0, y:Float = 0, z:Float = 0)

Description: Creates a new 3D Vector object.

Method GetX:Float

Description: Returns the X vector.

Method GetY:Float

Description: Returns the Y vector.

Method GetZ:Float

Description: Returns the Z vector.

Method SetX(value:Float)

Description: Sets the X vector.

Method SetY(value:Float)

Description: Sets the Y vector.

Method SetZ(value:Float)

Description: Sets the Y vector.

Method GetXYZ(x:Float Var, y:Float Var, z:Float Var)

Description: Returns X, Y and Z.

Method SetXYZ(x:Float, y:Float, z:Float)

Description: Sets X, Y and Z.