BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_SampleSetInfo Method BASS.NET API for the Un4seen BASS Audio Library
Sets a sample's default attributes.

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

public static bool BASS_SampleSetInfo(
	int handle,


Type: SystemInt32
The sample handle.
Type: Un4seen.BassBASS_SAMPLE
An instance of the BASS_SAMPLE class containing the sample information to set.

Return Value

Type: Boolean
If successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.

Use this function and BASS_SampleGetInfo(Int32, BASS_SAMPLE) 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 BASS_SampleGetChannel(Int32, Boolean). The exception is the VAM settings, changes to that apply to all the sample's channels at their next playback (BASS_ChannelPlay(Int32, Boolean)). Use BASS_ChannelSetAttribute(Int32, BASSAttribute, Single) and BASS_ChannelSet3DAttributes(Int32, BASS3DMode, Single, Single, Int32, Int32, Int32) to change the attributes of an existing sample channel.

The sample's maximum number of simultaneous playbacks can be changed via the max member of the BASS_SAMPLE structure. If the new maximum is lower than the existing number of channels, the channels will remain existing until they are stopped.

The length, origres and chans members of the BASS_SAMPLE structure 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 cannot be changed.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.


Use one of the BASS_SAMPLE constructors to set the values:
Dim info As New BASS_SAMPLE(44100, 100, 0, ...)
Dim ok As Boolean = Bass.BASS_SampleSetInfo(sample, info)
BASS_SAMPLE info = new BASS_SAMPLE(44100, 100, 0, ...);
bool ok = Bass.BASS_SampleSetInfo(sample, info);
See Also