Thealexbarney / VGAudio

A library for encoding, decoding, and manipulating audio files from video games.
MIT License
219 stars 37 forks source link

How do you correctly use the library? (specifically to decode ADX to PCM byte array) #112

Open TorutheRedFox opened 4 years ago

Thealexbarney commented 4 years ago

This would be one easy way to get a wave file:

byte[] adxFile;

AudioData audio = new AdxReader().Read(adxFile);
byte[] waveFile = new WaveWriter().GetFile(audio);

Or to get the PCM data:

var pcm16 = audio.GetFormat<Pcm16Format>();
short[][] channels = pcm16.Channels;
TorutheRedFox commented 4 years ago

thx

TorutheRedFox commented 4 years ago

although, I'm using this in Unity, and Unity requires it to be as one byte array (even when data is stereo)

TorutheRedFox commented 4 years ago

just saying, it comes out waay too loud