Package ipsk.audio.dsp
Class FloatRandomAccessStream
- java.lang.Object
-
- ipsk.audio.dsp.FloatRandomAccessStream
-
- Direct Known Subclasses:
BufferedFloatRandomAccessStream
public class FloatRandomAccessStream extends java.lang.Object
A random accessible audio stream in normalized float values.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.sound.sampled.AudioFormat
audioFormat
protected AudioSource
audioSource
protected byte[]
buffer
protected AudioFrameProcessor
bufferProcessor
protected int
frameSize
protected RandomAccessAudioStream
raas
-
Constructor Summary
Constructors Constructor Description FloatRandomAccessStream(AudioSource audioSource)
Returns a float value audio stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
getChannels()
long
getFrameLength()
int
readFrames(double[][] normBuf, int frameOffset, int frames)
void
setFramePosition(long newPos)
long
skipFrames(long framesToSkip)
java.lang.String
toString()
-
-
-
Field Detail
-
audioSource
protected AudioSource audioSource
-
audioFormat
protected javax.sound.sampled.AudioFormat audioFormat
-
buffer
protected byte[] buffer
-
frameSize
protected int frameSize
-
raas
protected RandomAccessAudioStream raas
-
bufferProcessor
protected AudioFrameProcessor bufferProcessor
-
-
Constructor Detail
-
FloatRandomAccessStream
public FloatRandomAccessStream(AudioSource audioSource) throws AudioFormatNotSupportedException, AudioSourceException
Returns a float value audio stream. The float values a normalized to the scale -1 from to +1.- Parameters:
audioSource
- audio source stream- Throws:
AudioSourceException
AudioFormatNotSupportedException
-
-
Method Detail
-
close
public void close() throws AudioSourceException
- Throws:
AudioSourceException
-
readFrames
public int readFrames(double[][] normBuf, int frameOffset, int frames) throws AudioSourceException
- Throws:
AudioSourceException
-
setFramePosition
public void setFramePosition(long newPos) throws AudioSourceException
- Throws:
AudioSourceException
-
skipFrames
public long skipFrames(long framesToSkip) throws AudioSourceException
- Throws:
AudioSourceException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFrameLength
public long getFrameLength() throws AudioSourceException
- Throws:
AudioSourceException
-
getChannels
public int getChannels() throws AudioSourceException
- Throws:
AudioSourceException
-
-