Jump to content

Star Wars: DroidWorks - audio from .san videos (ANIM identifier)


Recommended Posts

  • Engineer

Just wrote a quick-n-dirty audio extractor for this video format. I'm unfamiliar with the resulting audio format, but I can make out snippets when imported as 8bit unsigned PCM, so it has to be some PCM derivative.

Somehow the character distribution looks familiar, but I can't recall what it belongs to. Maybe Yamaha?

image.thumb.png.af307079e7c37b0e7732602f897a83d9.png

What's off-putting is that list at the end of these:

image.png.538d4c8f1e558400f8839982d275b0ef.png

Also, those san movies have a strange header section before the first frame that I can't see what type of data it even holds:

image.thumb.png.57a428385785a7f0ea924b1a8c214d93.png

I've attached two samples and the raw audio extraction script.

Any help is welcome.

san.7z

Edited by AlphaTwentyThree
Link to comment
Share on other sites

  • 2 weeks later...
On 3/10/2024 at 8:38 AM, AlphaTwentyThree said:

Huh, really nobody? Quite a surprise to me actually if I'm being honest, given that those games are 20+ years old already. You would think that the format is well-known by now. 🤔

Yeah, the format is known.  It has some slight compression/encoding, but there doesn't seem to be any decoders I could find.  I've been experimenting with writing my own.  Still not complete yet, but here's a example of some decoded audio so far.  It sounds correct, but I need to do some more testing.

 

refintro.zip

  • Thanks 1
Link to comment
Share on other sites

  • Engineer

Oh, didn't know it's actually its own format, I thought I've seen the .san extension in multiple games over the decades.

Thanks a lot for your work on this, pretty nifty! Dumb question: if you get it working safely, wouldn't it also be pretty easy to add to vgmstream? 🤔

Also, I'd be interested in hearing if my script correctly pulls out the audio since that might be used as a basis to play the movie's audio natively as well as for playing the non-demuxed videos (like with bik and thp).

Link to comment
Share on other sites

It's not really it's own audio format, just part of the SAN videos, so I'm not sure if they would add it to Vgmstream.  For IACT, it's just PCM16 with some slight encoding, so I've just saved them as .wav files.  I don't think there's a header you can put on the raw encoded data to make it play, not that I've found.

To pull out the initial audio, it combines all of the IACT blocks first - there are 0x1a bytes of header and then the audio block data in each IACT chunk.  It's odd because some of these audio blocks start in one IACT chunk and continue in the next.

I've attached my Python script for this one.  It works on all of the Droidworks SAN files.  There are other games with these SAN files that use different audio types, so I might add support for those as well.

 

 

san.zip

  • Like 1
Link to comment
Share on other sites

  • Engineer
On 3/13/2024 at 8:41 PM, DKDave said:

It's not really it's own audio format, just part of the SAN videos, so I'm not sure if they would add it to Vgmstream.  For IACT, it's just PCM16 with some slight encoding, so I've just saved them as .wav files.  I don't think there's a header you can put on the raw encoded data to make it play, not that I've found.

To pull out the initial audio, it combines all of the IACT blocks first - there are 0x1a bytes of header and then the audio block data in each IACT chunk.  It's odd because some of these audio blocks start in one IACT chunk and continue in the next.

I've attached my Python script for this one.  It works on all of the Droidworks SAN files.  There are other games with these SAN files that use different audio types, so I might add support for those as well.

 

 

san.zip 1.44 kB · 2 downloads

This is pretty amazing I have to say, thanks a lot! If you take a look at what my script does, how would that need to change to properly "demux" san videos?

What I'm thinking about doing:

  • get the demuxer to a state where it includes all the data from the SAN files needed to decode the audio, i.e. kind of the "pure" audio data
  • check other SAN files and potentially expand the demuxer
  • when enough variants are gathered, suggest support to be added for vgmstream with the nice information you already gathered

Looking at older formats like THP, those "demuxers" just remove the video portion from the file and leave the extension as is for a decoder (or player) to work with them. The issue is that I'm completely unfamiliar with Python (yet), so I'm pretty lost in any code. If you still have the motivation, I'd be happy to get a quick run-down of the format so I can adjust my demuxer accordingly. The goal would be a SAN file that only includes the audio data, so it makes sense to just keep the IACT headers intact I guess.

Happy to get a DM here or if you contact me on Discord (`alpha_twentythree`)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...