Skip to content

Instantly share code, notes, and snippets.

@CapsAdmin
Last active August 29, 2015 13:57
Show Gist options
  • Save CapsAdmin/9809922 to your computer and use it in GitHub Desktop.
Save CapsAdmin/9809922 to your computer and use it in GitHub Desktop.
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