Skip to content

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.

// 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).

}

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