ADX player library?

Discussion in 'Technical Discussion' started by MainMemory, May 7, 2014.

Thread Status:
Not open for further replies.
  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,586
    190
    43
    SonLVL
    For a long time now, I've been wanting to mod the PC version of Sonic Adventure DX to play music in looped ADX format, rather than WMA. I finally understand enough of how SADX interfaces with Windows Media Player that I think I could replace or supplement it, but looking at vgmstream, I have no idea how it works, or for that matter how DirectSound or any other audio library works.

    I just need something that can load an ADX file (other formats optional) and play, pause, resume and stop. It doesn't even have to be open source.
     
  2. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    18,517
    505
    93
    Berkshire, England
    Learning Cymraeg
    http://www.hcs64.com/vgmstream.html may or may not help - it's open source, and it does a load of different formats, but it's also plugins for existing media players so not sure if it's any use.
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,586
    190
    43
    SonLVL
    Perhaps you missed the part where I said I had looked at vgmstream already and couldn't figure it out?
     
  4. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    18,517
    505
    93
    Berkshire, England
    Learning Cymraeg
    Frig, I'm an idiot. Disregard then =P
     
  5. Herm the Germ

    Herm the Germ

    Hmm, not bad. Well done, doctor! Member
    1,482
    0
    0
    Dresden, Saxony, Germany
    MIDI-to-SMPS-conversions, mostly. Takin' requests, too.
    I found SWAT's old ADX Tool pack in a folder on my hard drive, along with some additional files I didn't sort out; maybe that'll be of some help?
     
  6. Sappharad

    Sappharad

    Oldbie
    1,395
    66
    28
    I wrote this for Gamecube, but it's ridiculously simple such that you'll be able to use it:
    http://projects.sappharad.com/gcn/adxlib.c

    Based on ADX2WAV, which I may still have the code for if you want me to dig for it. I used it in the Gamecube Disc Browser for it's ADX player.

    I also have Java and C# ports of ADX code, if you'd rather have me dig that up. (If I can find it)
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,586
    190
    43
    SonLVL
    Unfortunately that code doesn't have anything for outputting sound on Windows which is half of my problem. ADX2WAV probably wouldn't help, and Java or C# code would only help if it contained DirectSound code that I could port to C++. I might be able to use the version of vgmstream that angryzor made for the S&KC HQ music hack using BASS, I'm not sure.
     
  8. Sappharad

    Sappharad

    Oldbie
    1,395
    66
    28
    But that's the easy part. The most complex part of any ADX player is the decoder, if you want to play it you just write the stream out to whatever sound library you want to use.
    http://stackoverflow.com/questions/4019733/which-api-should-I-use-for-playing-audio-on-windows

    You'll find plenty of samples on how to do this. It's all basically the same... initialize, fill the buffer, start playing, and when the buffer gets low add more to it. Even if you don't find a RAW example, a WAV example is practically the same thing, you just don't need to worry about parsing the header.
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,586
    190
    43
    SonLVL
    Well I got a test program running with BASS + vgmstream so at this point any problems I encounter will likely be with SADX itself, which none of you are likely to be able to help with.
     
Thread Status:
Not open for further replies.