Jump to content
BGM17

Vehicle sounds

Recommended Posts

Assuming the vehicle is stationary when you are making the sound you can use

Audio::PlaySample3D(const char *File_, const Vector &Pos_, bool looping_ = false);/*Example use to Play the sound and loop it*/Vehicle v(Caller);int soundID = Audio::PlaySample3D("mod:Audio/Path/To/AudioFile.wav",v.GetPosition(), true);/*To Stop playing the sound:*/Audio::StopSample(soundID);/*If the Vehicle is moving you need to constantly call the following method to keep the sound aligned with the vehicle:*/Audio::UpdatePos(soundID, v.GetPosition(), true);/*Volume can be modified by:*/Audio::SetVolume(soundID, float volume_level);

It's all pretty much the same implementation as sirens.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...