{"id":541,"date":"2008-04-04T19:24:14","date_gmt":"2008-04-05T03:24:14","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/solid-snake-oggs\/"},"modified":"2008-04-04T19:40:04","modified_gmt":"2008-04-05T03:40:04","slug":"solid-snake-oggs","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/solid-snake-oggs\/","title":{"rendered":"Solid Snake Oggs"},"content":{"rendered":"<p>I was studying a file called vox.dat scavenged from the <a href=\"http:\/\/www.mobygames.com\/game\/gamecube\/metal-gear-solid-the-twin-snakes\">GameCube version of Metal Gear Solid: The Twin Snakes<\/a>, the seminal, tactical, tip-toeing game starring <a href=\"http:\/\/en.wikipedia.org\/wiki\/Solid_Snake\">Solid Snake<\/a>. The file contains a lot of multi-lingual subtitle strings as well as the actual English speech recited along with the subtitle presentation. What format does this commercial game use? Would you believe Ogg Vorbis? The constituent audio streams are all tagged with the string &#8220;Xiph.Org libVorbis I 20020717&#8221;, which is quite old. The current version of the Xiph&#8217;s ogg123 playback tool does not decode a stream properly. Some of the data is audible, but a lot of audio chunks are skipped. <a href=\"http:\/\/ffmpeg.org\/\">FFmpeg<\/a> fares a little bit better but still scrambles some audio.<\/p>\n<p><center><br \/>\n<a href=\"http:\/\/www.mobygames.com\/game\/gamecube\/metal-gear-solid-the-twin-snakes\"><img decoding=\"async\" src=\"\/eggs\/images\/metal-gear-solid-logo.jpg\" alt=\"Metal Gear Solid logo\" border=\"0\" \/><\/a><br \/>\n<\/center><\/p>\n<p>Is this a case of poor backwards compatibility? Or perhaps the creators &#8212; <a href=\"http:\/\/www.siliconknights.com\/\">Silicon Knights<\/a> &#8212; deliberately monkeyed with the bitstream? I found that last situation a bit implausible as I assumed developers would treat this third party codec stuff as a black box. But as an experiment, let&#8217;s go back in time, courtesy of Xiph&#8217;s source control:<\/p>\n<pre>\r\nsvn co -r {20020717} http:\/\/svn.xiph.org\/trunk\/ogg ogg-svn\r\nsvn co -r {20020717} http:\/\/svn.xiph.org\/trunk\/vorbis vorbis-svn\r\nsvn co -r {20020717} http:\/\/svn.xiph.org\/trunk\/vorbis-tools vorbis-tools-svn\r\n<\/pre>\n<p>I removed all of the related components on my system for good measure. With a little persistence and a <em>lot<\/em> of disabled options while building the tool set, I was finally able to get the components to build. Those old tools still have the same trouble with these Ogg Vorbis files:<\/p>\n<pre>\r\n$ oggdec mgs1-sample1.ogg\r\nOggDec 1.0\r\nDecoding \"mgs1-sample1.ogg\" to \"mgs1-sample1.wav\"\r\n        [  1.5%]Warning: hole in data\r\n        [  4.5%]Warning: hole in data\r\n        [  6.5%]Warning: hole in data\r\n[...]\r\n        [127.5%]Warning: hole in data\r\n        [130.5%]Warning: hole in data\r\n        [132.5%]Warning: hole in data\r\n        [134.5%]\r\n<\/pre>\n<p>Or maybe the tool is just extremely capable if it can decode more than 130% of the file.<\/p>\n<p>I have placed three manually ripped samples in <a href=\"http:\/\/samples.mplayerhq.hu\/ogg\/Vorbis\/MetalGearSolid\/\">the archive; each is 512 KB<\/a>. I would start ripping at offsets where I saw an &#8216;OggS&#8217; marker that was followed soon after by the libVorbis ID string. If you care enough, have a look. And to what end? Isn&#8217;t it obvious? To create a &#8220;Learn English With Solid Snake And Friends&#8221; application.<\/p>\n<p><center><br \/>\n<a href=\"http:\/\/www.mobygames.com\/game\/gamecube\/metal-gear-solid-the-twin-snakes\"><img decoding=\"async\" src=\"\/eggs\/images\/solid-snake-liquid-snake.jpg\" alt=\"Solid Snake and Liquid Snake\" border=\"0\" \/><\/a><br \/>\n<\/center><\/p>\n<p>Learn handy, everyday phrases like, <em>&#8220;I&#8217;m no rookie!&#8221;<\/em> and <em>&#8220;Don&#8217;t think! Shoot!&#8221;<\/em> English speakers will be able to learn the same phrases in other languages, though they won&#8217;t have the benefit of pronunciation.<\/p>\n<p>I&#8217;m still working out the details of the vox.dat file format. I have some things sorted out. Perhaps readers who know German, French, Italian, or Spanish, and who understand non-ASCII character encodings can answer whether these schemes fit any well-known encodings (I know that the 0x0A is a line break in the subtitle):<\/p>\n<pre>\r\n             53 70 72 69  63 68 20 6E  69 63 68 74      Sprich nicht\r\n20 7A 75 20  6D 69 72 20  77 69 65 20  7A 75 0A 65   zu mir wie zu.e\r\n69 6E 65 6D  20 41 6E 66  1F 0B 6E 67  65 72 21     inem Anf..nger!\r\n\r\n             4C 61 20 66  65 72 6D 65  2C 20 6C 1F      La ferme, l.\r\n09 2D 64 65  64 61 6E 73  20 21                     .-dedans !\r\n\r\n             5A 69 74 74  6F 20 6C 1F  09 20 64 65      Zitto l.. de\r\n6E 74 72 6F  21                                     ntro!\r\n\r\n             1F 42 1F 42  41 20 71 75  1F 0F 20 65       .B.BA qu.. e\r\n73 74 1F 08  73 20 65 73  70 65 72 61  6E 64 6F 21  st..s esperando!\r\n21 0A 1F 42  1F 42 44 69  73 70 61 72  61 21 21     !..B.BDispara!!\r\n<\/pre>\n<p>Empirical analysis simply implies that a character 0x1F is followed immediately by a character not in the standard ASCII set.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was studying a file called vox.dat scavenged from the GameCube version of Metal Gear Solid: The Twin Snakes, the seminal, tactical, tip-toeing game starring Solid Snake. The file contains a lot of multi-lingual subtitle strings as well as the actual English speech recited along with the subtitle presentation. What format does this commercial game [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-541","post","type-post","status-publish","format-standard","hentry","category-game-hacking"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":0,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/541\/revisions"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}