2025-03-18 18:46:09 +11:00
--[[
https : // github.com / overextended / ox_lib
This file is licensed under LGPL - 3.0 or higher < https : // www.gnu . org / licenses / lgpl - 3.0 . en.html >
2025-03-29 21:44:03 +11:00
Copyright © 2025 Linden < https : // github.com / thelindat >
2025-03-18 18:46:09 +11:00
] ]
2024-04-03 14:55:10 +11:00
---Loads an audio bank.
2024-04-03 04:48:08 +01:00
---@param audioBank string
---@param timeout number?
2024-04-03 14:55:10 +11:00
---@return string
2024-04-03 04:48:08 +01:00
function lib . requestAudioBank ( audioBank , timeout )
return lib.waitFor ( function ( )
2024-04-03 14:55:10 +11:00
if RequestScriptAudioBank ( audioBank , false ) then return audioBank end
2024-10-06 03:25:17 +11:00
end , ( " failed to load audiobank '%s' - this may be caused by \n - too many loaded assets \n - oversized, invalid, or corrupted assets " ) : format ( audioBank ) , timeout or 30000 )
2024-04-03 04:48:08 +01:00
end
2024-04-03 14:55:10 +11:00
return lib.requestAudioBank