Java Code Examples for org.jaudiotagger.audio.AudioFile#commit()
The following examples show how to use
org.jaudiotagger.audio.AudioFile#commit() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MediaStoreUtil.java From APlayer with GNU General Public License v3.0 | 5 votes |
@WorkerThread public static void saveArtwork(Context context, int albumId, File artFile) throws TagException, ReadOnlyFileException, CannotReadException, InvalidAudioFrameException, IOException, CannotWriteException { Song song = MediaStoreUtil.getSongByAlbumId(albumId); if (song == null) { return; } AudioFile audioFile = AudioFileIO.read(new File(song.getUrl())); Tag tag = audioFile.getTagOrCreateAndSetDefault(); Artwork artwork = ArtworkFactory.createArtworkFromFile(artFile); tag.deleteArtworkField(); tag.setField(artwork); audioFile.commit(); insertAlbumArt(context, albumId, artFile.getAbsolutePath()); }
Example 2
Source File: SAFUtil.java From VinylMusicPlayer with GNU General Public License v3.0 | 4 votes |
public static void writeFile(AudioFile audio) throws CannotWriteException { audio.commit(); }