Files
ox_lib/imports/requestAudioBank/client.lua
T

20 lines
676 B
Lua
Raw Normal View History

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.
---@param audioBank string
---@param timeout number?
2024-04-03 14:55:10 +11:00
---@return string
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
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)
end
2024-04-03 14:55:10 +11:00
return lib.requestAudioBank