BASS_SamplePlay3DEx

Plays a sample with 3D functionality from an offset, overriding the sample's default attributes with those specified.

HCHANNEL WINAPI BASS_SamplePlay3DEx(
    HSAMPLE handle
    BASS_3DVECTOR *pos,
    BASS_3DVECTOR *orient,
    BASS_3DVECTOR *vel
    DWORD start,
    int freq,
    int volume,
    BOOL loop
);

Parameters
handleHandle of the sample to play.
posPosition of the sound... NULL = x / y / z = 0.
orientOrientation of the sound... NULL = x / y / z = 0.
velVelocity of the sound... NULL = x / y / z = 0. This is only used to calculate the doppler effect, and has no effect on the sound's position.
startPlayback start position in samples (not bytes).
freqThe sample rate... 100 (min) - 100000 (max), -1 = use sample's default.
volumeThe volume... 0 (silent) - 100 (max), -1 = use sample's default.
loopTRUE = Loop the sample... -1 = use sample's default.

Return value
If successful, the handle of the channel used to play the sample is returned, else NULL is returned. Use BASS_ErrorGetCode to get the error code.

Error codes
BASS_ERROR_STARTThe digital output has not been started. Use BASS_Start to do so.
BASS_ERROR_HANDLEhandle is not a valid sample handle.
BASS_ERROR_FREQfreq is out of range... DirectSound only allows sample rates between 100 and 100000.
BASS_ERROR_NO3DThe sample does not have 3D functionality... BASS_SamplePlayEx should be used to play it.
BASS_ERROR_NOCHANThe sample has no free channel on which to be played... the maximum number of simultaneous playbacks has been reached, and no BASS_SAMPLE_OVER flag was specfied for the sample.
BASS_ERROR_NOHWNo hardware voices are available... this only occurs if the sample was loaded or created with the BASS_SAMPLE_VAM flag, and BASS_VAM_HARDWARE is set in the sample's VAM mode, and there are no hardware voices available to play it.
BASS_ERROR_BUFLOSTShould not happen, but... PLEASE REPORT IT IF YOU DO GET THIS ERROR!

See also
BASS_ChannelGetPosition, BASS_ChannelIsActive, BASS_ChannelPause, BASS_ChannelStop, BASS_SampleCreate, BASS_SampleLoad, BASS_SamplePlay3D, BASS_SampleStop