Package net.mtrop.doom.struct.io
Class JSPISoundHandle
java.lang.Object
net.mtrop.doom.struct.io.JSPISoundHandle
Sound resource abstraction.
Wraps Java Sound SPI structures for ease of creating handles to decodable sound.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Decoder class that decodes sound as PCM audio. -
Constructor Summary
ModifierConstructorDescriptionprotected
Opens a sound file for reading.JSPISoundHandle
(String filePath) Opens a sound file for reading.JSPISoundHandle
(URL url) Opens a URL for reading. -
Method Summary
-
Constructor Details
-
JSPISoundHandle
protected JSPISoundHandle() -
JSPISoundHandle
Opens a sound file for reading.- Parameters:
filePath
- path to the file.- Throws:
IOException
- if the resource can't be read.UnsupportedAudioFileException
- if the audio format is not recognized.
-
JSPISoundHandle
Opens a sound file for reading.- Parameters:
f
- the file.- Throws:
IOException
- if the file can't be read.UnsupportedAudioFileException
- if the audio format is not recognized.
-
JSPISoundHandle
Opens a URL for reading.- Parameters:
url
- the URL.- Throws:
IOException
- if the stream can't be read.UnsupportedAudioFileException
- if the audio format is not recognized.
-
-
Method Details
-
getDecoder
- Returns:
- a
JSPISoundHandle.Decoder
that can decode this data into PCM data. - Throws:
IOException
- if a decoder could not be opened.
-
getName
- Returns:
- the name of this handle.
-
toString
-
getDataName
- Returns:
- the dataName
-