org.xiph.speex
Class AudioFileWriter

java.lang.Object
  extended byorg.xiph.speex.AudioFileWriter
Direct Known Subclasses:
OggSpeexWriter, PcmWaveWriter, RawWriter

public abstract class AudioFileWriter
extends java.lang.Object

Abstract Class that defines an Audio File Writer.

Version:
$Revision: 1.2 $
Author:
Marc Gimpel, Wimba S.A. (marc@wimba.com)

Constructor Summary
AudioFileWriter()
           
 
Method Summary
abstract  void close()
          Closes the output file.
abstract  void open(java.lang.String filename)
          Open the output file.
abstract  void writeHeader(java.lang.String comment)
          Writes the header pages that start the Ogg Speex file.
static void writeInt(java.io.DataOutput out, int v)
          Writes a Little-endian int.
static void writeInt(java.io.OutputStream os, int v)
          Writes a Little-endian int.
static void writeLong(java.io.OutputStream os, long v)
          Writes a Little-endian long.
abstract  void writePacket(byte[] data, int offset, int len)
          Writes a packet of audio.
static void writeShort(java.io.DataOutput out, short v)
          Writes a Little-endian short.
static void writeShort(java.io.OutputStream os, short v)
          Writes a Little-endian short.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioFileWriter

public AudioFileWriter()
Method Detail

close

public abstract void close()
                    throws java.io.IOException
Closes the output file.

Throws:
java.io.IOException

open

public abstract void open(java.lang.String filename)
                   throws java.io.IOException
Open the output file.

Parameters:
filename - - file to open.
Throws:
java.io.IOException

writeHeader

public abstract void writeHeader(java.lang.String comment)
                          throws java.io.IOException
Writes the header pages that start the Ogg Speex file. Prepares file for data to be written.

Parameters:
comment - description to be included in the header.
Throws:
java.io.IOException

writePacket

public abstract void writePacket(byte[] data,
                                 int offset,
                                 int len)
                          throws java.io.IOException
Writes a packet of audio.

Parameters:
data - audio data
offset - the offset from which to start reading the data.
len - the length of data to read.
Throws:
java.io.IOException

writeShort

public static void writeShort(java.io.DataOutput out,
                              short v)
                       throws java.io.IOException
Writes a Little-endian short.

Parameters:
out - the data output to write to.
v - value to write.
Throws:
java.io.IOException

writeInt

public static void writeInt(java.io.DataOutput out,
                            int v)
                     throws java.io.IOException
Writes a Little-endian int.

Parameters:
out - the data output to write to.
v - value to write.
Throws:
java.io.IOException

writeShort

public static void writeShort(java.io.OutputStream os,
                              short v)
                       throws java.io.IOException
Writes a Little-endian short.

Parameters:
os - - the output stream to write to.
v - - the value to write.
Throws:
java.io.IOException

writeInt

public static void writeInt(java.io.OutputStream os,
                            int v)
                     throws java.io.IOException
Writes a Little-endian int.

Parameters:
os - - the output stream to write to.
v - - the value to write.
Throws:
java.io.IOException

writeLong

public static void writeLong(java.io.OutputStream os,
                             long v)
                      throws java.io.IOException
Writes a Little-endian long.

Parameters:
os - - the output stream to write to.
v - - the value to write.
Throws:
java.io.IOException


Copyright © 1999-2004 Wimba S.A. All Rights Reserved.