BASS.NET API for the Un4seen BASS Audio LibraryBASS_SAMPLE ClassBASS.NET API for the Un4seen BASS Audio Library
Used with BASS_SampleGetInfo(Int32, BASS_SAMPLE) and BASS_SampleSetInfo(Int32, BASS_SAMPLE) to retrieve and set the default playback attributes of a sample.
Inheritance Hierarchy


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

[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public sealed class BASS_SAMPLE

The BASS_SAMPLE type exposes the following members.


Public methodBASS_SAMPLE
Default constructor.
Public methodBASS_SAMPLE(Int32, Single, Single, BASSFlag, Int32, Int32, Int32, Int32, Int32, BASS3DMode, Single, Single, Int32, Int32, Single, BASSVam, Int32)
Constructor to initialize the members.

Public methodToString
A description of the record decive info object (driver file name, inputs etc.).
(Overrides ObjectToString.)

Public fieldchans
Number of channels... 1=mono, 2=stereo (default), etc.
Public fieldflags
A combination of these flags (BASSFlag):
BASS_SAMPLE_8BITSThe samples's resolution is 8-bit. If neither this or the BASS_SAMPLE_FLOAT flags are present, then the sample's resolution is 16-bit.
BASS_SAMPLE_FLOATThe samples's resolution is 32-bit floating-point.
BASS_SAMPLE_3DThe sample has 3D functionality enabled.
BASS_SAMPLE_MUTEMAX Mute the sample when it is at (or beyond) it's max distance (3D samples only).
BASS_SAMPLE_SOFTWAREThe sample is not using hardware mixing... it is being mixed in software by DirectSound.
BASS_SAMPLE_VAMDX7 voice allocation and management features are enabled (see below).
BASS_SAMPLE_OVER_VOLOverride: the channel with the lowest volume is overriden.
BASS_SAMPLE_OVER_POSOverride: the longest playing channel is overriden.
BASS_SAMPLE_OVER_DISTOverride: the channel furthest away (from the listener) is overriden (3D samples only).
Public fieldfreq
Default playback rate (set to 44100 by default).
Public fieldiangle
The angle of the inside projection cone in degrees... 0 (no cone, default) - 360 (sphere).
Public fieldlength
The length in bytes.
Public fieldmax
Maximum number of simultaneous playbacks (defaulted to 1).
Public fieldmaxdist
The maximum distance (default 0). The sample's volume stops decreasing when the listener is beyond this distance.
Public fieldmindist
The minimum distance (default 0). The sample's volume is at maximum when the listener is within this distance.
Public fieldmingap
Minimum time gap in milliseconds between creating channels using BASS_SampleGetChannel(Int32, Boolean). This can be used to prevent flanging effects caused by playing a sample multiple times very close to eachother. The default setting, when loading/creating a sample, is 0 (disabled).
Public fieldmode3d
The 3D processing mode... one of these flags (see BASS3DMode):
BASS_3DMODE_NORMALNormal 3D processing (default).
BASS_3DMODE_RELATIVEThe sample's 3D position (position/velocity/orientation) is relative to the listener. When the listener's position/velocity/orientation is changed with BASS_Set3DPosition(BASS_3DVECTOR, BASS_3DVECTOR, BASS_3DVECTOR, BASS_3DVECTOR), the sample's position relative to the listener does not change.
BASS_3DMODE_OFFTurn off 3D processing on the sample, the sound will be played in the center.
Public fieldoangle
The angle of the outside projection cone in degrees... 0 (no cone, default) - 360 (sphere).
Public fieldorigres
The original resolution (bits per sample)... 0 = undefined (default).
Public fieldoutvol
The delta-volume outside the outer projection cone... 0 (silent) to 1 (full, default) - same as inside the cone.
Public fieldpan
Default panning position -1 (full left) to +1 (full right) - defaulted to 0 = centre.
Public fieldpriority
Priority, used with the BASS_VAM_TERM_PRIO flag... 0 (min, default) - 0xFFFFFFFF (max)
Public fieldvam
The following are the sample's DX7 voice allocation/management settings (if VAM is enabled)...a combination of these (BASSVam):
BASS_VAM_HARDWAREPlay the sample in hardware (default). If no hardware voices are available then the play call will fail.
BASS_VAM_SOFTWAREPlay the sample in software (ie. non-accelerated). No other VAM flags may be used together with this flag.
The following flags enable hardware resource stealing... if the hardware has no available voices, a currently playing buffer will be stopped to make room for the new buffer. Only samples with VAM enabled are considered for termination:
BASS_VAM_TERM_TIMEIf there are no free hardware voices, the buffer to be terminated will be the one with the least time left to play.
BASS_VAM_TERM_DISTIf there are no free hardware voices, the buffer to be terminated will be one that was loaded/created with the BASS_SAMPLE_MUTEMAX flag and is beyond it's max distance (maxdist). If there are no buffers that match this criteria, then the play call will fail.
BASS_VAM_TERM_PRIOIf there are no free hardware voices, the buffer to be terminated will be the one with the lowest priority. This flag may be used with the TERM_TIME or TERM_DIST flag, if multiple voices have the same priority then the time or distance is used to decide which to terminate.
Public fieldvolume
Default volume... 0 (silent) to 1 (full, default).

When a sample has 3D functionality, the iangle and oangle angles decide how wide the sound is projected around the orientation angle (as set via BASS_ChannelSet3DPosition(Int32, BASS_3DVECTOR, BASS_3DVECTOR, BASS_3DVECTOR)). Within the inside angle the volume level is the level set in the volume member (or the BASS_ATTRIB_VOL attribute when the sample is playing). Outside the outer angle, the volume changes according to the outvol value. Between the inner and outer angles, the volume gradually changes between the inner and outer volume levels. If the inner and outer angles are 360 degrees, then the sound is transmitted equally in all directions.

When VAM is enabled, and neither the BASS_VAM_HARDWARE or BASS_VAM_SOFTWARE flags are specified, then the sample will be played in hardware if resources are available, and in software if no hardware resources are available.

See Also