2020-12-22 12:38:06 +01:00
# VAG files
> VAG is the PlayStation single waveform data format for ADPCM-encoded data of sampled sounds, such as
piano sounds, explosions, and music. The typical extension in DOS is “.VAG”.
2020-12-22 12:39:47 +01:00
See [FileFormat47.pdf ](http://psx.arthus.net/sdk/Psy-Q/DOCS/FileFormat47.pdf ), p.209
2020-12-22 12:38:06 +01:00
2021-08-14 11:46:28 +02:00
## Audio to VAG conversion
2020-12-22 12:38:06 +01:00
2021-08-14 11:46:28 +02:00
We have to convert the audio file to RAW data first :
2020-12-22 12:38:06 +01:00
```bash
2021-08-14 11:46:28 +02:00
ffmpeg -i input.mp3 -f s16le -ac 1 -ar 44100 tmp.dat
2020-12-22 12:38:06 +01:00
```
2021-08-14 11:46:28 +02:00
then use [`wav2vag` ](https://github.com/ColdSauce/psxsdk/blob/master/tools/wav2vag.c ) to convert the data, making sure the `-freq=` parameter matches the `-ar` value used above :
2020-12-22 12:38:06 +01:00
```bash
2021-08-14 11:46:28 +02:00
wav2vag tmp.dat output.vag -sraw16 -freq=44100
2020-12-22 12:38:06 +01:00
```
2021-07-20 18:44:27 +02:00
## VAGedit
You can find a graphical editor in the [PsyQ sdk ](http://psx.arthus.net/sdk/Psy-Q/PSYQ_SDK.zip ) named `VAGEDIT.exe` .
2020-12-22 12:38:06 +01:00
## VAG & SPU Docs
See
* libformat47.pdf p.209
* libover47.pdf, p.271
* libref47.pdf, p.980
* [http://psx.arthus.net/code/VAG/ ](http://psx.arthus.net/code/VAG )
2021-08-14 11:46:28 +02:00
## Ressources
* [wav2vag utility ](https://github.com/ColdSauce/psxsdk/blob/master/tools/wav2vag.c )