• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ID3v2类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: stripMp3ID3v2

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
/**
 * Private helper method that strips ID3v2 tags from an mp3 file.
 * 
 * @param mp3File - Target Mp3File with ID3v2 tags to strip.
 * @return A Song object containing all the tags from the mp3File.
 */
private LocalSong stripMp3ID3v2(Mp3File mp3File) {
	if(!mp3File.hasId3v2Tag()) {
		throw new IllegalArgumentException("No such file exists!");
	}
	
	ID3v2 id3v2Tags = mp3File.getId3v2Tag();
	LocalSong mp3Song = new LocalSong();
	
	mp3Song.setTitle(id3v2Tags.getTitle());
	mp3Song.setArtist(id3v2Tags.getArtist());
	mp3Song.setAlbum(id3v2Tags.getAlbum());
	mp3Song.setLength("" + mp3File.getLengthInSeconds());
	
	return mp3Song;
}
 
开发者ID:brokenprogrammer,项目名称:RapidTunes,代码行数:22,代码来源:FileStripper.java


示例2: showId3v2Fields

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
private void showId3v2Fields(StringBuffer buffer) {
	ID3v2 id3v2tag = mp3file.getId3v2Tag();
	if (id3v2tag == null || !id3v2tag.getObseleteFormat()) {
		buffer.append("ID3v2 Data\n"); 
	} else {
		buffer.append("ID3v2 Data (Obselete 3-character format)\n");
	}
	if (id3v2tag == null) {
		buffer.append("  NONE!\n");
	} else {
		showField(buffer, "Track", id3v2tag.getTrack());
		showField(buffer, "Artist", id3v2tag.getArtist());
		showField(buffer, "Album", id3v2tag.getAlbum());
		showField(buffer, "Title", id3v2tag.getTitle());
		showField(buffer, "Year", id3v2tag.getYear());
		showField(buffer, "Genre", id3v2tag.getGenreDescription());
		showField(buffer, "Comment", id3v2tag.getComment());
		showField(buffer, "Composet", id3v2tag.getComposer());
		showField(buffer, "Original Artist", id3v2tag.getOriginalArtist());
		showField(buffer, "Copyright", id3v2tag.getCopyright());
		showField(buffer, "Url", id3v2tag.getUrl());
		showField(buffer, "Encoder", id3v2tag.getEncoder());
		showField(buffer, "Album Image", id3v2tag.getAlbumImageMimeType());
	}
}
 
开发者ID:mpatric,项目名称:mp3agic-examples,代码行数:26,代码来源:Mp3Details.java


示例3: extractPics

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
protected void extractPics() throws IOException {
	ID3v2 id3v2tag = mp3file.getId3v2Tag();
	if (id3v2tag != null) {
		String mimeType = id3v2tag.getAlbumImageMimeType();
		byte[] data = id3v2tag.getAlbumImage();
		String filename = chooseFilename(mimeType);
		RandomAccessFile file = null;
		try {
			file = new RandomAccessFile(filename, "rw");
			file.write(data);
		} finally {
			try {
				if (file != null) {
					printOut("  Extracted " + filename);
					file.close();
				}
			} catch (IOException e) {
				// do nothing
			}
		}
	}
}
 
开发者ID:mpatric,项目名称:mp3agic-examples,代码行数:23,代码来源:Mp3Pics.java


示例4: catalogId3Fields

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
private void catalogId3Fields(StringBuffer cat) {
	ID3v1 id3v1tag = mp3file.getId3v1Tag();
	ID3v2 id3v2tag = mp3file.getId3v2Tag();
	ID3Wrapper id3wrapper = new ID3Wrapper(id3v1tag, id3v2tag);
	if (id3v1tag != null) catalogField(cat, "1." + id3v1tag.getVersion());
	else catalogField(cat, null);
	if (id3v2tag != null) catalogField(cat, "2." + id3v2tag.getVersion());
	else catalogField(cat, null);
	catalogField(cat, id3wrapper.getTrack());
	catalogField(cat, id3wrapper.getArtist());
	catalogField(cat, id3wrapper.getAlbum());
	catalogField(cat, id3wrapper.getTitle());
	catalogField(cat, id3wrapper.getYear());
	catalogField(cat, id3wrapper.getGenreDescription());
	catalogField(cat, id3wrapper.getComment());
	catalogField(cat, id3wrapper.getComposer());
	catalogField(cat, id3wrapper.getOriginalArtist());
	catalogField(cat, id3wrapper.getCopyright());
	catalogField(cat, id3wrapper.getUrl());
	catalogField(cat, id3wrapper.getEncoder());
	catalogField(cat, id3wrapper.getAlbumImageMimeType());
}
 
