News:

11 March 2016 - Forum Rules

Main Menu

Henke37's SDAT reader

Started by henke37, March 05, 2011, 03:10:32 PM

Previous topic - Next topic

henke37

I've done some work on making a SDAT reader myself. But I gave up rather quickly because I couldn't figure one thing out: how to deal with ADPCM data. All I got out was something that was 99 % ear bleed.

If anyone feels like pointing out my mistake then I would be grateful. But I doubt that I will do a lot of work on this one.

Find the WIP here. It's in actionscript 3.

Low Lines

Wow I didn't know you could open binary files in actionscript :o

Last time I tried decoding the ADPCM I didn't have much luck either. I don't believe it is just straight ADPCM like you would find in a PC audio file, my only resource site that I know of that has had some discussion on the ADPCM is at http://hcs64.com/ but I can't navigate my way around it all too well.

If you have any breakthroughs, let me know, I would love to add full support for SDATs in my project :p

henke37

You'd be amazed what Flash can do these days. Adobe even dropped a developer only WIP release with hardware accelerated 3D rendering this week.

I did see the vgmstream project actually, I even peeked at the source code. While I easily found the relevant code, I sadly didn't gain anything from it.

Also, I did more work on the project today, the download link has been updated.

Auryn

I don't know if it's usefull to u but better post it and u choose :p

It's looking more like GBA
http://gsf.caitsith2.net/


And this is NDS:
http://nocash.emubase.de/gbatek.htm#dssound

Good luck

henke37

Thanks for the links, but I actually already had the later one already.

henke37

Great news, I finally got some help and have gotten the adpcm decoding working properly. The looping/ending logic is still left to clean up, but it works!

Low Lines

Was just having a look at your WIP and I can open up the actionscript files just fine however the fla won't open with Flash CS3. I'll assume my version of Flash is too outdated...curse you yearly non-backwards compatible software updates >_<

Can you include a built swf so the app can be viewed without the need for compiling it?

henke37

#7
The code requires a compiler that can compile for FP 10, CS 3 does not qualify. CS 4 is the minimum version there. As for the FLA, it only links to a document class and does nothing else.

Glad that you asked, because I was about to post something half decent right now actually.

EDIT: Here it is

Low Lines

Dunno about the background color ($_$) but it definitely works :)

henke37

#9
Well, there is still that issue with streams not ending correctly, I wish I could fix that one. It's annoying me.

EDIT: I could have sworn that I had already posted the link to the repository, but here it is.

henke37

Well, I got the mono/stereo bug fixed now.

But I still have one left in the STRM player.

The issue is that my code introduces a noise after the file has reached the loop point. And it is not just a single pop due to an inappropriate seek, but a far more frequent error. I have figured this much:

  • The decoding works perfectly until the loop point
  • The error is an ADPCM predictor corruption, the right samples are still being decoded, but with way wrong amplitude.
  • The error period is closely related to how many samples I decode in each method call.
  • The error is not caused by the resampler.
  • The error happens both for stereo and mono streams.
All my code looks fine, I just can't figure out what is going wrong here. I've been at this for months now. :banghead:

henke37

For those who cares I solved the decoding error long ago and added support for waves from wavebanks while at it.

But I started working on a sequence player yesterday. This one is going to take more than a little time.

henke37

I recently (last month) had a request to export the instruments in a SDAT file.

I made a little tool to do exactly that.

Source code here. Prebuilt AIR app here.