3 # FLAC - Free Lossless Audio Codec
4 # Copyright (C) 2002 Josh Coalson
6 # This program is part of FLAC; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 LD_LIBRARY_PATH=../src/libFLAC/.libs:../obj/lib:$LD_LIBRARY_PATH
21 export LD_LIBRARY_PATH
22 PATH=../src/flac:../src/metaflac:../obj/bin:$PATH
24 flacfile=metaflac.flac
26 flac --help 1>/dev/null 2>/dev/null || (echo "ERROR can't find flac executable" 1>&2 && exit 1)
27 if [ $? != 0 ] ; then exit 1 ; fi
29 metaflac --help 1>/dev/null 2>/dev/null || (echo "ERROR can't find metaflac executable" 1>&2 && exit 1)
30 if [ $? != 0 ] ; then exit 1 ; fi
32 echo "Generating stream..."
33 if flac --verify -0 --output-name=$flacfile --force-raw-format --endian=big --sign=signed --channels=1 --bps=8 --sample-rate=44100 /bin/sh ; then
36 echo "ERROR during generation" 1>&2
43 if [ $exit_code != 0 ] ; then
44 echo "ERROR, exit code = $exit_code" 1>&2
51 if flac --silent --test $flacfile ; then : ; else
52 echo "ERROR in $flacfile" 1>&2
59 (set -x && metaflac --list $flacfile)
65 --show-min-blocksize \
66 --show-max-blocksize \
67 --show-min-framesize \
68 --show-max-framesize \
72 --show-total-samples \
77 (set -x && metaflac --preserve-modtime --add-padding=12345 $flacfile)
81 # some flavors of /bin/sh (e.g. Darwin's) won't handle even quoted spaces, so we underscore:
82 (set -x && metaflac --set-vc-field="ARTIST=The_artist_formerly_known_as_the_artist..." $flacfile)
86 (set -x && metaflac --set-vc-field="ARTIST=Chuck_Woolery" $flacfile)
90 (set -x && metaflac --set-vc-field="ARTIST=Vern" $flacfile)
94 (set -x && metaflac --set-vc-field="TITLE=He_who_smelt_it_dealt_it" $flacfile)
98 (set -x && metaflac --show-vc-vendor --show-vc-field=ARTIST $flacfile)
101 (set -x && metaflac --remove-vc-firstfield=ARTIST $flacfile)
105 (set -x && metaflac --remove-vc-field=ARTIST $flacfile)
109 (set -x && metaflac --list --block-number=0 $flacfile)
112 (set -x && metaflac --list --block-number=1,2,999 $flacfile)
115 (set -x && metaflac --list --block-type=VORBIS_COMMENT,PADDING $flacfile)
118 (set -x && metaflac --list --except-block-type=SEEKTABLE,VORBIS_COMMENT $flacfile)
121 (set -x && metaflac --add-padding=4321 $flacfile $flacfile)
125 (set -x && metaflac --merge-padding $flacfile)
129 (set -x && metaflac --add-padding=0 $flacfile)
133 (set -x && metaflac --sort-padding $flacfile)
137 (set -x && metaflac --add-padding=0 $flacfile)
141 (set -x && metaflac --remove-vc-all $flacfile)
145 (set -x && metaflac --remove --block-number=1,99 --dont-use-padding $flacfile)
149 (set -x && metaflac --remove --block-number=99 --dont-use-padding $flacfile)
153 (set -x && metaflac --remove --block-type=PADDING $flacfile)
157 (set -x && metaflac --remove --block-type=PADDING --dont-use-padding $flacfile)
161 (set -x && metaflac --add-padding=0 $flacfile $flacfile)
165 (set -x && metaflac --remove --except-block-type=PADDING $flacfile)
169 (set -x && metaflac --remove-all $flacfile)
173 (set -x && metaflac --remove-all --dont-use-padding $flacfile)
177 (set -x && metaflac --remove-all --dont-use-padding $flacfile)
181 (set -x && metaflac --set-vc-field="f=0123456789abcdefghij" $flacfile)
184 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
187 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789abcdefghi" $flacfile)
190 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
193 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789abcde" $flacfile)
196 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
199 (set -x && metaflac --remove-vc-all --set-vc-field="f=0" $flacfile)
202 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
205 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789" $flacfile)
208 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
211 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789abcdefghi" $flacfile)
214 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
217 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789" $flacfile)
220 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
223 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789abcdefghij" $flacfile)
226 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)