org.hd.d.pg2k.svrCore.MIME
Class AbstractSampledSoundHandler
java.lang.Object
org.hd.d.pg2k.svrCore.MIME.AbstractHandler
org.hd.d.pg2k.svrCore.MIME.AbstractSampledSoundHandler
- All Implemented Interfaces:
- Handler
- Direct Known Subclasses:
- au, wav
public abstract class AbstractSampledSoundHandler
- extends AbstractHandler
Base class with useful default behaviour for (sampled) sound exhibit media-handler classes.
By default this uses javax.sound.* routines to extract sound and metadata from
an exhibit stream.
Various routines can be overridden in deriving classes to change this behaviour.
|
Method Summary |
protected javax.sound.sampled.AudioFileFormat |
getAudioFileFormat(java.io.InputStream is)
Get format of audio data; null if none or format not usable/parseable. |
org.w3c.dom.Node |
getMetadata(java.io.InputStream is,
Name.ExhibitFull exhibitName)
Gets all available exhibit metadata as a single XML DOM tree; null if none. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractSampledSoundHandler
public AbstractSampledSoundHandler()
getAudioFileFormat
protected javax.sound.sampled.AudioFileFormat getAudioFileFormat(java.io.InputStream is)
- Get format of audio data; null if none or format not usable/parseable.
This may require the stream to be seekable, at least with mark() and reset().
getMetadata
public org.w3c.dom.Node getMetadata(java.io.InputStream is,
Name.ExhibitFull exhibitName)
- Gets all available exhibit metadata as a single XML DOM tree; null if none.
We do not (yet) have a schema for this and may never do so,
since its structure and content will depend on various external sources
and parts of (for example) the ImageIO and JAI subsystems.
This implementation synthesises a metadata tree from the AudioFileFormat data,
if any.
- Specified by:
getMetadata in interface Handler- Overrides:
getMetadata in class AbstractHandler
- Parameters:
is - input stream; never nullexhibitName - TODO
- Returns:
- top-level node "metadata" with captured metadata beneath, else null
Copyright (c) 1996-2012, Damon Hart-Davis. All rights reserved.