当前位置: 首页>>代码示例>>Java>>正文


Java ID3Exception类代码示例

本文整理汇总了Java中org.blinkenlights.jid3.ID3Exception的典型用法代码示例。如果您正苦于以下问题:Java ID3Exception类的具体用法?Java ID3Exception怎么用?Java ID3Exception使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ID3Exception类属于org.blinkenlights.jid3包,在下文中一共展示了ID3Exception类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extract

import org.blinkenlights.jid3.ID3Exception; //导入依赖的package包/类
@Override
public Map<String, String> extract(File file) throws CannotExtractMetaDataException {
    this.properties.clear();

    MediaFile mediaFile = new MP3File(file);

    try {
        ID3Tag[] tags = mediaFile.getTags();

        for (ID3Tag tag : tags) {
            processTag(tag);
        }

    } catch (ID3Exception ex) {
        throw new CannotExtractMetaDataException(ex);
    }

    return properties;
}
 
开发者ID:getconverge,项目名称:converge-1.x,代码行数:20,代码来源:Mp3MetaDataExtractor.java

示例2: writeTrackInfo

import org.blinkenlights.jid3.ID3Exception; //导入依赖的package包/类
@Override public void writeTrackInfo(Track track) throws IOException {
    log.info("writing ID3 tags to {}", track);

    try {
        ID3V1Tag id3V1Tag = new ID3V1_1Tag();
        ID3V2Tag id3V2Tag = new ID3V2_3_0Tag();

        String artistName = track.getSong().getArtistName();
        if (artistName != null) {
            id3V1Tag.setArtist(fixLongIDV1String(artistName));
            id3V2Tag.setArtist(artistName);
        }

        String albumName = track.getSong().getAlbumName();
        if (albumName != null) {
            id3V1Tag.setAlbum(fixLongIDV1String(albumName));
            id3V2Tag.setAlbum(albumName);
        }

        String songName = track.getSong().getSongName();
        if (songName != null) {
            id3V1Tag.setTitle(fixLongIDV1String(songName));
            id3V2Tag.setTitle(songName);
        }

        Integer trackNum = track.getSong().getTrackNum();
        if (trackNum != null) {
            id3V2Tag.setTrackNumber(trackNum);
        }

        MP3File mp3File = new MP3File(file);
        mp3File.setID3Tag(id3V1Tag);
        mp3File.setID3Tag(id3V2Tag);
        mp3File.sync();
    }
    catch (ID3Exception ex) {
        throw new IOException("cannot write ID3 tags to file " + file + "; track: " + track + "; reason: " + ex, ex);
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:40,代码来源:FileStore.java

示例3: LeerTags

import org.blinkenlights.jid3.ID3Exception; //导入依赖的package包/类
public void LeerTags() {
MediaFile mediaFile = new MP3File(mp3);
    try {
        for (Object obj : mediaFile.getTags()) {
            if (obj instanceof ID3V1_0Tag)
                LeerID3V1Tags(obj);
            else if (obj instanceof ID3V2_3_0Tag)
                LeerID3V2_3Tags(obj);
        }
    } catch (ID3Exception e1) {
        e1.printStackTrace();
    }
}
 
开发者ID:Geradmc,项目名称:Automatizacion_Directorios,代码行数:14,代码来源:LeerPropiedadesMP32.java


注:本文中的org.blinkenlights.jid3.ID3Exception类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。