开源方法提取文明6 OST

开源方法提取文明6 OST

社蕙 903 2022-10-20

开源大法好!——提取ogg

今天惊闻他妈的Apple Music的VA-11的专辑没了,之前Civilization VI基础的专辑不见了我还觉得奇怪。这下好了,在线音乐平台没一个靠得住的,以后喜欢的音乐还是存下来为妙他妈的。

参考:https://gist.github.com/YoRyan/e581d5cf81b11e8d411223b917571d42

# To run in the PowerShell ISE, first execute:
# > Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted
# on the interactive console.

$OutputPath = "."
# Path to directory containing ww2ogg executable and codebook - https://github.com/hcs64/ww2ogg
$Ww2OggPath = ".\ww2ogg024\"
# Path to revorb executable - https://hydrogenaud.io/index.php/topic,64328.msg574110.html#msg574110
$RevorbExec = ".\revorb.exe"
# Path to Civ 6 ;)
$Civ6Path = "D:\SteamLibrary\steamapps\common\Sid Meier's Civilization VI"


function Extract-Sound-Bank ($bank_path, $bank_guid, $out_path)
{
    New-Item -ItemType directory -Path $out_path -Force
    foreach ($node in (Select-Xml -Path $bank_path -XPath "//SoundBank[@GUID='$bank_guid']/ReferencedStreamedFiles/File").Node) {
        $wem_filename = "$($node.Attributes['Id'].Value).wem"
        $track_name = $node["ShortName"].InnerText.TrimEnd(".wav")
        Extract-Track "$(Split-Path $bank_path)\$wem_filename" "$out_path\$track_name"
    }
}

function Extract-Track ($input_wem, $output_basename)
{
    $ogg = "$($output_basename).ogg"
    & "$Ww2OggPath\ww2ogg.exe" $input_wem -o $ogg --mod-packets --pcb "$Ww2OggPath\packed_codebooks_aoTuV_603.bin"
    & $RevorbExec $ogg
}

Extract-Sound-Bank "$Civ6Path\Base\Platforms\Windows\audio\Music_Bank.xml" `
                   "{AD4D06FD-95CA-42CD-9536-9ADB0555E7E1}" "$OutputPath\Base Game"
Extract-Sound-Bank "$Civ6Path\DLC\Expansion1\platforms\windows\audio\XP1_Music_Bank.xml" `
                   "{35A96671-6E7A-47C1-8182-B9C013C814A5}" "$OutputPath\Rise and Fall"
Extract-Sound-Bank "$Civ6Path\DLC\Expansion2\platforms\windows\audio\XP2_Music_Bank.xml" `
                   "{1CFDCA39-4887-4B25-A73D-83CB57253F42}" "$OutputPath\Gathering Storm"

按照脚本的注释将各项路径设置完成,一切就成功的跑起来了。也许能研究一下把其他的OST捣鼓好。

开源大法好!——播放ogg

https://github.com/digimezzo/dopamine

多巴胺播放器,目前开源更新中,虽然很多功能都没做完,但是——比微软那逼Groove音乐好一万倍,解码都能卡我是真的无语。

其他的资源

游民星空

https://down.gamersky.com/pc/201610/825618.shtml

  • 【音乐】《文明6》游戏原声音乐OST+25周年原声音乐OST1.01 GB
  • 【音乐】《文明6:风云变幻》游戏官方原声音乐OST

Wakelet

其实我完全不知道这是什么鸟网站

{DOWNLOAD} Various Artists - Sid Meier’s Civilization VI: Rise & Fall {ALBUM MP3 ZIP}