Package at.ofai.music.match
Class AudioFile
- java.lang.Object
-
- at.ofai.music.match.AudioFile
-
public class AudioFile extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field and Description protected javax.sound.sampled.AudioInputStream
audioIn
protected FixedPoint
fixedPoints
protected javax.sound.sampled.AudioFormat
format
protected float
frameRate
protected int
frameSize
protected boolean
isReference
protected long
length
protected boolean
orientationX
protected java.lang.String
path
protected int
pathLength
protected double
refHopTime
protected int[]
refIndex
protected at.ofai.music.match.GUI.FileNameSelection
selector
protected double
thisHopTime
protected int[]
thisIndex
-
Constructor Summary
Constructors Constructor and Description AudioFile()
AudioFile(java.lang.String pathName, at.ofai.music.match.GUI.FileNameSelection jb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description long
fromReferenceTime(double time)
double
fromReferenceTimeD(double time)
void
print()
int
search(int[] arr, int val)
Performs a binary search for a value in an array and returns its index.void
setFixedPoints(FixedPoint p, boolean isX)
void
setMatch(int[] idx1, double ht1, int[] idx2, double ht2, int ln)
long
setPosition(long position)
double
toReferenceTime(long ltime)
double
toReferenceTimeD(double time)
-
-
-
Field Detail
-
audioIn
protected javax.sound.sampled.AudioInputStream audioIn
-
fixedPoints
protected FixedPoint fixedPoints
-
format
protected javax.sound.sampled.AudioFormat format
-
frameRate
protected float frameRate
-
frameSize
protected int frameSize
-
isReference
protected boolean isReference
-
length
protected long length
-
orientationX
protected boolean orientationX
-
path
protected java.lang.String path
-
pathLength
protected int pathLength
-
refHopTime
protected double refHopTime
-
refIndex
protected int[] refIndex
-
selector
protected at.ofai.music.match.GUI.FileNameSelection selector
-
thisHopTime
protected double thisHopTime
-
thisIndex
protected int[] thisIndex
-
-
Constructor Detail
-
AudioFile
public AudioFile()
-
AudioFile
public AudioFile(java.lang.String pathName, at.ofai.music.match.GUI.FileNameSelection jb)
-
-
Method Detail
-
setMatch
public void setMatch(int[] idx1, double ht1, int[] idx2, double ht2, int ln)
-
setFixedPoints
public void setFixedPoints(FixedPoint p, boolean isX)
-
print
public void print()
-
search
public int search(int[] arr, int val)
Performs a binary search for a value in an array and returns its index. If the value does not exist in the array, the index of the nearest element is returned. If the value occurs multiple times in the array, the centre index is returned. Note that we can't use Arrays.binarySearch() because the array might not be full.
-
fromReferenceTime
public long fromReferenceTime(double time)
-
fromReferenceTimeD
public double fromReferenceTimeD(double time)
-
toReferenceTime
public double toReferenceTime(long ltime)
-
toReferenceTimeD
public double toReferenceTimeD(double time)
-
setPosition
public long setPosition(long position) throws java.io.IOException
- Throws:
java.io.IOException
-
-