MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Source_Add

Method Source_Add

Source/Engine/Audio/OpenAL/AudioBackendOAL.cpp:350–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350uint32 AudioBackendOAL::Source_Add(const AudioDataInfo& format, const Vector3& position, const Quaternion& orientation, float volume, float pitch, float pan, bool loop, bool spatial, float attenuation, float minDistance, float doppler)
351{
352 PROFILE_MEM(Audio);
353 uint32 sourceID = 0;
354 ALC::Source::Rebuild(sourceID, position, orientation, volume, pitch, pan, loop, spatial, attenuation, minDistance, doppler);
355 if (sourceID)
356 {
357 // Cache audio data format assigned on source (used in Source_GetCurrentBufferTime)
358 ALC::Locker.Lock();
359 auto& data = ALC::SourcesData[sourceID];
360 data.Format = format;
361 data.Spatial = spatial;
362 data.Pan = pan;
363 ALC::Locker.Unlock();
364 }
365 return sourceID;
366}
367
368void AudioBackendOAL::Source_Remove(uint32 sourceID)
369{

Callers

nothing calls this directly

Calls 3

RebuildFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected