Skip to content

Commit

Permalink
Merge pull request #6 from gcottom/dev
Browse files Browse the repository at this point in the history
V3 release changes
  • Loading branch information
gcottom authored Nov 6, 2024
2 parents ec0136d + 62d98c9 commit d01c1fc
Show file tree
Hide file tree
Showing 59 changed files with 186 additions and 6,122 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/pipeline.yaml

This file was deleted.

28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Changelog

## [3.0.0] - 2024-11-5
### audiometa
- Now uses an interface for common tags between file types instead of a struct
- Each format is now under its own project
- Majorly simplifies interacting with metadata

### MP3
- New module wrapper
- Concurrency improvements

### MP4
- No longer corrupts files
- Smaller memory footprint
- Now works with album art

### OGG
- CRC32 checksum is now calculated and checked correctly
- Opus and Vorbis now support cover art
- Opus cover art no longer breaks the stream
- Added a large set of vorbis tags
- No longer corrupts files

### FLAC
- No longer corrupts files
- Added a large set of vorbis tags
- Major memory improvements as the audio stream is now copied directly to the writer instead of reading it all to memory first
28 changes: 0 additions & 28 deletions LICENSE

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Gage Cottom

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
108 changes: 8 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,12 @@
# audiometa

audiometa is the final piece that ties several projects together with a simple interface. While the code looks short for this specific project, the underlying modules are extensive.

MP3/MP4/FLAC/OGG tag reader and writer for go
## File Types
- MP3 (files containing an ID3 header)
- MP4 (files containing an ftyp header)
- OGG (files containing an oggs header, with vorbis or opus encoding)
- FLAC (files containing a fLaC header)


[![Go Reference](https://pkg.go.dev/badge/github.com/gcottom/audiometa/v2.svg)](https://pkg.go.dev/github.com/gcottom/audiometa/v2) [![Go Report Card](https://goreportcard.com/badge/github.com/gcottom/audiometa/v2)](https://goreportcard.com/report/github.com/gcottom/audiometa/v2) [![Coverage Status](https://coveralls.io/repos/github/gcottom/audiometa/badge.svg?branch=main)](https://coveralls.io/github/gcottom/audiometa?branch=main)


This package enables parsing and writing of ID tags for mp3, mp4 (m4a, m4b, m4p), FLAC, and ogg (Vorbis, OPUS) files.

All fields can be accessed via the provided accessor methods. Only supported fields per file type will return non zero data. The exception to this is that ogg files support a passthrough map.
By setting kv pairs in the passthrough map, non-standard vorbis comment tags can be written to both ogg Vorbis and ogg OPUS files.


# Parsable Fields Per FileType

## MP3
Artist, AlbumArtist, Album, AlbumArt, BPM, ContentType, Comments, Composer, CopyrightMessage, Date, EncodedBy, FileType, Genre, Language, Length, Lyricist, PartOfSet, Publisher, Title, Year

## MP4 & MP4 Types (m4a, m4b, m4p, mp4)
Artist, AlbumArtist, Album, AlbumArt, Comments, Composer, CopyrightMessage, EncodedBy, Genre, Title, Year

## FLAC
Artist, Album, AlbumArt, Date, Genre, Title

## OGG (Vorbis and OPUS within an ogg container)
Artist, AlbumArtist, Album, AlbumArt, Comment, Composer, Copyright, Date, Genre, Title, Publisher, (extended support for custom fields via passthrough map)


# Writable Fields Per FileType

## MP3
Artist, AlbumArtist, Album, AlbumArt, BPM, ContentType, Comments, Composer, CopyrightMessage, Date, EncodedBy, FileType, Genre, Language, Length, Lyricist, PartOfSet, Publisher, Title, Year

## MP4 & MP4 Types (m4a, m4b, m4p, mp4)
Artist, AlbumArtist, Album, Comments, CopyrightMessage, Composer, Genre, Title, Year (AlbumArt is currently not writeable)

## FLAC
Artist, Album, AlbumArt, Date, Genre, Title

## OGG (Vorbis and OPUS within an ogg container)
Artist, AlbumArtist, Album, AlbumArt, Comment, Composer, Copyright, Date, Genre, Title, Publisher, (extended support for custom fields via passthrough map)

# Usage

## Open Tag For Reading From Path
```
tag, err := audiometa.OpenTagFromPath("./my-audio-file.mp3")
if err != nil{
panic(err)
}
artist := tag.Artist()
album := tag.Album()
title := tag.Title()
```

## Open Tag For Reading From io.ReadSeeker
```
f, err := os.Open("./my-audio-file.mp3")
tag, err := audiometa.Open(f, audiometa.ParseOptions{Format: audiometa.MP3}) //ParseOptions is only required if the file does not have an extension
if err != nil{
panic(err)
}
artist := tag.Artist()
album := tag.Album()
title := tag.Title()
```

## Update Tag
```
f, err := os.Open("./my-audio-file.mp3")
if err != nil{
panic(err)
}
tag, err := audiometa.Open(f)
if err != nil{
panic(err)
}
tag.SetArtist("Beyonce")
err = tag.Save(f)
if err != nil{
panic(err)
}
```

## Clear All Tags And Save
```
f, err := os.Open("./my-audio-file.mp3")
if err != nil{
panic(err)
}
tag, err := audiometa.Open(f)
if err != nil{
panic(err)
}
tag.ClearAllTags()
err = tag.Save(f)
if err != nil{
panic(err)
}
```
## Improvements
This version ties together bug fixes in almost every module. Improvements in performance and memory usage along with tons of optimization and testing in each package. Check the CHANGLOG for a comprehensive list of changes.
Loading

0 comments on commit d01c1fc

Please sign in to comment.