Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand the metadata of flac, now you can read the STREAMIN block #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mitsuha
Copy link

@Mitsuha Mitsuha commented May 5, 2024

Added more metadata fields for FLAC and made MetadataFLAC public.

This is the first commit, next I will add more fields for formats like mp3, MP4, OGG, etc. Once everything is done, I will add a Duration interface to type Metadata interface

Copy link
Owner

@dhowden dhowden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the change!

I think you might have exported metadataFLAC -> MetadataFLAC so that you could access the extra information?

Instead, can you add the information in to the Raw() output? You should then be able to keep the public API the same for now.

You can create some keys in Raw for you new values (FLACSampleRate, FLACTotalSamples and FLACDuration will make sure they shouldn't clash with the general output from vorbis).

Once we have a handful of types supporting Duration etc we can do something about the interface. I suspect that it might be nicer to create a new interface so that the remaining implementations don't return empty values.

@@ -14,7 +14,7 @@ type blockType byte

// FLAC block types.
const (
// Stream Info Block 0
StreamInfoBlock blockType = 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be unexported (like the rest of the enum values).

@@ -51,18 +51,24 @@ func ReadFLACTags(r io.ReadSeeker) (Metadata, error) {
return m, nil
}

type metadataFLAC struct {
type MetadataFLAC struct {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should remain unexported (we don't want to widen the surface area of the API)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants