BASS

BASS_SampleSetInfo


Sets a sample's default attributes.

BOOL BASS_SampleSetInfo(
    HSAMPLE handle,
    BASS_SAMPLE *info
);

Parameters

handleThe sample handle.
infoPointer to the sample information structure.

Return value

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

Error codes

BASS_ERROR_HANDLEThe handle is invalid.
BASS_ERROR_ILLPARAMThe BASS_SAMPLE max value is invalid.

Remarks

Use this function and BASS_SampleGetInfo 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. The exception is the VAM settings, changes to that apply to all the sample's channels at their next playback (BASS_ChannelPlay). Use BASS_ChannelSetAttribute and BASS_ChannelSet3DAttributes 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 cannot 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.

Example

Set a sample's default volume to 0.5.
BASS_SAMPLE info;
BASS_SampleGetInfo(sample, &info;); // get the sample's current info
info.volume=0.5; // set the default volume to 0.5
BASS_SampleSetInfo(sample, &info;); // set the updated info

See also

BASS_ChannelSet3DAttributes, BASS_ChannelSetAttribute, BASS_SampleGetInfo, BASS_SAMPLE structure