/** * Get the tag or if the file doesn't have one at all, create a default tag and set it * as the tag of this file * * @return */ public Tag getTagOrCreateAndSetDefault() { Tag tag = getTagOrCreateDefault(); setTag(tag); return tag; }
/** * Get the tag or if the file doesn't have one at all, create a default tag and set it * * @return */ public Tag getTagOrCreateAndSetDefault() { Tag tag = getTag(); if (tag == null) { tag = createDefaultTag(); setTag(tag); return tag; } return tag; }
/** * Get the tag or if the file doesn't have one at all, create a default tag and set it * * @return */ public Tag getTagOrCreateAndSetDefault() { Tag tag = getTag(); if(tag==null) { tag = createDefaultTag(); setTag(tag); return tag; } return tag; }
TagOptionSingleton.getInstance().setAndroid(true); File mp3File = new File(mp3Song); AudioFile audioFile = AudioFileIO.read(mp3File); audioFile.setTag(new ID3v23Tag()); Tag newTag= audioFile.getTag(); if (album != null) { newTag.setField(ALBUM, album); } if (artist != null) { newTag.setField(ARTIST, artist); } if (trackName != null) { Log.d("ALBUM TITLE",trackName); newTag.setField(TITLE, trackName); } if (imageAlbum != null) { Log.d("ALBUM COVER",imageAlbum); File fileCover = new File(imageAlbum); if (!fileCover.exists()){ Log.d("ALBUM ","DOESNT EXIST"); } Artwork artwork = Artwork.createArtworkFromFile(fileCover); newTag.addField(artwork); newTag.setField(artwork); } audioFile.commit();de here
f.setTag( tag );
newTagV23 = new ID3v23Tag((ID3v11Tag)audioFile.getTag()); // Copy old tag data audioFile.setTag(newTagV23);