|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.PDFSound
public final class PDFSound
A PDFSound represents an audio sample in a PDF document. Since 2.11.9 any audio stream that can be parsed by the Java sound subsystem can be used, however for ease of parsing we recommend PCM WAV.
Constructor Summary | |
---|---|
PDFSound(InputStream in)
Create a new PDFSound from the specified InputStream. |
Method Summary | |
---|---|
void |
close()
Close the sound object. |
AudioInputStream |
getAudioInputStream()
Return an AudioInputStream of this object. |
Reader |
getMetaData()
Return any XML metadata associated with this object. |
int |
getRate()
Return the number of samples/second this sound is played at. |
InputStream |
getStream()
Deprecated. please call getAudioInputStream instead. |
String |
getType()
Deprecated. method will always return Unknown |
void |
setMetaData(String xmldata)
Set the XML metadata associated with this object. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PDFSound(InputStream in) throws IOException
Create a new PDFSound from the specified InputStream. The stream
can be any type of Audio file that is supported by the
AudioSystem
, or if that system is
not enabled for any reason, PCM WAV formats can be parsed directly.
IOException
- if the file format is invalidMethod Detail |
---|
public int getRate()
public AudioInputStream getAudioInputStream()
AudioInputStream
of this object.
public String getType()
public InputStream getStream()
getAudioInputStream()
instead.
public void setMetaData(String xmldata)
PDF.setMetaData(java.lang.String)
for more information.
xmldata
- the XML data to embed into the document, or null to clear any existing metadata. No validation is performed on this input.public Reader getMetaData() throws IOException
PDF.getMetaData()
for more information
Reader
containing the source of the XML or null if no metadata is available.
IOException
- if the metadata can't be extractedpublic String toString()
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |