Chris@40
|
1 /*
|
Chris@40
|
2 ** Copyright (C) 1999-2014 Erik de Castro Lopo <erikd@mega-nerd.com>
|
Chris@40
|
3 **
|
Chris@40
|
4 ** All rights reserved.
|
Chris@40
|
5 **
|
Chris@40
|
6 ** Redistribution and use in source and binary forms, with or without
|
Chris@40
|
7 ** modification, are permitted provided that the following conditions are
|
Chris@40
|
8 ** met:
|
Chris@40
|
9 **
|
Chris@40
|
10 ** * Redistributions of source code must retain the above copyright
|
Chris@40
|
11 ** notice, this list of conditions and the following disclaimer.
|
Chris@40
|
12 ** * Redistributions in binary form must reproduce the above copyright
|
Chris@40
|
13 ** notice, this list of conditions and the following disclaimer in
|
Chris@40
|
14 ** the documentation and/or other materials provided with the
|
Chris@40
|
15 ** distribution.
|
Chris@40
|
16 ** * Neither the author nor the names of any contributors may be used
|
Chris@40
|
17 ** to endorse or promote products derived from this software without
|
Chris@40
|
18 ** specific prior written permission.
|
Chris@40
|
19 **
|
Chris@40
|
20 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
Chris@40
|
21 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
Chris@40
|
22 ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
Chris@40
|
23 ** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
Chris@40
|
24 ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
Chris@40
|
25 ** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
Chris@40
|
26 ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
Chris@40
|
27 ** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
Chris@40
|
28 ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
Chris@40
|
29 ** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
Chris@40
|
30 ** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Chris@40
|
31 */
|
Chris@40
|
32
|
Chris@40
|
33 #include <stdio.h>
|
Chris@40
|
34 #include <stdlib.h>
|
Chris@40
|
35 #include <string.h>
|
Chris@40
|
36 #include <ctype.h>
|
Chris@40
|
37
|
Chris@40
|
38 #include <sndfile.h>
|
Chris@40
|
39
|
Chris@40
|
40 #include "common.h"
|
Chris@40
|
41
|
Chris@40
|
42
|
Chris@40
|
43 typedef struct
|
Chris@40
|
44 { char *infilename, *outfilename ;
|
Chris@40
|
45 SF_INFO infileinfo, outfileinfo ;
|
Chris@40
|
46 } OptionData ;
|
Chris@40
|
47
|
Chris@40
|
48 static void copy_metadata (SNDFILE *outfile, SNDFILE *infile, int channels) ;
|
Chris@40
|
49
|
Chris@40
|
50 static void
|
Chris@40
|
51 usage_exit (const char *progname)
|
Chris@40
|
52 {
|
Chris@40
|
53 printf ("\nUsage : %s [options] [encoding] <input file> <output file>\n", progname) ;
|
Chris@40
|
54 puts ("\n"
|
Chris@40
|
55 " where [option] may be:\n\n"
|
Chris@40
|
56 " -override-sample-rate=X : force sample rate of input to X\n"
|
Chris@40
|
57 " -endian=little : force output file to little endian data\n"
|
Chris@40
|
58 " -endian=big : force output file to big endian data\n"
|
Chris@40
|
59 " -endian=cpu : force output file same endian-ness as the CPU\n"
|
Chris@40
|
60 " -normalize : normalize the data in the output file\n"
|
Chris@40
|
61 ) ;
|
Chris@40
|
62
|
Chris@40
|
63 puts (
|
Chris@40
|
64 " where [encoding] may be one of the following:\n\n"
|
Chris@40
|
65 " -pcms8 : signed 8 bit pcm\n"
|
Chris@40
|
66 " -pcmu8 : unsigned 8 bit pcm\n"
|
Chris@40
|
67 " -pcm16 : 16 bit pcm\n"
|
Chris@40
|
68 " -pcm24 : 24 bit pcm\n"
|
Chris@40
|
69 " -pcm32 : 32 bit pcm\n"
|
Chris@40
|
70 " -float32 : 32 bit floating point\n"
|
Chris@40
|
71 " -ulaw : ULAW\n"
|
Chris@40
|
72 " -alaw : ALAW\n"
|
Chris@40
|
73 " -alac16 : 16 bit ALAC (CAF only)\n"
|
Chris@40
|
74 " -alac20 : 20 bit ALAC (CAF only)\n"
|
Chris@40
|
75 " -alac24 : 24 bit ALAC (CAF only)\n"
|
Chris@40
|
76 " -alac32 : 32 bit ALAC (CAF only)\n"
|
Chris@40
|
77 " -ima-adpcm : IMA ADPCM (WAV only)\n"
|
Chris@40
|
78 " -ms-adpcm : MS ADPCM (WAV only)\n"
|
Chris@40
|
79 " -gsm610 : GSM6.10 (WAV only)\n"
|
Chris@40
|
80 " -dwvw12 : 12 bit DWVW (AIFF only)\n"
|
Chris@40
|
81 " -dwvw16 : 16 bit DWVW (AIFF only)\n"
|
Chris@40
|
82 " -dwvw24 : 24 bit DWVW (AIFF only)\n"
|
Chris@40
|
83 " -vorbis : Vorbis (OGG only)\n"
|
Chris@40
|
84 ) ;
|
Chris@40
|
85
|
Chris@40
|
86 puts (
|
Chris@40
|
87 " If no encoding is specified, the program will try to use the encoding\n"
|
Chris@40
|
88 " of the input file in the output file. This will not always work as\n"
|
Chris@40
|
89 " most container formats (eg WAV, AIFF etc) only support a small subset\n"
|
Chris@40
|
90 " of codec formats (eg 16 bit PCM, a-law, Vorbis etc).\n"
|
Chris@40
|
91 ) ;
|
Chris@40
|
92
|
Chris@40
|
93 puts (
|
Chris@40
|
94 " The format of the output file is determined by the file extension of the\n"
|
Chris@40
|
95 " output file name. The following extensions are currently understood:\n"
|
Chris@40
|
96 ) ;
|
Chris@40
|
97
|
Chris@40
|
98 sfe_dump_format_map () ;
|
Chris@40
|
99
|
Chris@40
|
100 puts ("") ;
|
Chris@40
|
101 exit (1) ;
|
Chris@40
|
102 } /* usage_exit */
|
Chris@40
|
103
|
Chris@40
|
104 static void
|
Chris@40
|
105 report_format_error_exit (const char * argv0, SF_INFO * sfinfo)
|
Chris@40
|
106 { int old_format = sfinfo->format ;
|
Chris@40
|
107 int endian = sfinfo->format & SF_FORMAT_ENDMASK ;
|
Chris@40
|
108
|
Chris@40
|
109 sfinfo->format = old_format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ;
|
Chris@40
|
110
|
Chris@40
|
111 if (endian && sf_format_check (sfinfo))
|
Chris@40
|
112 { printf ("Error : output file format does not support %s endian-ness.\n", sfe_endian_name (endian)) ;
|
Chris@40
|
113 exit (1) ;
|
Chris@40
|
114 } ;
|
Chris@40
|
115
|
Chris@40
|
116 printf ("\n"
|
Chris@40
|
117 "Error : output file format is invalid.\n"
|
Chris@40
|
118 "The '%s' container does not support '%s' codec data.\n"
|
Chris@40
|
119 "Run '%s --help' for clues.\n\n",
|
Chris@40
|
120 sfe_container_name (sfinfo->format), sfe_codec_name (sfinfo->format), program_name (argv0)) ;
|
Chris@40
|
121 exit (1) ;
|
Chris@40
|
122 } /* report_format_error_exit */
|
Chris@40
|
123
|
Chris@40
|
124 int
|
Chris@40
|
125 main (int argc, char * argv [])
|
Chris@40
|
126 { const char *progname, *infilename, *outfilename ;
|
Chris@40
|
127 SNDFILE *infile = NULL, *outfile = NULL ;
|
Chris@40
|
128 SF_INFO sfinfo ;
|
Chris@40
|
129 int k, outfilemajor, outfileminor = 0, infileminor ;
|
Chris@40
|
130 int override_sample_rate = 0 ; /* assume no sample rate override. */
|
Chris@40
|
131 int endian = SF_ENDIAN_FILE, normalize = SF_FALSE ;
|
Chris@40
|
132
|
Chris@40
|
133 progname = program_name (argv [0]) ;
|
Chris@40
|
134
|
Chris@40
|
135 if (argc < 3 || argc > 5)
|
Chris@40
|
136 usage_exit (progname) ;
|
Chris@40
|
137
|
Chris@40
|
138 infilename = argv [argc-2] ;
|
Chris@40
|
139 outfilename = argv [argc-1] ;
|
Chris@40
|
140
|
Chris@40
|
141 if (strcmp (infilename, outfilename) == 0)
|
Chris@40
|
142 { printf ("Error : Input and output filenames are the same.\n\n") ;
|
Chris@40
|
143 usage_exit (progname) ;
|
Chris@40
|
144 } ;
|
Chris@40
|
145
|
Chris@40
|
146 if (strlen (infilename) > 1 && infilename [0] == '-')
|
Chris@40
|
147 { printf ("Error : Input filename (%s) looks like an option.\n\n", infilename) ;
|
Chris@40
|
148 usage_exit (progname) ;
|
Chris@40
|
149 } ;
|
Chris@40
|
150
|
Chris@40
|
151 if (outfilename [0] == '-')
|
Chris@40
|
152 { printf ("Error : Output filename (%s) looks like an option.\n\n", outfilename) ;
|
Chris@40
|
153 usage_exit (progname) ;
|
Chris@40
|
154 } ;
|
Chris@40
|
155
|
Chris@40
|
156 for (k = 1 ; k < argc - 2 ; k++)
|
Chris@40
|
157 { if (! strcmp (argv [k], "-pcms8"))
|
Chris@40
|
158 { outfileminor = SF_FORMAT_PCM_S8 ;
|
Chris@40
|
159 continue ;
|
Chris@40
|
160 } ;
|
Chris@40
|
161 if (! strcmp (argv [k], "-pcmu8"))
|
Chris@40
|
162 { outfileminor = SF_FORMAT_PCM_U8 ;
|
Chris@40
|
163 continue ;
|
Chris@40
|
164 } ;
|
Chris@40
|
165 if (! strcmp (argv [k], "-pcm16"))
|
Chris@40
|
166 { outfileminor = SF_FORMAT_PCM_16 ;
|
Chris@40
|
167 continue ;
|
Chris@40
|
168 } ;
|
Chris@40
|
169 if (! strcmp (argv [k], "-pcm24"))
|
Chris@40
|
170 { outfileminor = SF_FORMAT_PCM_24 ;
|
Chris@40
|
171 continue ;
|
Chris@40
|
172 } ;
|
Chris@40
|
173 if (! strcmp (argv [k], "-pcm32"))
|
Chris@40
|
174 { outfileminor = SF_FORMAT_PCM_32 ;
|
Chris@40
|
175 continue ;
|
Chris@40
|
176 } ;
|
Chris@40
|
177 if (! strcmp (argv [k], "-float32"))
|
Chris@40
|
178 { outfileminor = SF_FORMAT_FLOAT ;
|
Chris@40
|
179 continue ;
|
Chris@40
|
180 } ;
|
Chris@40
|
181 if (! strcmp (argv [k], "-ulaw"))
|
Chris@40
|
182 { outfileminor = SF_FORMAT_ULAW ;
|
Chris@40
|
183 continue ;
|
Chris@40
|
184 } ;
|
Chris@40
|
185 if (! strcmp (argv [k], "-alaw"))
|
Chris@40
|
186 { outfileminor = SF_FORMAT_ALAW ;
|
Chris@40
|
187 continue ;
|
Chris@40
|
188 } ;
|
Chris@40
|
189 if (! strcmp (argv [k], "-alac16"))
|
Chris@40
|
190 { outfileminor = SF_FORMAT_ALAC_16 ;
|
Chris@40
|
191 continue ;
|
Chris@40
|
192 } ;
|
Chris@40
|
193 if (! strcmp (argv [k], "-alac20"))
|
Chris@40
|
194 { outfileminor = SF_FORMAT_ALAC_20 ;
|
Chris@40
|
195 continue ;
|
Chris@40
|
196 } ;
|
Chris@40
|
197 if (! strcmp (argv [k], "-alac24"))
|
Chris@40
|
198 { outfileminor = SF_FORMAT_ALAC_24 ;
|
Chris@40
|
199 continue ;
|
Chris@40
|
200 } ;
|
Chris@40
|
201 if (! strcmp (argv [k], "-alac32"))
|
Chris@40
|
202 { outfileminor = SF_FORMAT_ALAC_32 ;
|
Chris@40
|
203 continue ;
|
Chris@40
|
204 } ;
|
Chris@40
|
205 if (! strcmp (argv [k], "-ima-adpcm"))
|
Chris@40
|
206 { outfileminor = SF_FORMAT_IMA_ADPCM ;
|
Chris@40
|
207 continue ;
|
Chris@40
|
208 } ;
|
Chris@40
|
209 if (! strcmp (argv [k], "-ms-adpcm"))
|
Chris@40
|
210 { outfileminor = SF_FORMAT_MS_ADPCM ;
|
Chris@40
|
211 continue ;
|
Chris@40
|
212 } ;
|
Chris@40
|
213 if (! strcmp (argv [k], "-gsm610"))
|
Chris@40
|
214 { outfileminor = SF_FORMAT_GSM610 ;
|
Chris@40
|
215 continue ;
|
Chris@40
|
216 } ;
|
Chris@40
|
217 if (! strcmp (argv [k], "-dwvw12"))
|
Chris@40
|
218 { outfileminor = SF_FORMAT_DWVW_12 ;
|
Chris@40
|
219 continue ;
|
Chris@40
|
220 } ;
|
Chris@40
|
221 if (! strcmp (argv [k], "-dwvw16"))
|
Chris@40
|
222 { outfileminor = SF_FORMAT_DWVW_16 ;
|
Chris@40
|
223 continue ;
|
Chris@40
|
224 } ;
|
Chris@40
|
225 if (! strcmp (argv [k], "-dwvw24"))
|
Chris@40
|
226 { outfileminor = SF_FORMAT_DWVW_24 ;
|
Chris@40
|
227 continue ;
|
Chris@40
|
228 } ;
|
Chris@40
|
229 if (! strcmp (argv [k], "-vorbis"))
|
Chris@40
|
230 { outfileminor = SF_FORMAT_VORBIS ;
|
Chris@40
|
231 continue ;
|
Chris@40
|
232 } ;
|
Chris@40
|
233
|
Chris@40
|
234 if (strstr (argv [k], "-override-sample-rate=") == argv [k])
|
Chris@40
|
235 { const char *ptr ;
|
Chris@40
|
236
|
Chris@40
|
237 ptr = argv [k] + strlen ("-override-sample-rate=") ;
|
Chris@40
|
238 override_sample_rate = atoi (ptr) ;
|
Chris@40
|
239 continue ;
|
Chris@40
|
240 } ;
|
Chris@40
|
241
|
Chris@40
|
242 if (! strcmp (argv [k], "-endian=little"))
|
Chris@40
|
243 { endian = SF_ENDIAN_LITTLE ;
|
Chris@40
|
244 continue ;
|
Chris@40
|
245 } ;
|
Chris@40
|
246
|
Chris@40
|
247 if (! strcmp (argv [k], "-endian=big"))
|
Chris@40
|
248 { endian = SF_ENDIAN_BIG ;
|
Chris@40
|
249 continue ;
|
Chris@40
|
250 } ;
|
Chris@40
|
251
|
Chris@40
|
252 if (! strcmp (argv [k], "-endian=cpu"))
|
Chris@40
|
253 { endian = SF_ENDIAN_CPU ;
|
Chris@40
|
254 continue ;
|
Chris@40
|
255 } ;
|
Chris@40
|
256
|
Chris@40
|
257 if (! strcmp (argv [k], "-endian=file"))
|
Chris@40
|
258 { endian = SF_ENDIAN_FILE ;
|
Chris@40
|
259 continue ;
|
Chris@40
|
260 } ;
|
Chris@40
|
261
|
Chris@40
|
262 if (! strcmp (argv [k], "-normalize"))
|
Chris@40
|
263 { normalize = SF_TRUE ;
|
Chris@40
|
264 continue ;
|
Chris@40
|
265 } ;
|
Chris@40
|
266
|
Chris@40
|
267 printf ("Error : Not able to decode argunment '%s'.\n", argv [k]) ;
|
Chris@40
|
268 exit (1) ;
|
Chris@40
|
269 } ;
|
Chris@40
|
270
|
Chris@40
|
271 memset (&sfinfo, 0, sizeof (sfinfo)) ;
|
Chris@40
|
272
|
Chris@40
|
273 if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL)
|
Chris@40
|
274 { printf ("Not able to open input file %s.\n", infilename) ;
|
Chris@40
|
275 puts (sf_strerror (NULL)) ;
|
Chris@40
|
276 return 1 ;
|
Chris@40
|
277 } ;
|
Chris@40
|
278
|
Chris@40
|
279 /* Update sample rate if forced to something else. */
|
Chris@40
|
280 if (override_sample_rate)
|
Chris@40
|
281 sfinfo.samplerate = override_sample_rate ;
|
Chris@40
|
282
|
Chris@40
|
283 infileminor = sfinfo.format & SF_FORMAT_SUBMASK ;
|
Chris@40
|
284
|
Chris@40
|
285 if ((sfinfo.format = sfe_file_type_of_ext (outfilename, sfinfo.format)) == 0)
|
Chris@40
|
286 { printf ("Error : Not able to determine output file type for %s.\n", outfilename) ;
|
Chris@40
|
287 return 1 ;
|
Chris@40
|
288 } ;
|
Chris@40
|
289
|
Chris@40
|
290 outfilemajor = sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_ENDMASK) ;
|
Chris@40
|
291
|
Chris@40
|
292 if (outfileminor == 0)
|
Chris@40
|
293 outfileminor = sfinfo.format & SF_FORMAT_SUBMASK ;
|
Chris@40
|
294
|
Chris@40
|
295 if (outfileminor != 0)
|
Chris@40
|
296 sfinfo.format = outfilemajor | outfileminor ;
|
Chris@40
|
297 else
|
Chris@40
|
298 sfinfo.format = outfilemajor | (sfinfo.format & SF_FORMAT_SUBMASK) ;
|
Chris@40
|
299
|
Chris@40
|
300 sfinfo.format |= endian ;
|
Chris@40
|
301
|
Chris@40
|
302 if ((sfinfo.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_XI)
|
Chris@40
|
303 switch (sfinfo.format & SF_FORMAT_SUBMASK)
|
Chris@40
|
304 { case SF_FORMAT_PCM_16 :
|
Chris@40
|
305 sfinfo.format = outfilemajor | SF_FORMAT_DPCM_16 ;
|
Chris@40
|
306 break ;
|
Chris@40
|
307
|
Chris@40
|
308 case SF_FORMAT_PCM_S8 :
|
Chris@40
|
309 case SF_FORMAT_PCM_U8 :
|
Chris@40
|
310 sfinfo.format = outfilemajor | SF_FORMAT_DPCM_8 ;
|
Chris@40
|
311 break ;
|
Chris@40
|
312 } ;
|
Chris@40
|
313
|
Chris@40
|
314 if (sf_format_check (&sfinfo) == 0)
|
Chris@40
|
315 report_format_error_exit (argv [0], &sfinfo) ;
|
Chris@40
|
316
|
Chris@40
|
317 if ((sfinfo.format & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 && sfinfo.samplerate != 8000)
|
Chris@40
|
318 { printf (
|
Chris@40
|
319 "WARNING: GSM 6.10 data format only supports 8kHz sample rate. The converted\n"
|
Chris@40
|
320 "ouput file will contain the input data converted to the GSM 6.10 data format\n"
|
Chris@40
|
321 "but not re-sampled.\n"
|
Chris@40
|
322 ) ;
|
Chris@40
|
323 } ;
|
Chris@40
|
324
|
Chris@40
|
325 /* Open the output file. */
|
Chris@40
|
326 if ((outfile = sf_open (outfilename, SFM_WRITE, &sfinfo)) == NULL)
|
Chris@40
|
327 { printf ("Not able to open output file %s : %s\n", outfilename, sf_strerror (NULL)) ;
|
Chris@40
|
328 return 1 ;
|
Chris@40
|
329 } ;
|
Chris@40
|
330
|
Chris@40
|
331 /* Copy the metadata */
|
Chris@40
|
332 copy_metadata (outfile, infile, sfinfo.channels) ;
|
Chris@40
|
333
|
Chris@40
|
334 if (normalize
|
Chris@40
|
335 || (outfileminor == SF_FORMAT_DOUBLE) || (outfileminor == SF_FORMAT_FLOAT)
|
Chris@40
|
336 || (infileminor == SF_FORMAT_DOUBLE) || (infileminor == SF_FORMAT_FLOAT)
|
Chris@40
|
337 || (infileminor == SF_FORMAT_VORBIS) || (outfileminor == SF_FORMAT_VORBIS))
|
Chris@40
|
338 sfe_copy_data_fp (outfile, infile, sfinfo.channels, normalize) ;
|
Chris@40
|
339 else
|
Chris@40
|
340 sfe_copy_data_int (outfile, infile, sfinfo.channels) ;
|
Chris@40
|
341
|
Chris@40
|
342 sf_close (infile) ;
|
Chris@40
|
343 sf_close (outfile) ;
|
Chris@40
|
344
|
Chris@40
|
345 return 0 ;
|
Chris@40
|
346 } /* main */
|
Chris@40
|
347
|
Chris@40
|
348 static void
|
Chris@40
|
349 copy_metadata (SNDFILE *outfile, SNDFILE *infile, int channels)
|
Chris@40
|
350 { SF_INSTRUMENT inst ;
|
Chris@40
|
351 SF_CUES cues ;
|
Chris@40
|
352 SF_BROADCAST_INFO_2K binfo ;
|
Chris@40
|
353 const char *str ;
|
Chris@40
|
354 int k, chanmap [256] ;
|
Chris@40
|
355
|
Chris@40
|
356 for (k = SF_STR_FIRST ; k <= SF_STR_LAST ; k++)
|
Chris@40
|
357 { str = sf_get_string (infile, k) ;
|
Chris@40
|
358 if (str != NULL)
|
Chris@40
|
359 sf_set_string (outfile, k, str) ;
|
Chris@40
|
360 } ;
|
Chris@40
|
361
|
Chris@40
|
362 memset (&inst, 0, sizeof (inst)) ;
|
Chris@40
|
363 memset (&cues, 0, sizeof (cues)) ;
|
Chris@40
|
364 memset (&binfo, 0, sizeof (binfo)) ;
|
Chris@40
|
365
|
Chris@40
|
366 if (channels < ARRAY_LEN (chanmap))
|
Chris@40
|
367 { size_t size = channels * sizeof (chanmap [0]) ;
|
Chris@40
|
368
|
Chris@40
|
369 if (sf_command (infile, SFC_GET_CHANNEL_MAP_INFO, chanmap, size) == SF_TRUE)
|
Chris@40
|
370 sf_command (outfile, SFC_SET_CHANNEL_MAP_INFO, chanmap, size) ;
|
Chris@40
|
371 } ;
|
Chris@40
|
372
|
Chris@40
|
373 if (sf_command (infile, SFC_GET_CUE, &cues, sizeof (cues)) == SF_TRUE)
|
Chris@40
|
374 sf_command (outfile, SFC_SET_CUE, &cues, sizeof (cues)) ;
|
Chris@40
|
375
|
Chris@40
|
376 if (sf_command (infile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) == SF_TRUE)
|
Chris@40
|
377 sf_command (outfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ;
|
Chris@40
|
378
|
Chris@40
|
379 if (sf_command (infile, SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo)) == SF_TRUE)
|
Chris@40
|
380 sf_command (outfile, SFC_SET_BROADCAST_INFO, &binfo, sizeof (binfo)) ;
|
Chris@40
|
381
|
Chris@40
|
382 } /* copy_metadata */
|
Chris@40
|
383
|