Skip to content

Commit

Permalink
Merge pull request #378 from ktmf01/flac-32bps
Browse files Browse the repository at this point in the history
Add sample size entry to list for 32bps flac streams
  • Loading branch information
wader authored Aug 18, 2022
2 parents 429e189 + fb583e2 commit f11be8b
Show file tree
Hide file tree
Showing 6 changed files with 2,378 additions and 14 deletions.
2 changes: 1 addition & 1 deletion format/flac/flac_frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func frameDecode(d *decode.D, in any) any {
0b100: {Sym: uint64(16)},
0b101: {Sym: uint64(20)},
0b110: {Sym: uint64(24)},
0b111: {Description: "reserved"},
0b111: {Sym: uint64(32)},
}
sampleSizeS := d.FieldScalarU3("sample_size", sampleSizeMap, scalar.ActualBin)
switch sampleSizeS.ActualU() {
Expand Down
31 changes: 18 additions & 13 deletions format/flac/testdata/gen
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,32 @@ ffmpeg \
[6:0][7:0]amerge=inputs=2[merge3];
[8:0][9:0]amerge=inputs=2[merge4];
[merge0][merge1][merge2][merge3][merge4]concat=n=5:v=0:a=1[concat0];
[concat0]asplit=outputs=6[out0][out1][out2][out3][out4][out5]' \
[concat0]aresample=48000[resample0];[resample0]aresample=44100[resample1];
[resample1]asplit=outputs=8[out0][out1][out2][out3][out4][out5][out6][out7]' \
-map '[out0]' -ar 44100 -ac 1 -c:a pcm_u8 -f wav mono8.wav \
-map '[out1]' -ar 44100 -ac 1 -c:a pcm_s16le -f wav mono16.wav \
-map '[out2]' -ar 44100 -ac 1 -c:a pcm_s24le -f wav mono24.wav \
-map '[out3]' -ar 44100 -ac 2 -c:a pcm_u8 -f wav stereo8.wav \
-map '[out4]' -ar 44100 -ac 2 -c:a pcm_s16le -f wav stereo16.wav \
-map '[out5]' -ar 44100 -ac 2 -c:a pcm_s24le -f wav stereo24.wav
flac -fo mono8.flac mono8.wav
flac -fo mono16.flac mono16.wav
flac -fo mono24.flac mono24.wav
flac -fo stereo8.flac stereo8.wav
flac -fo stereo16.flac stereo16.wav
flac -fo stereo24.flac stereo24.wav
rm -f mono8.wav mono16.wav mono24.wav
rm -f stereo8.wav stereo16.wav stereo24.wav
-map '[out3]' -ar 44100 -ac 1 -c:a pcm_s32le -f wav mono32.wav \
-map '[out4]' -ar 44100 -ac 2 -c:a pcm_u8 -f wav stereo8.wav \
-map '[out5]' -ar 44100 -ac 2 -c:a pcm_s16le -f wav stereo16.wav \
-map '[out6]' -ar 44100 -ac 2 -c:a pcm_s24le -f wav stereo24.wav \
-map '[out7]' -ar 44100 -ac 2 -c:a pcm_s32le -f wav stereo32.wav
~/bin/flac-ktmf01/src/flac/flac -fo mono8.flac mono8.wav
~/bin/flac-ktmf01/src/flac/flac -fo mono16.flac mono16.wav
~/bin/flac-ktmf01/src/flac/flac -fo mono24.flac mono24.wav
~/bin/flac-ktmf01/src/flac/flac -fo mono32.flac mono32.wav
~/bin/flac-ktmf01/src/flac/flac -fo stereo8.flac stereo8.wav
~/bin/flac-ktmf01/src/flac/flac -fo stereo16.flac stereo16.wav
~/bin/flac-ktmf01/src/flac/flac -fo stereo24.flac stereo24.wav
~/bin/flac-ktmf01/src/flac/flac -fo stereo32.flac stereo32.wav
rm -f mono8.wav mono16.wav mono24.wav mono32.wav
rm -f stereo8.wav stereo16.wav stereo24.wav stereo32.wav

ffmpeg -y -t 10ms -f lavfi -i sine picture_seek_gain.flac
gm convert -size 4x4 "xc:#000" 4x4.png
metaflac --add-replay-gain --add-seekpoint=10 --import-picture-from 4x4.png picture_seek_gain.flac
rm -f 4x4.png

for i in mono8 mono16 mono24 stereo8 stereo16 stereo24 picture_seek_gain; do
for i in mono8 mono16 mono24 mono32 stereo8 stereo16 stereo24 stereo32 picture_seek_gain; do
echo "\$ fq -d flac dv $i.flac" >$i.fqtest
done
Binary file added format/flac/testdata/mono32.flac
Binary file not shown.
Loading

0 comments on commit f11be8b

Please sign in to comment.