开发者ID:mpatric,项目名称:mp3agic-examples,代码行数:23,代码来源:Mp3Catalog.java


示例5: construct

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
@Override
public ID3v2 construct() throws IOException {
    final ID3v2 result = this.origin.construct();
    if (result.getAlbumImage() == null) {
        throw new IOException("No album toByteArray found");
    }
    return result;
}
 
开发者ID:driver733,项目名称:VKMusicUploader,代码行数:9,代码来源:AdvancedTagVerifiedAlbumImage.java


示例6: construct

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
@Override
public ID3v2 construct() throws IOException {
    if (this.file.hasId3v2Tag()) {
        return this.file.getId3v2Tag();
    } else {
        throw new IOException("No ID3v2 tag found");
    }
}
 
开发者ID:driver733,项目名称:VKMusicUploader,代码行数:9,代码来源:AdvancedTagFromMp3File.java


示例7: parse

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
@Override
public MetaData parse(Object object) {
	Assert.isTrue(object instanceof Mp3File, "Support Mp3File class only.");

	Mp3File mp3 = (Mp3File)object;
			
	MetaData metaData = new MetaData();
	
	if (mp3.hasId3v2Tag()) {
		ID3v2 id3v2Tag = mp3.getId3v2Tag();
		metaData.put(Audio.MetaName.Album, id3v2Tag.getAlbum());
		metaData.put(Audio.MetaName.Artist, id3v2Tag.getArtist());
		metaData.put(Audio.MetaName.Genre, id3v2Tag.getGenreDescription());
		metaData.put(Audio.MetaName.Title, id3v2Tag.getTitle());
		metaData.put(Audio.MetaName.Track, id3v2Tag.getTrack());
	}else if(mp3.hasId3v1Tag()) {
		ID3v1 id3v1Tag = mp3.getId3v1Tag();
		metaData.put(Audio.MetaName.Album, id3v1Tag.getAlbum());
		metaData.put(Audio.MetaName.Artist, id3v1Tag.getArtist());
		metaData.put(Audio.MetaName.Genre, id3v1Tag.getGenreDescription());
		metaData.put(Audio.MetaName.Title, id3v1Tag.getTitle());
		metaData.put(Audio.MetaName.Track, id3v1Tag.getTrack());
	}
	
	return metaData;
	
}
 
开发者ID:ivarptr,项目名称:clobaframe,代码行数:28,代码来源:Mp3MetaDataPaser.java


示例8: getId3v2Tag

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
public ID3v2 getId3v2Tag() {
	return id3v2Tag;
}
 
开发者ID:dimattiami,项目名称:ytdl,代码行数:4,代码来源:MyMp3FileOverride.java


示例9: setId3v2Tag

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
public void setId3v2Tag(ID3v2 id3v2Tag) {
	this.id3v2Tag = id3v2Tag;
}
 
开发者ID:dimattiami,项目名称:ytdl,代码行数:4,代码来源:MyMp3FileOverride.java


示例10: encodeId

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
public static void encodeId(int id, ID3v2 tag) {
    tag.setEncoder("gs" + id);
}
 
开发者ID:danhawkes,项目名称:basking,代码行数:4,代码来源:Utils.java


示例11: construct

import com.mpatric.mp3agic.ID3v2; //导入依赖的package包/类
/**
 * Checks the tag for missing items, such as album image.
 * @return The {@link ID3v2} tag.
 * @throws IOException If the tag has any of the requested items missing.
 */
ID3v2 construct() throws IOException;
 
开发者ID:driver733,项目名称:VKMusicUploader,代码行数:7,代码来源:AdvancedTag.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ServerRuntimeException类代码示例发布时间:2022-05-21
下一篇:
Java CholeskyDecomposition类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap