SampleHeader.fromReader constructor

SampleHeader.fromReader(
  1. BinaryReader reader
)

Implementation

factory SampleHeader.fromReader(BinaryReader reader)
{
    String name = reader.readFixedLengthString(20);
    int start = reader.readInt32();
    int end = reader.readInt32();
    int startLoop = reader.readInt32();
    int endLoop = reader.readInt32();
    int sampleRate = reader.readInt32();
    int originalPitch = reader.readUInt8();
    int pitchCorrection = reader.readInt8();
    int link = reader.readUInt16();
    SampleType type = sampleTypeFromInt(reader.readUInt16());

    return SampleHeader(
        name: name,
        start: start,
        end: end,
        startLoop: startLoop,
        endLoop: endLoop,
        sampleRate: sampleRate,
        originalPitch: originalPitch,
        pitchCorrection: pitchCorrection,
        link: link,
        type: type
    );
}