1"wav2cdr(1)                                                          wav2cdr(1)\n"
2"\n"
3"NAME\n"
4"       wav2cdr  -  converts  input in (or similar to) wav format to cdr format\n"
5"       suitable for writing onto audio CDs.\n"
6"\n"
7"SYNOPSIS\n"
8"       wav2cdr [options ...] [infile [outfile]] [--cut cutnumber ...]\n"
9"\n"
10"VERSION\n"
11"       This man page describes wav2cdr version 2.3.4.\n"
12"\n"
13"DESCRIPTION\n"
14"       wav2cdr is a conversion program for audio data which  adopts  automati-\n"
15"       cally to big and little endian machines. Its primary use was to convert\n"
16"       wav to cdr, but it is a little more flexible now and  can  handle  some\n"
17"       file formats and perform some operations on the data. These formats are\n"
18"       possible (reading and writing):\n"
19"\n"
20"           wav   MS Windows sound\n"
21"           cdr   audio CD\n"
22"           raw   fixed sampling rate, channels, and bytes per sample\n"
23"                 (= that of cdr); byte order must be specified\n"
24"\n"
25"       These operations can be performed on the data (combinations are  possi-\n"
26"       ble as long as they are meaningful):\n"
27"\n"
28"           Scaling (volume change), integer arithmetic\n"
29"           Scaling (volume change), floating point arithmetic\n"
30"           Cutting of the input into pieces / tracks\n"
31"           Conversion to mono and back to stereo\n"
32"           Swapping of the 2 channels\n"
33"           Adding silence to (or removing from, see cutting) the\n"
34"             start and/or end\n"
35"           Generation of cut numbers along silent intervals, e.g.\n"
36"             to break up a record into tracks\n"
37"           Information about non-silent intervals\n"
38"           Fading in and out\n"
39"\n"
40"OPTIONS\n"
41"       --cut NUM NUM [NUM...]\n"
42"              Cut  the  input into pieces, cutting at positions NUM.  See sec-\n"
43"              tions about argument scanning and splitting below.\n"
44"\n"
45"       --endsilence, --es DUR\n"
46"              Adds the given amount of silence to the end of each output file.\n"
47"\n"
48"       --fadein LEN\n"
49"              Fade in at the start over a duration of LEN.  The syntax for LEN\n"
50"              is the same as for a cut  number,  see  section  about  argument\n"
51"              scanning below.  If cutting is active, fade-in is applied to the\n"
52"              beginning of each cut.\n"
53"\n"
54"              Fading in is performed by increasing the amplitude for  CD  sec-\n"
55"              tors  by  an  amount  derived  from  LEN over a duration of LEN.\n"
56"              --fadein 3 would result in the amplitude  of  the  first  sector\n"
57"              lowered  to 1/4, of the second sector to 2/4, and the third sec-\n"
58"              tor to 3/4. The fourth sector is unchanged and has then  reached\n"
59"              full amplitude.\n"
60"\n"
61"       --fadeout LEN\n"
62"              Fade  out at the end over a duration of LEN.  The syntax for LEN\n"
63"              is the same as for a cut  number,  see  section  about  argument\n"
64"              scanning below.  If cutting is active, fad-out is applied to the\n"
65"              end of each cut.\n"
66"\n"
67"              The computation is similar to --fadein. --fadein 3 would  result\n"
68"              in the last 3 CD sectors having their amplitudes lowered to 3/4,\n"
69"              2/4, and 1/4. The (non-existant) following sector is assumed  to\n"
70"              be silent.\n"
71"\n"
72"              To add silent sector(s) to the end of the audio file, use --end-\n"
73"              silence.\n"
74"\n"
75"              Fading out can only be performed if the input size can be deter-\n"
76"              mined (i.e. the input must be seekable and cannot be a pipe). If\n"
77"              cutting is active, the end of the cut is always  known  and  the\n"
78"              fade-out can be applied.\n"
79"\n"
80"              If the fade-out starts before the fade-in is finished, both will\n"
81"              overlap, producing sensible results.\n"
82"\n"
83"       --fscale FLOAT\n"
84"              Scale data by FLOAT, i.e. multiply by FLOAT (1.0 does  nothing).\n"
85"\n"
86"       -h, -u, --usage\n"
87"              Display usage.\n"
88"\n"
89"       --help Display  extensive  help.  (The  information is derived from and\n"
90"              equivalent to this manual page.)\n"
91"\n"
92"       --inbig, -I\n"
93"              Input data is big endian (MSB, LSB) (Motorola).\n"
94"\n"
95"       --incdr\n"
96"              Read cdr format (default is wav). Sets the correct byte order.\n"
97"\n"
98"       --infile, -r NAME\n"
99"              Input filename. Defaults to stdin. '-' = stdin.\n"
100"\n"
101"       --inlittle, -i\n"
102"              Input data is little endian (LSB, MSB) (Intel).\n"
103"\n"
104"       --inraw\n"
105"              Read raw format. Byte  order  should  be  specified  with  -i/-I\n"
106"              (default big).\n"
107"\n"
108"       --inwav\n"
109"              Read wav format (default). Sets the correct byte order.\n"
110"\n"
111"       --iscale NUM\n"
112"              Scale data to NUM percent (100 does nothing).\n"
113"\n"
114"       --monostereo\n"
115"              Convert input to mono and immediately back to stereo. The result\n"
116"              is 2 channels with the same data. This can  be  useful  in  some\n"
117"              cases.\n"
118"\n"
119"       --noswapchannels\n"
120"              Don't swap channels. (default)\n"
121"\n"
122"       --outfile, -w NAME\n"
123"              Write  output  to  file NAME.  The track number is appended as a\n"
124"              2-digit number.  The default is to write output  to  stdout.   A\n"
125"              NAME  of '-' means stdout.  When cutting is active and more than\n"
126"              one cut is made, output can not be written to stdout and the use\n"
127"              of this option is mandatory.\n"
128"\n"
129"       --outbig, -O\n"
130"              Output data in big endian (MSB, LSB) (Motorola) byte order.\n"
131"\n"
132"       --outlittle, -o\n"
133"              Output data in little endian (LSB, MSB) (Intel) byte order.\n"
134"\n"
135"       --quiet\n"
136"              Suppress progress output.  The name of this option might be mis-\n"
137"              leading: it does not prevent  copious  output  in  other  places\n"
138"              which might be turned on by --verbose.\n"
139"\n"
140"       --silencecuts\n"
141"              Generate  cut  numbers for cutting out silent intervals. This is\n"
142"              useful when digitising a whole record and then cutting  it  into\n"
143"              tracks. The cut numbers are output on stdout and can be fed back\n"
144"              into --cut.  After cutting, every second track (those with  even\n"
145"              numbers) contains a silent interval and can be deleted.\n"
146"\n"
147"              Together  with  --verbose,  the  silence value of each sector is\n"
148"              printed as well (can't be fed back into --cut then).  This  most\n"
149"              likely produces some VERY long lines.\n"
150"\n"
151"              Silence is detected by applying a threshold (--silencethresh) to\n"
152"              a value computed for each CD sector; the value must be below the\n"
153"              threshold  for  a  minimum number of sectors (delay --silencede-\n"
154"              lay). Currently, the average is computed first (this is  the  DC\n"
155"              component);  then  the average of the absolute of the difference\n"
156"              between each sample and the DC component. The difference between\n"
157"              these  2  averages is compared with the threshold. Check whether\n"
158"              the cuts really fall  into  the  silent  intervals,  and  adjust\n"
159"              threshold  and  duration  if  not (or edit the cut numbers manu-\n"
160"              ally).\n"
161"\n"
162"              The silence delay period is part of the signal interval, not the\n"
163"              silence  interval.  This  means  that each non-silent period has\n"
164"              --silencedelay silence at the start  and  at  the  end.  If  the\n"
165"              silent  interval  between two signal intervals is less than (2 *\n"
166"              silence delay), the silent part at the start of the second  sig-\n"
167"              nal period will be shortened.\n"
168"\n"
169"       --silencedelay DELAY\n"
170"              The  duration  for which the \x22""input\x22"" must be below the threshold\n"
171"              in order to be detected as a silent interval.  In  other  words,\n"
172"              the  number  of  sectors  which  must  be silent before a silent\n"
173"              interval is detected. Ignored without --silencecuts.  The  delay\n"
174"              can be specified with units in the same way as for --cut, and is\n"
175"              truncated to full CD sectors. Default is 30C (=0.4s).\n"
176"\n"
177"       --silenceinfo\n"
178"              Similar to --silencecuts, but  it  generates  more  information.\n"
179"              Silent  and non-silent intervals are listed in a tabular format.\n"
180"              The output format is useful for documentation, but not for feed-\n"
181"              ing back into --cut.  With --verbose, the silence values of each\n"
182"              CD sector are shown as well.  This produces lots of output,  but\n"
183"              it is useful for finding a suitable --silencethresh.\n"
184"\n"
185"       --silencethresh THRESHOLD\n"
186"              Threshold  for silence detection. Ignored without --silencecuts.\n"
187"              Default is 10. Always select a threshold  as  low  as  possible.\n"
188"              When  cutting  a  record into tracks, the threshold must be high\n"
189"              enough to recognise the crackling  between  pieces  as  silence.\n"
190"              When  the  threshold  is too high, a little at the beginning and\n"
191"              end of each piece might be chopped off.\n"
192"\n"
193"              As a special case, if the threshold is set to 0 the usual numer-\n"
194"              ical  computation of the silence value is bypassed, and the sec-\n"
195"              tor is deemed to be silent if all samples are 0.\n"
196"\n"
197"       --startsilence, --ss DUR\n"
198"              Adds the given amount of silence to the  start  of  each  output\n"
199"              file.\n"
200"\n"
201"       --swapchannels\n"
202"              Swap the left with the right channel.\n"
203"\n"
204"       --tocdr\n"
205"              Write data in cdr format (default). Sets the correct byte order.\n"
206"\n"
207"       --toraw\n"
208"              Write data in raw format. Byte order should  be  specified  with\n"
209"              -o/-O (default big).\n"
210"\n"
211"       --towav\n"
212"              Write data in wav format. Sets the correct byte order.\n"
213"\n"
214"       --verbose\n"
215"              Produce  more  output.  Currently only used by --silencecuts and\n"
216"              --silenceinfo.\n"
217"\n"
218"       --version, -V\n"
219"              Display version information.\n"
220"\n"
221"       --     Stop argument processing.  Remaining arguments can only be file-\n"
222"              names, or cut numbers if cutting is used.\n"
223"\n"
224"Command line option scanning:\n"
225"       From  left  to right. Later settings may override previous ones. Beware\n"
226"       to switch file formats before byte ordering, or a byte order  might  be\n"
227"       rejected  for the (then active) format. When not using cutting, remain-\n"
228"       ing arguments are used to fill up  input  and  output  filenames.  When\n"
229"       using  cutting, remaining arguments are assumed to be cut numbers. When\n"
230"       using negative cut numbers, use -- to terminate  option  processing  or\n"
231"       the  negative  numbers  can be mistaken as options (this is a must with\n"
232"       GNU getopt()).\n"
233"\n"
234"       All options which take an argument denoting a time accept the following\n"
235"       number format. The number may be in decimal, octal (leading 0), or hex-\n"
236"       adecimal (leading 0x or 0X). A one-letter unit  may  be  following.  If\n"
237"       there is space between the number and the unit, both must be quoted, as\n"
238"       in \x22""55 C\x22"". These units are recognised: b (bytes), C (audio CD sectors),\n"
239"       s  (seconds). When no unit is given, C is assumed. The progress display\n"
240"       might only show numbers in some of these units. Fractions  for  seconds\n"
241"       are allowed.\n"
242"\n"
243"       Negative  cut  numbers are only allowed if the input size can be deter-\n"
244"       mined (which will not be possible if the input comes from a pipe),  and\n"
245"       are  shown as the equivalent positive ones. If the last cut number is 0\n"
246"       it means the end of the file. If the input file size can not be  deter-\n"
247"       mined the longest possible input (about 405 minutes) is substituted.\n"
248"\n"
249"       A filename of '-' is taken as stdin/stdout.\n"
250"\n"
251"       If  wav2cdr was compiled to use GNU getopt(), argument scanning is more\n"
252"       powerful and long options can be shortened to significance. Options are\n"
253"       also  re-ordered;  this  is nice but can be a trap. Use -- if in doubt,\n"
254"       and don't mix options with filename or cut number arguments.\n"
255"\n"
256"Data formats:\n"
257"       All data handling currently assumes signed 16-bit integers, interleaved\n"
258"       for 2 channels, at a sampling rate of that of a CD. Only wav files with\n"
259"       these parameters can be read correctly. cdr files are in  that  format,\n"
260"       and  only  raw formats with these parameters can be processed. The only\n"
261"       flexibility allowed for raw is the byte order, which can  be  specified\n"
262"       for  both  reading  and  writing.  The byte ordering for wav and cdr is\n"
263"       fixed.\n"
264"\n"
265"Channel swapping:\n"
266"       Left and right channel are swapped, which is the same as swapping  con-\n"
267"       secutive 16 bit values with each other. Also see 'CDR Format' below.\n"
268"\n"
269"Scaling / Volume change:\n"
270"       Scaling  can  be performed with either integer or floating point arith-\n"
271"       metic.  Integer arithmatic is faster but possibly not as precise.  Val-\n"
272"       ues  will  saturate  (i.e.  be  clipped), rather than be truncated. The\n"
273"       speed of this operation depends on the endianness of  the  input  data,\n"
274"       output  data,  and  host.  It  is slowest when bytes have to be swapped\n"
275"       before scaling and swapped back  after.   Negative  scale  factors  are\n"
276"       allowed but might be of dubious value.\n"
277"\n"
278"Mono / stereo:\n"
279"       Input data can be converted to mono and then back to stereo. The result\n"
280"       is 2 channels with the same data. This can be useful in some cases.\n"
281"\n"
282"Output file naming:\n"
283"       Unless output is to stdout, the resulting filename is  the  name  given\n"
284"       with --outfile. A period and a 2-digit track number are appended.\n"
285"\n"
286"Input data splitting:\n"
287"       Input  data  can  be split into pieces resp. tracks. Currently cuts can\n"
288"       only be placed at multiples of audio CD sectors (at the  sector  bound-\n"
289"       aries), whether the input format is cdr or not.\n"
290"\n"
291"       The  cuts are placed at the given positions, which must be in ascending\n"
292"       order (or equal). Negative numbers are counted  from  the  end  of  the\n"
293"       input  data.  This  only works if the input is seekable (Unix pipes are\n"
294"       not). Sectors of the input are numbered from  0.  Bytes  of  a  header,\n"
295"       which the input format might have, are not counted.\n"
296"\n"
297"       Any  number of cuts can be made, but only 99 tracks can be put on a CD.\n"
298"       All sectors before the first but not including the first sector  number\n"
299"       are discarded, as well as all sectors after and including the last sec-\n"
300"       tor number.  At least 2 sector numbers (cut numbers) must be given,  in\n"
301"       which case one piece is cut out.\n"
302"\n"
303"       If  there are only 2 cut numbers (1 track to cut out) data can be writ-\n"
304"       ten to stdout or file. More than one track can only be written to file,\n"
305"       the  track  number  will  be added as an extension to the filename.  To\n"
306"       avoid the track number to be appended to the filename when only one cut\n"
307"       is  made,  don't use --outfile but write to stdout and use output redi-\n"
308"       rection.\n"
309"\n"
310"        Example (assuming 50000 sectors in the input):\n"
311"           wav2cdr < INPUT --outfile NAME --cut 500 20000 40000\n"
312"                sectors     0-  499: discarded\n"
313"                          500-19999: saved to NAME.01\n"
314"                        20000-39999: saved to NAME.02\n"
315"                        40000-49999: discarded\n"
316"\n"
317"Cutting out silent intervals:\n"
318"       Assuming a digitised record is stored in record.wav, and is to  be  cut\n"
319"       into tracks.\n"
320"\n"
321"         wav2cdr < record.wav > cuts --silencecuts --silencedelay 2s\n"
322"         wav2cdr < record.wav --of tracks --cut `cat cuts`\n"
323"\n"
324"       Will  store  the  tracks of the record in track.01, track.02, ..., with\n"
325"       the delay for cutting at a silent part set to 2 seconds. The  threshold\n"
326"       used  is  the  default. Note the `` syntax works under Unix and in this\n"
327"       case puts the contents of file \x22""cuts\x22"" on the command line.\n"
328"\n"
329"Information about silences and actual sound parts:\n"
330"       --silenceinfo can be used in the same way as  --silencecuts.   It  pro-\n"
331"       duces output like\n"
332"\n"
333"       (stdin):\n"
334"        silnc         0 b,      0 C,    0 s, 00:00.00 min\n"
335"         DIFF    811440 b,    345 C,    4 s, 00:04.22 min\n"
336"          -->    811440 b,    345 C,    4 s, 00:04.22 min\n"
337"\n"
338"        AUDIO    811440 b,    345 C,    4 s, 00:04.22 min\n"
339"         DIFF  20603520 b,   8760 C,  116 s, 01:56.05 min\n"
340"          -->  21414960 b,   9105 C,  121 s, 02:01.02 min\n"
341"\n"
342"       showing  the beginning, length (\x22""DIFF\x22""), and end (\x22""-->\x22"") of both silent\n"
343"       (\x22""silnc\x22"") and and non-silent (\x22""AUDIO\x22"") intervals. This  is  useful  for\n"
344"       examining existing tracks, but it can not be used with --cut.\n"
345"\n"
346"Messages:\n"
347"       Progress  messages and statistics are written to stderr when writing to\n"
348"       stdout, and to stdout when writing to file. It is currently not  possi-\n"
349"       ble to suppress this, other than by redirection to the bit bucket.\n"
350"\n"
351"Writing wav format:\n"
352"       Only  wav  files with 2 channels, 16 bits per sample, and audio CD sam-\n"
353"       pling rate can be written. If the input data is different, the  result-\n"
354"       ing  wav  file is incorrect. Scaling can be performed when writing wav.\n"
355"       Cutting can only be performed in multiples of an audio CD sector  size.\n"
356"       When writing wav the output must be seekable (e.g. no pipes).\n"
357"\n"
358"CDR Format:\n"
359"       Raw sample data at a sampling rate of %li Hz. The channels are inter-\n"
360"       leaved.  The numbers are 16 bit signed integers with this  byte  order:\n"
361"       MSByte  Left,  LSByte Left, MSByte Right, LSByte Right.  The track size\n"
362"       must be a multiple of the sector size of %i bytes.  There are %i sec-\n"
363"       tors per second.\n"
364"\n"
365"BUGS / LIMITATIONS\n"
366"       All  operations  can  only be performed on a minimum of 1 CD block or a\n"
367"       multiple thereof.\n"
368"\n"
369"COPYRIGHT\n"
370"       Copyright (C)\n"
371"       Nov, Dec 1997, Jan, Mar, Apr, May 1998, Feb, May, Jun, Jul,\n"
372"       Aug 1999, Oct 2000, Jan 2006 by\n"
373"       Volker Kuhlmann  <VolkerKuhlmann@gmx.de>\n"
374"       formerly c/o EEE Dept, University of Canterbury\n"
375"       Christchurch, New Zealand\n"
376"\n"
377"       Permission granted to use and distribute this software free of  charge,\n"
378"       provided any improvements are sent back to the author. Comments and bug\n"
379"       reports welcome.  All rights reserved. Standard disclaimer applies.\n"
380"\n"
381"AUTHOR\n"
382"       Volker Kuhlmann\n"
383"\n"
384"wav2cdr                           18 Jan 2006                       wav2cdr(1)\n"
385