Initial working version
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
import { IGetToken } from "strtok3/lib/core";
|
||||
/**
|
||||
* "EA IFF 85" Standard for Interchange Format Files
|
||||
* Ref: http://www.martinreddy.net/gfx/2d/IFF.txt
|
||||
*/
|
||||
export interface IChunkHeader {
|
||||
/**
|
||||
* A chunk ID (ie, 4 ASCII bytes)
|
||||
*/
|
||||
chunkID: string;
|
||||
/**
|
||||
* Number of data bytes following this data header
|
||||
*/
|
||||
chunkSize: number;
|
||||
}
|
||||
/**
|
||||
* "EA IFF 85" Standard for Interchange Format Files
|
||||
* Ref: http://www.martinreddy.net/gfx/2d/IFF.txt
|
||||
*/
|
||||
export interface IChunkHeader64 {
|
||||
/**
|
||||
* A chunk ID (ie, 4 ASCII bytes)
|
||||
*/
|
||||
chunkID: string;
|
||||
/**
|
||||
* Number of data bytes following this data header
|
||||
*/
|
||||
chunkSize: bigint;
|
||||
}
|
||||
/**
|
||||
* Common AIFF chunk header
|
||||
*/
|
||||
export declare const Header: IGetToken<IChunkHeader>;
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Header = void 0;
|
||||
const FourCC_1 = require("../common/FourCC");
|
||||
const Token = require("token-types");
|
||||
/**
|
||||
* Common AIFF chunk header
|
||||
*/
|
||||
exports.Header = {
|
||||
len: 8,
|
||||
get: (buf, off) => {
|
||||
return {
|
||||
// Chunk type ID
|
||||
chunkID: FourCC_1.FourCcToken.get(buf, off),
|
||||
// Chunk size
|
||||
chunkSize: Number(BigInt(Token.UINT32_BE.get(buf, off + 4)))
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user