Package flac provides access to FLAC streams. Fork of https://github.com/mewkiz/flac
Go to file
Robin Eklind 3e3f4b5fcf
flac: add Encoder API to encode audio samples and metadata blocks (#32)
* flac: encode frame header

* flac: calculate CRC-8 when encoding frame headers

* flac: fix encoding of frame header

* flac: add preliminary subframe encoder

* flac: fix UTF-8 encoding of frame number

* frame: add sanity check for sample count in decodeLPC

Updates #31.

* flac: update flac encoding API, depricate flac.Encode

Encode has been removed in favour of using NewEncoder.
The Encode function was temporarily added to support
re-encoding FLAC streams to update the metadata, but
it had no support for encoding audio samples.

The added flac.Encoder has support for encoding both
metadata and audio samples. It also does not require
that you first decode a FLAC file to later re-encode
it by calling Encode (as was the previous behaviour).

* flac: add MD5 running hash of unencoded audio samples to StreamInfo

* flac: remove unused encodePadding

Reported by golangci

* flac: fix golangci lint issues

	frame/utf8.go:57:6: `decodeUTF8Int` is unused (deadcode)
	func decodeUTF8Int(r io.Reader) (n uint64, err error) {
		  ^
	internal/utf8/encode.go:32:16: unnecessary conversion (unconvert)
			bits = uint64(t2 | (x>>6)&mask2)
							 ^
	internal/utf8/encode.go:37:16: unnecessary conversion (unconvert)
			bits = uint64(t3 | (x>>(6*2))&mask3)
							 ^
	internal/utf8/encode.go:42:16: unnecessary conversion (unconvert)
			bits = uint64(t4 | (x>>(6*3))&mask4)
							 ^

* flac: fix golangci lint issues

	encode_frame.go:89:1: cyclomatic complexity 52 of func `(*Encoder).encodeFrameHeader` is high (> 30) (gocyclo)
	func (enc *Encoder) encodeFrameHeader(w io.Writer, hdr frame.Header) error {
	^
	internal/utf8/encode.go:66:17: unnecessary conversion (unconvert)
			bits := uint64(tx | (x>>uint(6*i))&maskx)
							  ^
	encode_subframe.go:105:46: unnecessary conversion (unconvert)
			if err := bw.WriteBits(uint64(sample), byte(hdr.BitsPerSample)); err != nil {
																	 ^

* flac: clarify that frame.Header.Num is calculated by the encoder

* flac: minor re-phrasing
2018-08-19 03:18:12 +09:00
cmd flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
frame flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
internal flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
meta flac: fix golangci metalint issues 2018-08-18 01:20:48 +09:00
testdata Skip ID3v2 data prepended to flac files on parsing (#21) 2018-05-25 17:27:20 +02:00
.gitignore flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
.travis.yml flac: fix golangci metalint issues 2018-08-18 01:20:48 +09:00
enc_test.go flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
encode.go flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
encode_frame.go flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
encode_meta.go flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
encode_subframe.go flac: add Encoder API to encode audio samples and metadata blocks (#32) 2018-08-19 03:18:12 +09:00
example_test.go flac: Drop use of gopkg.in in import paths. Rely on vendoring instead. 2016-03-07 00:06:54 +01:00
flac.go remove unnecessary conversion 2018-06-06 22:14:00 -04:00
flac_test.go Skip ID3v2 data prepended to flac files on parsing (#21) 2018-05-25 17:27:20 +02:00
go.mod Vendor our dependencies with vgo (#27) 2018-08-17 03:16:13 +09:00
LICENSE Add LICENSE file to follow sensible standards 2017-06-02 09:17:02 +02:00
README.md Add LICENSE file to follow sensible standards 2017-06-02 09:17:02 +02:00

flac

Build Status Coverage Status GoDoc

This package provides access to FLAC (Free Lossless Audio Codec) streams.

Documentation

Documentation provided by GoDoc.

  • flac: provides access to FLAC (Free Lossless Audio Codec) streams.
    • frame: implements access to FLAC audio frames.
    • meta: implements access to FLAC metadata blocks.

Changes

  • Version 1.0.5 (2016-05-06)

    • Simplify import paths. Drop use of gopkg.in, and rely on vendoring instead (see azul3d/engine#1).
    • Add FLAC decoding benchmark (see d675e0a)
  • Version 1.0.4 (2016-02-11)

    • Add API examples to documentation (see #11).
    • Extend test cases (see aadf80a).
  • Version 1.0.3 (2016-02-02)

    • Implement decoding of FLAC files with wasted bits-per-sample (see #12).
    • Stress test the library using go-fuzz (see #10). Thanks to Patrick Mézard.
  • Version 1.0.2 (2015-06-05)

  • Version 1.0.1 (2015-02-25)

    • Fix two subframe decoding bugs (see #7). Thanks to Jonathan MacMillan.
    • Add frame decoding test cases.
  • Version 1.0.0 (2014-09-30)

    • Initial release.
    • Implement decoding of FLAC files.