MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetAudioObjectAndSampleIndex

Function GetAudioObjectAndSampleIndex

src/openrct2/audio/Audio.cpp:186–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 }
185
186 static std::tuple<AudioObject*, uint32_t> GetAudioObjectAndSampleIndex(SoundId id)
187 {
188 auto& objManager = GetContext()->GetObjectManager();
189 AudioObject* audioObject{};
190 uint32_t sampleIndex = EnumValue(id);
191 if (id >= SoundId::liftRMC)
192 {
193 audioObject = objManager.GetLoadedObject<AudioObject>(_soundsAdditionalAudioObjectEntryIndex);
194 sampleIndex -= EnumValue(SoundId::liftRMC);
195 }
196 else
197 {
198 audioObject = objManager.GetLoadedObject<AudioObject>(_soundsAudioObjectEntryIndex);
199 }
200 return std::make_tuple(audioObject, sampleIndex);
201 }
202
203 static void Play(IAudioSource* audioSource, int32_t volume, int32_t pan)
204 {

Callers 3

Play3DFunction · 0.85
PlayFunction · 0.85
CreateAudioChannelFunction · 0.85

Calls 2

GetContextFunction · 0.85
EnumValueFunction · 0.85

Tested by

no test coverage detected