All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.jarnbjo.vorbis.SetupHeader Maven / Gradle / Ivy

The newest version!
/*
 * $ProjectName$
 * $ProjectRevision$
 * -----------------------------------------------------------
 * $Id: SetupHeader.java,v 1.2 2003/03/16 01:11:12 jarnbjo Exp $
 * -----------------------------------------------------------
 *
 * $Author: jarnbjo $
 *
 * Description:
 *
 * Copyright 2002-2003 Tor-Einar Jarnbjo
 * -----------------------------------------------------------
 *
 * Change History
 * -----------------------------------------------------------
 * $Log: SetupHeader.java,v $
 * Revision 1.2  2003/03/16 01:11:12  jarnbjo
 * no message
 *
 *
 */
 
package de.jarnbjo.vorbis;

import java.io.IOException;

import de.jarnbjo.util.io.BitInputStream;

public class SetupHeader {

   private static final long HEADER = 0x736962726f76L; // 'vorbis'

   private CodeBook[] codeBooks;
   private Floor[] floors;
   private Residue[] residues;
   private Mapping[] mappings;
   private Mode[] modes;

   public SetupHeader(VorbisStream vorbis, BitInputStream source) throws VorbisFormatException, IOException {

      if(source.getLong(48)!=HEADER) {
         throw new VorbisFormatException("The setup header has an illegal leading.");
      }

      // read code books

      int codeBookCount=source.getInt(8)+1;
      codeBooks=new CodeBook[codeBookCount];

      for(int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy