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.AudioInputStreamgetAudioInputStream()Returns a new audio input stream.javax.sound.sampled.AudioFormatgetFormat()longgetFrameLength()-
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 AudioSourceExceptionCreate new audio source from file.- Parameters:
file-- Throws:
AudioSourceException
-
-
Method Detail
-
getAudioInputStream
public javax.sound.sampled.AudioInputStream getAudioInputStream() throws AudioSourceExceptionDescription copied from interface:AudioSourceReturns a new audio input stream.- Specified by:
getAudioInputStreamin interfaceAudioSource- Overrides:
getAudioInputStreamin classFileAudioSource- Returns:
- a new audio input stream
- Throws:
AudioSourceException
-
getFrameLength
public long getFrameLength() throws AudioSourceException- Specified by:
getFrameLengthin interfaceAudioSource- Overrides:
getFrameLengthin classBasicAudioSource- Returns:
- Returns the frameLength.
- Throws:
AudioSourceException
-
getFormat
public javax.sound.sampled.AudioFormat getFormat() throws AudioSourceException- Specified by:
getFormatin interfaceAudioSource- Overrides:
getFormatin classBasicAudioSource- Throws:
AudioSourceException
-
-