Skip to content

Commit

Permalink
fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petercsiba committed Nov 17, 2023
1 parent b18e5f0 commit 157d403
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions frame/frame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func TestFrameHash(t *testing.T) {
got := md5sum.Sum(nil)
// Verify the decoded audio samples by comparing the MD5 checksum that is
// stored in StreamInfo with the computed one.
// TODO WELP, seems OpenAI is moving so fast they don't even have time to compute checksums :/
// frame_test.go:124: path="../testdata/24000-tts-sf.flac": MD5 checksum mismatch for decoded audio samples;
// expected 00000000000000000000000000000000, got f5e621f2580ee8ace6158966793abdbf
if !bytes.Equal(got, want) {
t.Errorf("path=%q: MD5 checksum mismatch for decoded audio samples; expected %32x, got %32x", g.path, want, got)
}
Expand Down
12 changes: 9 additions & 3 deletions meta/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,19 @@ var golden = []struct {
},
},
},
// TODO reviewer: These values look weird, Apple Music cannot play it, but ffmpeg converts it just fine
// ffmpeg -i testdata/24000-tts-sf.flac -acodec pcm_s16le converted.wav
{
path: "../testdata/24000-tts-sf.flac",
info: &meta.StreamInfo{BlockSizeMin: 0x1200, BlockSizeMax: 0x1200, FrameSizeMin: 0x94d, FrameSizeMax: 0x264a, SampleRate: 0xac44, NChannels: 0x2, BitsPerSample: 0x10, NSamples: 0x50f4, MD5sum: [16]uint8{0x63, 0x28, 0xed, 0x6d, 0xd3, 0xe, 0x55, 0xfb, 0xa5, 0x73, 0x69, 0x2b, 0xb7, 0x35, 0x73, 0xb7}},
info: &meta.StreamInfo{BlockSizeMin: 0x1000, BlockSizeMax: 0x1000, FrameSizeMin: 0x0, FrameSizeMax: 0x0, SampleRate: 0x5dc0, NChannels: 0x1, BitsPerSample: 0x10, NSamples: 0x0, MD5sum: [16]uint8{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
blocks: []*meta.Block{
{
Header: meta.Header{Type: 0x4, Length: 40, IsLast: true},
Body: &meta.VorbisComment{Vendor: "reference libFLAC 1.2.1 20070917", Tags: nil},
Header: meta.Header{Type: 0x4, Length: 40, IsLast: false},
Body: &meta.VorbisComment{Vendor: "reference libFLAC 1.3.3 20190804", Tags: [][2]string(nil)},
},
{
Header: meta.Header{Type: 0x1, Length: 8192, IsLast: true},
Body: nil,
},
},
},
Expand Down

0 comments on commit 157d403

Please sign in to comment.