Package ipsk.audio
Class ConvenienceFileAudioSource
- java.lang.Object
-
- ipsk.audio.BasicAudioSource
-
- ipsk.audio.FileAudioSource
-
- ipsk.audio.ConvenienceFileAudioSource
-
- All Implemented Interfaces:
AudioSource
public class ConvenienceFileAudioSource extends FileAudioSource
A file based convenience PCM audio source. Converts underlying audio source to PCM stream. If frame length is unknown calculates the frame length.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Field Summary
-
Fields inherited from interface ipsk.audio.AudioSource
DATA_FLAVOR
-
Fields inherited from class ipsk.audio.BasicAudioSource
frameLengthObj
-
Fields inherited from class ipsk.audio.FileAudioSource
file
-
-
Constructor Summary
Constructors Constructor Description ConvenienceFileAudioSource(java.io.File file)
Create new audio source from file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.sound.sampled.AudioInputStream
getAudioInputStream()
Returns a new audio input stream.javax.sound.sampled.AudioFormat
getFormat()
long
getFrameLength()
-
Methods inherited from class ipsk.audio.BasicAudioSource
isRandomAccessible, setAudioFormat, setFrameLength
-
Methods inherited from class ipsk.audio.FileAudioSource
getFile, setFile
-
-
-
-
Constructor Detail
-
ConvenienceFileAudioSource
public ConvenienceFileAudioSource(java.io.File file) throws AudioSourceException
Create new audio source from file.- Parameters:
file
-- Throws:
AudioSourceException
-
-
Method Detail
-
getAudioInputStream
public javax.sound.sampled.AudioInputStream getAudioInputStream() throws AudioSourceException
Description copied from interface:AudioSource
Returns a new audio input stream.- Specified by:
getAudioInputStream
in interfaceAudioSource
- Overrides:
getAudioInputStream
in classFileAudioSource
- Returns:
- a new audio input stream
- Throws:
AudioSourceException
-
getFrameLength
public long getFrameLength() throws AudioSourceException
- Specified by:
getFrameLength
in interfaceAudioSource
- Overrides:
getFrameLength
in classBasicAudioSource
- Returns:
- Returns the frameLength.
- Throws:
AudioSourceException
-
getFormat
public javax.sound.sampled.AudioFormat getFormat() throws AudioSourceException
- Specified by:
getFormat
in interfaceAudioSource
- Overrides:
getFormat
in classBasicAudioSource
- Throws:
AudioSourceException
-
-