It isn't currently included in any demo. Also the functions used are quite straightforward, even default values are tuned so that they would fit most purposes with no configuration.
Code:
sound:=TBassEngine.Create(handle, true); // Set true to enable 3D
// Move and rotate listener while sounds are playing
sound.listener.SetLocation(pl.position);
// Front and up vectors from listener's rotation matrix
sound.listener.SetOrientation(getvector(pl.rotation, 2), getvector(pl.rotation, 1));
// Attach sounds to objects
for i:=0 to high(obj) do begin
sound.Add('music', 'sounds\test.s3m', true); // Again true to enable 3D for this specific sound too
with sound.sound[i] do begin
// Move and rotate object sounds
SetLocation(obj[i].position);
SetOrientation(getvector(obj[i].rotation, 2)); // front vector "where object is looking at"
looped:=true;
Set3DAttributes(0, 100, 360, 360, 0); // Detailed config values, optional
Play;
end;
end;
Bookmarks