BASS.NET API for the Un4seen BASS Audio Library

BassBASS_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: 2.4.17.5
Syntax

[DllImportAttribute("bass")]
public static bool BASS_SampleSetInfo(
	int handle,
	BASS_SAMPLE info
)

Parameters

handle
Type: SystemInt32
The sample handle.
info
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.
Remarks

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, BASSFlag). 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.

Examples

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

Reference