Add VAG struct

ABelliqueux 2021-08-14 14:54:12 +02:00
parent 200ceb1c6f
commit ffafc7a5fd

19
VAG.md

@ -28,6 +28,25 @@ wav2vag tmp.dat output.vag -sraw16 -freq=44100
You can find a graphical editor in the [PsyQ sdk](http://psx.arthus.net/sdk/Psy-Q/PSYQ_SDK.zip) named `VAGEDIT.exe`.
## C VAG structure
Here is a structure definition to access the VAG header :
See [FileFormat47.pdf](http://psx.arthus.net/sdk/Psy-Q/DOCS/FileFormat47.pdf), p.209 for full description.
```c
typedef struct VAGhdr { // All the values in this header must be big endian
char id[4]; // VAGp 4 bytes -> 1 char * 4
unsigned int version; // 4 bytes
unsigned int reserved; // 4 bytes
unsigned int dataSize; // (in bytes) 4 bytes
unsigned int samplingFrequency; // 4 bytes
char reserved2[12]; // 12 bytes -> 1 char * 12
char name[16]; // 16 bytes -> 1 char * 16
// Waveform data after that
} VAGhdr;
```
## VAG & SPU Docs
See