mewkiz / flac

Package flac provides access to FLAC (Free Lossless Audio Codec) streams.
The Unlicense
316 stars 43 forks source link

Any plans for replaygain scanning support? #36

Open koiuo opened 5 years ago

koiuo commented 5 years ago

Hi. I found this project via search and it looks amazing. I haven't yet had a chance to look at it in detail, so I'm sorry if missed obvious answers to my questions.

Do you think it's worth implementing a feature that repeats metaflac --add-replay-gain behavior? Does this feature even belong here?

Or should I instead use this project to decode flac to pcm and use something else to determine loudness? Do you happen to know go libraries that would do that?

Thanks

wsc1 commented 5 years ago

I don't know of Go libraries that currently support replay-gain, but there is one related project zikichombo which would be either a good place to house replay-gain or a good basis on which to implement it for flac or other codecs. The project is new, in alpha, and does not yet have resources to plan releases. So depending on your timeline, production needs, etc, it may or may not help. But it is at least one option to look at.

mewmew commented 5 years ago

Hi. I found this project via search and it looks amazing. I haven't yet had a chance to look at it in detail, so I'm sorry if missed obvious answers to my questions.

Hi @edio!

Glad to hear from you and happy to hear that you like the project from a 10,000 feet view. Ask away, and we'll see if we can answer :) Note, we are audio hobbyists, so it may very well be that you have better answers for some questions than we do. In which case, consider yourself invited, both to discussions and also further development (see https://github.com/mewkiz/flac/issues/33 and https://github.com/mewkiz/flac/issues/19 if interested).

Do you think it's worth implementing a feature that repeats metaflac --add-replay-gain behavior? Does this feature even belong here?

There is actually a go-metaflac command which mimics the functionality of metaflac. It currently supports all --list-foo flags, but does not have support for modifying metadata. Re-encoding of metadata is fully implemented. However it should be noted that the re-encoding of audio samples is not yet fully supported. The encoding API was updated with PR https://github.com/mewkiz/flac/pull/32, and as such, the metaflac command is not yet ported to make use of the new API. This will definitely happen, but implementing support for LPC (https://github.com/mewkiz/flac/issues/35) is a prerequisite for this.

If you are interested to peek under the hood, feel free to explore the internals of the project, and let us know if you'd be interested in getting involved with coding audio libraries in Go :)

Once https://github.com/mewkiz/flac/issues/35 is implemented, it would definitely make sense to implement the commands of metaflac just to stress test the API. As such, support for --add-replay-gain would be added.

Happy coding!

Cheers Henry and Robin