Currently it seems to be:
- loop start sample offset = loop start block index * 0x400
- loop end sample offset = loop end block index * 0x400
The loop header section seems to be interpreted as:
- loop start block index: big endian unsigned 32-bit integer
- loop end block index: big endian unsigned 32-bit integer
- loop cycle count (when it equals to 128 it means infinite): big endian unsigned 16-bit integer
- loop r01 (sorry, but I can't understand what "r01" means): big endian unsigned 16-bit integer
However, according to VGAudio:
https://github.com/Thealexbarney/VGAudio/blob/9d8f6ea04c83cccccb3dd7851a631bbd53a8dbbe/src/VGAudio/Codecs/CriHca/HcaInfo.cs#L35
public int LoopStartSample => LoopStartFrame * 1024 + PreLoopSamples - InsertedSamples;
public int LoopEndSample => (LoopEndFrame + 1) * 1024 - PostLoopSamples - InsertedSamples;
https://github.com/Thealexbarney/VGAudio/blob/9d8f6ea04c83cccccb3dd7851a631bbd53a8dbbe/src/VGAudio/Containers/Hca/HcaReader.cs#L189
private static void ReadLoopChunk(BinaryReader reader, HcaStructure structure)
{
structure.Hca.Looping = true;
structure.Hca.LoopStartFrame = reader.ReadInt32();
structure.Hca.LoopEndFrame = reader.ReadInt32();
structure.Hca.PreLoopSamples = reader.ReadInt16();
structure.Hca.PostLoopSamples = reader.ReadInt16();
structure.Hca.SampleCount = Math.Min(structure.Hca.SampleCount, structure.Hca.LoopEndSample);
}
Currently it seems to be:
The
loopheader section seems to be interpreted as:However, according to VGAudio:
https://github.com/Thealexbarney/VGAudio/blob/9d8f6ea04c83cccccb3dd7851a631bbd53a8dbbe/src/VGAudio/Codecs/CriHca/HcaInfo.cs#L35
https://github.com/Thealexbarney/VGAudio/blob/9d8f6ea04c83cccccb3dd7851a631bbd53a8dbbe/src/VGAudio/Containers/Hca/HcaReader.cs#L189