本文整理汇总了Java中entagged.audioformats.AudioFile类的典型用法代码示例。如果您正苦于以下问题:Java AudioFile类的具体用法?Java AudioFile怎么用?Java AudioFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AudioFile类属于entagged.audioformats包,在下文中一共展示了AudioFile类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readSongDurationWithTagLibrary
import entagged.audioformats.AudioFile; //导入依赖的package包/类
/**
* returns the song duration in milliseconds or -1 if it is not able to read the duration
*
* @param path
* @return
*/
private int readSongDurationWithTagLibrary(String path) {
float exactDuration = -1;
try {
// Log.v("Tag Reader", "Reading tags from " + song.getName());
File f = new File(path);
AudioFile af = AudioFileIO.read(f);
exactDuration = af.getPreciseLength();
int duration = (int) Math.floor(exactDuration * 1000);
Log.v(TAG, "Read duration from tag: " + duration + "ms");
return duration;
} catch (Exception e) {
Log.w(TAG, e);
return -1;
}
}
示例2: getAudioFile
import entagged.audioformats.AudioFile; //导入依赖的package包/类
/**
* Gets informations about the file.
* @return audio file
*/
public final AudioFile getAudioFile() {
return this.audioFile;
}