Class RawWriter
java.lang.Object
javaforce.codec.speex.AudioFileWriter
javaforce.codec.speex.RawWriter
Raw Audio File Writer.
- Version:
- $Revision$
- Author:
- Marc Gimpel, Wimba S.A. ([email protected])
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the output file.voidOpen the output file.voidOpen the output file.voidwriteHeader(String comment) Writes the header pages that start the Ogg Speex file.voidwritePacket(byte[] data, int offset, int len) Writes a packet of audio.Methods inherited from class AudioFileWriter
buildOggPageHeader, buildSpeexComment, buildSpeexHeader, writeInt, writeInt, writeInt, writeLong, writeLong, writeOggPageHeader, writeShort, writeShort, writeShort, writeSpeexComment, writeSpeexHeader, writeStringModifier and TypeMethodDescriptionstatic byte[]buildOggPageHeader(int headerType, long granulepos, int streamSerialNumber, int pageCount, int packetCount, byte[] packetSizes) Builds and returns an Ogg Page Header.static byte[]buildSpeexComment(String comment) Builds and returns a Speex Comment.static byte[]buildSpeexHeader(int sampleRate, int mode, int channels, boolean vbr, int nframes) Builds a Speex Header.static voidwriteInt(byte[] data, int offset, int v) Writes a Little-endian int.static voidwriteInt(DataOutput out, int v) Writes a Little-endian int.static voidwriteInt(OutputStream os, int v) Writes a Little-endian int.static voidwriteLong(byte[] data, int offset, long v) Writes a Little-endian long.static voidwriteLong(OutputStream os, long v) Writes a Little-endian long.static intwriteOggPageHeader(byte[] buf, int offset, int headerType, long granulepos, int streamSerialNumber, int pageCount, int packetCount, byte[] packetSizes) Writes an Ogg Page Header to the given byte array.static voidwriteShort(byte[] data, int offset, int v) Writes a Little-endian short.static voidwriteShort(DataOutput out, short v) Writes a Little-endian short.static voidwriteShort(OutputStream os, short v) Writes a Little-endian short.static intwriteSpeexComment(byte[] buf, int offset, String comment) Writes a Speex Comment to the given byte array.static intwriteSpeexHeader(byte[] buf, int offset, int sampleRate, int mode, int channels, boolean vbr, int nframes) Writes a Speex Header to the given byte array.static voidwriteString(byte[] data, int offset, String v) Writes a String.
-
Constructor Details
-
RawWriter
public RawWriter()
-
-
Method Details
-
close
Closes the output file.- Specified by:
closein classAudioFileWriter- Throws:
IOException- if there was an exception closing the Audio Writer.
-
open
Open the output file.- Specified by:
openin classAudioFileWriter- Parameters:
file- - file to open.- Throws:
IOException- if there was an exception opening the Audio Writer.
-
open
Open the output file.- Specified by:
openin classAudioFileWriter- Parameters:
filename- - file to open.- Throws:
IOException- if there was an exception opening the Audio Writer.
-
writeHeader
Writes the header pages that start the Ogg Speex file. Prepares file for data to be written.- Specified by:
writeHeaderin classAudioFileWriter- Parameters:
comment- description to be included in the header.- Throws:
IOException
-
writePacket
Writes a packet of audio.- Specified by:
writePacketin classAudioFileWriter- Parameters:
data- audio dataoffset- the offset from which to start reading the data.len- the length of data to read.- Throws:
IOException
-