Package org.apache.poi.hslf.record
Class Sound
java.lang.Object
org.apache.poi.hslf.record.Record
org.apache.poi.hslf.record.RecordContainer
org.apache.poi.hslf.record.Sound
A container holding information about a sound. It contains:
1. CString (4026), Instance 0: Name of sound (e.g. "crash")
2. CString (4026), Instance 1: Type of sound (e.g. ".wav")
3. CString (4026), Instance 2: Reference id of sound in sound collection
4. CString (4026), Instance 3, optional: Built-in id of sound, for sounds we ship. This is the id that?s in the reg file.
5. SoundData (2023), optional
- Author:
- Yegor Kozlov
-
Field Summary
Fields inherited from class org.apache.poi.hslf.record.RecordContainer
_children -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSound(byte[] source, int start, int len) Set things up, and find our more interesting children -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the type (held as a little endian in bytes 3 and 4) that this class handles.byte[]The sound dataName of the sound (e.g.Type of the sound (e.g.voidwriteOut(OutputStream out) Have the contents printer out into an OutputStream, used when writing a file back out to disk.Methods inherited from class org.apache.poi.hslf.record.RecordContainer
addChildAfter, addChildBefore, appendChildRecord, findFirstOfType, getChildRecords, handleParentAwareRecords, isAnAtom, moveChildBefore, moveChildrenAfter, moveChildrenBefore, removeChild, setChildRecord, writeOutMethods inherited from class org.apache.poi.hslf.record.Record
buildRecordAtOffset, createRecordForType, findChildRecords, writeLittleEndian, writeLittleEndian
-
Constructor Details
-
Sound
protected Sound(byte[] source, int start, int len) Set things up, and find our more interesting children- Parameters:
source- the source data as a byte array.start- the start offset into the byte array.len- the length of the slice in the byte array.
-
-
Method Details
-
getRecordType
public long getRecordType()Returns the type (held as a little endian in bytes 3 and 4) that this class handles.- Specified by:
getRecordTypein classRecord- Returns:
- the record type.
-
writeOut
Have the contents printer out into an OutputStream, used when writing a file back out to disk.- Specified by:
writeOutin classRecord- Parameters:
out- the output stream.- Throws:
IOException- if there was an error writing to the stream.
-
getSoundName
Name of the sound (e.g. "crash")- Returns:
- name of the sound
-
getSoundType
Type of the sound (e.g. ".wav")- Returns:
- type of the sound
-
getSoundData
public byte[] getSoundData()The sound data- Returns:
- the sound data.
-