|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbe.hogent.tarsos.util.AudioFile
public final class AudioFile
Represents an audio file. Facilitates transcoding, handling of originalPath names and data sets.
| Constructor Summary | |
|---|---|
AudioFile(java.lang.String filePath)
Create and transcode an audio file. |
|
| Method Summary | |
|---|---|
static java.util.List<AudioFile> |
audioFiles(java.lang.String... folders)
Returns a list of AudioFiles included in one or more folders. |
javax.sound.sampled.AudioFileFormat |
fileFormat()
|
double |
getLengthIn(TimeUnit unit)
|
long |
getLengthInMilliSeconds()
Determines the length of the transcoded file (only audio data) in microseconds. |
double |
getMicrosecondsPositionOfFrame(long frame)
|
long |
getSizeInBytes()
Determines the size of the transcoded audio data in bytes. |
java.lang.String |
originalBasename()
|
java.lang.String |
originalPath()
|
void |
playCents(PitchDetectionMode detectionMode,
double from,
double to,
PitchUnit unit)
Detects pitch and plays plays the samples that are in the interval from, to in the given pitch unit. |
void |
playSelection(double from,
double to)
|
void |
playSelections(double[] selections)
Play selections of the audio file. |
java.lang.String |
toString()
|
java.lang.String |
transcodedBasename()
|
java.lang.String |
transcodedDirectory()
|
java.lang.String |
transcodedPath()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AudioFile(java.lang.String filePath)
throws EncoderException
filePath - the originalPath for the audio file
EncoderException - If FFMPEG fails to transcode the audio an
UnsupportedAudioFileException is generated.| Method Detail |
|---|
public java.lang.String transcodedPath()
public java.lang.String transcodedDirectory()
public java.lang.String originalPath()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String originalBasename()
public java.lang.String transcodedBasename()
public static java.util.List<AudioFile> audioFiles(java.lang.String... folders)
folders - The fo
public long getLengthInMilliSeconds()
public double getLengthIn(TimeUnit unit)
public double getMicrosecondsPositionOfFrame(long frame)
public long getSizeInBytes()
public javax.sound.sampled.AudioFileFormat fileFormat()
public void playSelection(double from,
double to)
public void playSelections(double[] selections)
selections - An interleaved array with in the form
[from,to,from,to,from,to...]. The from and to values are given
in seconds.
public void playCents(PitchDetectionMode detectionMode,
double from,
double to,
PitchUnit unit)
detectionMode - The detection mode.from - Interval start.to - Interval stop.unit - The pitch unit.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||