styyx-util 1.0
Utility Header for SKSE Plugin development
Loading...
Searching...
No Matches
st-sounds.h
Go to the documentation of this file.
1#pragma once
2namespace StyyxUtil
3{
4
6{
11 static void PlayGameSound(const RE::Actor* a_actor, const RE::BGSSoundDescriptorForm* a_sound, const float a_volume)
12 {
13 if (!a_actor || !a_sound)
14 {
15 return;
16 }
17
18 RE::BSSoundHandle handle;
19 const auto am = RE::BSAudioManager::GetSingleton();
20 am->GetSoundHandle(handle, a_sound->soundDescriptor);
21 handle.SetVolume(a_volume);
22 handle.SetObjectToFollow(a_actor->Get3D());
23 handle.Play();
24 }
25};
26} // namespace StyyxUtil
Definition st-actor.h:7
Definition st-sounds.h:6
static void PlayGameSound(const RE::Actor *a_actor, const RE::BGSSoundDescriptorForm *a_sound, const float a_volume)
Play a specific sound form.
Definition st-sounds.h:11