How to use the token-types.INT16_BE function in token-types

To help you get started, we’ve selected a few token-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Borewit / music-metadata / lib / mp4 / AtomToken.ts View on Github external
get(buf: Buffer, off: number): ISoundSampleDescriptionVersion {
    return {
      version: Token.INT16_BE.get(buf, off),
      revision: Token.INT16_BE.get(buf, off + 2),
      vendor: Token.INT32_BE.get(buf, off + 4)
    };
  }
};
github Borewit / music-metadata / lib / mp4 / AtomToken.ts View on Github external
get(buf: Buffer, off: number): ISoundSampleDescriptionV0 {
    return {
      numAudioChannels: Token.INT16_BE.get(buf, off + 0),
      sampleSize: Token.INT16_BE.get(buf, off + 2),
      compressionId: Token.INT16_BE.get(buf, off + 4),
      packetSize: Token.INT16_BE.get(buf, off + 6),
      sampleRate: Token.UINT16_BE.get(buf, off + 8) + Token.UINT16_BE.get(buf, off + 10) / 10000
    };
  }
};
github Borewit / music-metadata / lib / mpeg / MpegParser.ts View on Github external
private async parseCrc(): Promise {
    this.crc = await this.tokenizer.readNumber(Token.INT16_BE);
    this.offset += 2;
    return this.skipSideInformation();
  }