Alternatively, you can use the windows tool [`MC32.EXE`](https://psx.arthus.net/tools/pimp-psx.zip) to interleave several PSX media files.
### Compile
This will compile and build an iso image :
```bash
make
```
### Clean directory
```bash
make cleansub
```
## Encoding to XA
You can use a modified version of [`psxavenc`](https://github.com/ABelliqueux/candyk-psx/tree/master/toolsrc/psxavenc) to convert your audio file to a 2336 bytes XA file :
-b bitdepth Use specified bit depth (only 4 bits supported)
-c channels Use specified channel count (1 or 2)
-F num [.xa] Set the file number to num (0-255)
-C num [.xa] Set the channel number to num (0-31)
```
## Interleaving XA files
You can use [`MC32.EXE`](https://psx.arthus.net/tools/pimp-psx.zip) or [`xainterleave`](https://github.com/ABelliqueux/candyk-psx/tree/master/toolsrc/xainterleave) to interleave several PSX media files.
## xainterleave usage
`xainterleave <mode> <in.txt> <out.raw>`
`mode` can be 0 for full raw sectors or 1 for just XA (divisible by 2336)
Example for 1 music file, to be played at 1x CD speed (4 channels):
```
1 xa test.xa 1 0
1 null
1 null
1 null
```
Add 4 more 1 null lines for 2x (8 channels).
```
1 xa menu.xa 1 0
sectors type file xa_file number (0-255) xa_channel number (0-31)
```
The format seems to correspond to the [entry_t struct](https://github.com/ABelliqueux/candyk-psx/blob/db71929903cc09398f5efc23973f9e136d123bbb/toolsrc/xainterleave/xainterleave.c#L35).
## mkpsxiso
You can use the following syntax to include your XA file in the CD image :