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 [ -f /bin/sh.exe ] ; then
38 if flac --verify -0 --output-name=$flacfile --force-raw-format --endian=big --sign=signed --channels=1 --bps=8 --sample-rate=44100 $inputfile ; then
41 echo "ERROR during generation" 1>&2
48 if [ $exit_code != 0 ] ; then
49 echo "ERROR, exit code = $exit_code" 1>&2
56 if flac --silent --test $flacfile ; then : ; else
57 echo "ERROR in $flacfile" 1>&2
64 (set -x && metaflac --list $flacfile)
70 --show-min-blocksize \
71 --show-max-blocksize \
72 --show-min-framesize \
73 --show-max-framesize \
77 --show-total-samples \
82 (set -x && metaflac --preserve-modtime --add-padding=12345 $flacfile)
86 # some flavors of /bin/sh (e.g. Darwin's) won't handle even quoted spaces, so we underscore:
87 (set -x && metaflac --set-vc-field="ARTIST=The_artist_formerly_known_as_the_artist..." $flacfile)
91 (set -x && metaflac --set-vc-field="ARTIST=Chuck_Woolery" $flacfile)
95 (set -x && metaflac --set-vc-field="ARTIST=Vern" $flacfile)
99 (set -x && metaflac --set-vc-field="TITLE=He_who_smelt_it_dealt_it" $flacfile)
103 (set -x && metaflac --show-vc-vendor --show-vc-field=ARTIST $flacfile)
106 (set -x && metaflac --remove-vc-firstfield=ARTIST $flacfile)
110 (set -x && metaflac --remove-vc-field=ARTIST $flacfile)
114 (set -x && metaflac --list --block-number=0 $flacfile)
117 (set -x && metaflac --list --block-number=1,2,999 $flacfile)
120 (set -x && metaflac --list --block-type=VORBIS_COMMENT,PADDING $flacfile)
123 (set -x && metaflac --list --except-block-type=SEEKTABLE,VORBIS_COMMENT $flacfile)
126 (set -x && metaflac --add-padding=4321 $flacfile $flacfile)
130 (set -x && metaflac --merge-padding $flacfile)
134 (set -x && metaflac --add-padding=0 $flacfile)
138 (set -x && metaflac --sort-padding $flacfile)
142 (set -x && metaflac --add-padding=0 $flacfile)
146 (set -x && metaflac --remove-vc-all $flacfile)
150 (set -x && metaflac --remove --block-number=1,99 --dont-use-padding $flacfile)
154 (set -x && metaflac --remove --block-number=99 --dont-use-padding $flacfile)
158 (set -x && metaflac --remove --block-type=PADDING $flacfile)
162 (set -x && metaflac --remove --block-type=PADDING --dont-use-padding $flacfile)
166 (set -x && metaflac --add-padding=0 $flacfile $flacfile)
170 (set -x && metaflac --remove --except-block-type=PADDING $flacfile)
174 (set -x && metaflac --remove-all $flacfile)
178 (set -x && metaflac --remove-all --dont-use-padding $flacfile)
182 (set -x && metaflac --remove-all --dont-use-padding $flacfile)
186 (set -x && metaflac --set-vc-field="f=0123456789abcdefghij" $flacfile)
189 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
192 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789abcdefghi" $flacfile)
195 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
198 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789abcde" $flacfile)
201 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
204 (set -x && metaflac --remove-vc-all --set-vc-field="f=0" $flacfile)
207 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
210 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789" $flacfile)
213 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
216 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789abcdefghi" $flacfile)
219 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
222 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789" $flacfile)
225 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
228 (set -x && metaflac --remove-vc-all --set-vc-field="f=0123456789abcdefghij" $flacfile)
231 (set -x && metaflac --list --except-block-type=STREAMINFO $flacfile)
234 (set -x && echo "TITLE=Tittle" | metaflac --import-vc-from=- $flacfile)
237 (set -x && metaflac --list --block-type=VORBIS_COMMENT $flacfile)
244 (set -x && metaflac --import-vc-from=vc.txt $flacfile)
247 (set -x && metaflac --list --block-type=VORBIS_COMMENT $flacfile)