Package ipsk.audio.dsp
Class LevelMeasureAudioInputStream
- java.lang.Object
-
- java.io.InputStream
-
- javax.sound.sampled.AudioInputStream
-
- ipsk.audio.dsp.LevelMeasureAudioInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class LevelMeasureAudioInputStream extends javax.sound.sampled.AudioInputStreamMeasures the level of the the audio stream and holds the peak.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Constructor Summary
Constructors Constructor Description LevelMeasureAudioInputStream(javax.sound.sampled.AudioInputStream srcAudioInputStream)Create a measuring audio stream with the given source stream.LevelMeasureAudioInputStream(javax.sound.sampled.AudioInputStream srcAudioInputStream, LevelInfo[] levelInfos)Create a measuring audio stream with the given source stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()javax.sound.sampled.AudioFormatgetFormat()longgetFrameLength()LevelInfo[]getLevelInfos()Get level infos of all channels.float[]getPeakLevelHold()Get current level peaks.voidmark(int arg0)booleanmarkSupported()intread()intread(byte[] buf)intread(byte[] buf, int trgOffset, int len)voidreset()voidresetPeakHold()Reset the peak hold.longskip(long arg0)java.lang.StringtoString()
-
-
-
Constructor Detail
-
LevelMeasureAudioInputStream
public LevelMeasureAudioInputStream(javax.sound.sampled.AudioInputStream srcAudioInputStream) throws AudioFormatNotSupportedExceptionCreate a measuring audio stream with the given source stream.- Parameters:
srcAudioInputStream- source audio stream (the stream to measure)- Throws:
AudioFormatNotSupportedException
-
LevelMeasureAudioInputStream
public LevelMeasureAudioInputStream(javax.sound.sampled.AudioInputStream srcAudioInputStream, LevelInfo[] levelInfos) throws AudioFormatNotSupportedExceptionCreate a measuring audio stream with the given source stream.- Parameters:
srcAudioInputStream- source audio stream (the stream to measure)- Throws:
AudioFormatNotSupportedException
-
-
Method Detail
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjavax.sound.sampled.AudioInputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjavax.sound.sampled.AudioInputStream- Throws:
java.io.IOException
-
getFormat
public javax.sound.sampled.AudioFormat getFormat()
- Overrides:
getFormatin classjavax.sound.sampled.AudioInputStream
-
getFrameLength
public long getFrameLength()
- Overrides:
getFrameLengthin classjavax.sound.sampled.AudioInputStream
-
mark
public void mark(int arg0)
- Overrides:
markin classjavax.sound.sampled.AudioInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjavax.sound.sampled.AudioInputStream
-
read
public int read() throws java.io.IOException- Overrides:
readin classjavax.sound.sampled.AudioInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buf) throws java.io.IOException- Overrides:
readin classjavax.sound.sampled.AudioInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buf, int trgOffset, int len) throws java.io.IOException- Overrides:
readin classjavax.sound.sampled.AudioInputStream- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjavax.sound.sampled.AudioInputStream- Throws:
java.io.IOException
-
skip
public long skip(long arg0) throws java.io.IOException- Overrides:
skipin classjavax.sound.sampled.AudioInputStream- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLevelInfos
public LevelInfo[] getLevelInfos()
Get level infos of all channels.- Returns:
- array of level infos
-
resetPeakHold
public void resetPeakHold()
Reset the peak hold.
-
getPeakLevelHold
public float[] getPeakLevelHold()
Get current level peaks.- Returns:
- array with normalized peak for each channel
-
-