Last active
August 29, 2015 13:57
-
-
Save CapsAdmin/9809922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local pack = vpk.Open(steam.GetInstallPath() .. "/steamapps/common/GarrysMod/sourceengine/hl2_sound_vo_english_dir.vpk") | |
vfs.Mount({ | |
id = "test", | |
root = "", | |
callback = function(type, path, ...) | |
if type == "find" then | |
path = path:sub(2) | |
path = path .. "/" | |
return pack:Find(path) | |
elseif type == "open" then | |
path = path:sub(2) | |
local file = vfs.CreateDummyFile() | |
local done = false | |
function file:OnRead(type, bytes) | |
if type == "all" or true --[[wip]] then | |
if not done then | |
done = true | |
return ffi.string(pack:Read(path)) | |
end | |
end | |
end | |
return file | |
else | |
print(type, path, ...) | |
end | |
end | |
}) | |
local snd = Sound("sound/vo/breencast/br_overwatch08.wav") | |
snd:Play() | |
table.print(snd.decode_info) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment