File: ch_wave.1

package info (click to toggle)
speech-tools 1%3A2.5.0-13
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 9,992 kB
  • sloc: cpp: 67,350; ansic: 12,174; sh: 4,055; java: 3,748; makefile: 1,112; lisp: 711; perl: 396; awk: 85; xml: 9
file content (157 lines) | stat: -rw-r--r-- 6,191 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.Dd April 5, 2001
.Dt CH_WAVE 1
.Os "Edinburgh Speech Tools"
.Sh NAME
.Nm ch_wave
.Nd change/copy/combine waveform files
.Sh SYNOPSIS
.Nm ch_wave
.Op Fl h
.Op Fl itype Ar file type
.Op Fl n Ar channels
.Op Fl f Ar sample rate
.Op Fl ibo Ar byte order
.Op Fl iswap
.Op Fl istype Ar sample type
.Op Fl c Ar channel
.Op Fl start Ar seconds
.Op Fl end Ar seconds
.Op Fl from Ar sample
.Op Fl to Ar sample
.Op Fl o Ar output file
.Op Fl otype Ar file type
.Op Fl F Ar sample rate
.Op Fl obo Ar byte order
.Op Fl oswap
.Op Fl ostype Ar sample type
.Op Fl scale Ar factor
.Op Fl scaleN Ar factor
.Op Fl lpfilter Ar frequency
.Op Fl hpfilter Ar frequency
.Op Fl forder Ar order
.Op Fl fafter
.Op Fl info
.Op Fl add
.Op Fl pc Ar LONGEST | FIRST
.Op Fl key Ar keylab file
.Op Fl divide
.Op Fl ext Ar file extension
.Op Fl extract Ar file
.Ar input files ...
.Sh DESCRIPTION
.Nm ch_wave
performs various operations on an input waveform file and writes it out to
another file.  Among other things, it can extract subsections or individual
channels, resample, rescale, mix down channels, and perform simple filtering
operations.
.Pp
The following option flags are recognized:
.Pp
.Bl -tag -width 4n -offset indent -compact
.It Fl h
Options help
.It Fl itype Ar file type
Input file type (optional). If set to raw, this indicates that the input file
does not have a header. While this can be used to specify file types other than
raw, this is rarely used for other purposes as the file type of all the existing
supported types can be determined automatically from the file's header. If the
input file is unheadered, files are assumed to be shorts (16bit).
Supported types are nist, est, esps, snd, riff, aiff, audlab, raw, ascii
.It Fl n Ar channels Number of channels in an unheadered input file
.It Fl f Ar sample rate
Sample rate in Hertz for an unheadered input file
.It Fl ibo Ar byte order
Input byte order in an unheadered input file: possibliities are: MSB , LSB,
native or nonnative. Suns, HP, SGI Mips, M68000 are MSB (big endian) Intel,
Alpha, DEC Mips, Vax are LSB (little endian)
.It Fl iswap
Swap bytes. (For use on an unheadered input file)
.It Fl istype Ar sample type
Sample type in an unheadered input file: short, alaw, mulaw, byte, ascii
.It Fl c Ar channel
Select a single channel (starts from 0).
Waveforms can have multiple channels. This option extracts a single channel for
progcessing and discards the rest.
.It Fl start Ar seconds
Extract sub-wave starting at this time, specified in seconds
.It Fl end Ar seconds
Extract sub-wave ending at this time, specified in seconds
.It Fl from Ar sample
Extract sub-wave starting at this sample point
.It Fl to Ar sample
Extract sub-wave ending at this sample point
.It Fl o Ar output file
Output filename. If not specified output is to stdout.
.It Fl otype Ar file type
Output file type, (optional). If no type is Specified the type of the input file
is assumed. Supported types are: nist, est, esps, snd, riff, aiff, audlab, raw,
ascii
.It Fl F Ar sample rate
Output sample rate in Hz. If this is different from the input sample rate,
resampling will occur
.It Fl obo Ar byte order
Output byte order: MSB, LSB, native, or nonnative. Suns, HP, SGI Mips, M68000
are MSB (big endian), Intel, Alpha, DEC Mips, Vax are LSB (little endian)
.It Fl oswap
Swap bytes when saving to output
.It Fl ostype Ar sample type
Output sample type: short, alaw, mulaw, byte or ascii
.It Fl scale Ar factor
Scaling factor. Increase or descrease the amplitude of the whole waveform by the
factor given (relative to 1.0)
.It Fl scaleN Ar factor Scaling factor with normalization. The waveform is
scaled to its maximum level, after which it is scaled by the factor given
(relative to 1.0)
.It Fl lpfilter Ar frequency
Low pass filter, with cutoff frequency in Hz Filtering is performed by a FIR
filter which is built at run time. The order of the filter can be given by
\-forder. The default value is 199
.It Fl hpfilter Ar frequency
High pass filter, with cutoff frequency in Hz Filtering is performed by a FIR
filter which is built at run time. The order of the filter can be given by
\-forder. The default value is 199.
.It Fl forder Ar order
Order of FIR filter used for lpfilter and hpfilter. This must be ODD. Sensible
values range from 19 (quick but with a shallow rolloff) to 199 (slow but with a
steep rolloff). The default is 199.
.It Fl fafter
Do filtering after other operations such as resampling (default : filter before
other operations)
.It Fl info
Print information about file and header. This option gives useful information
such as file length, sampling rate, number of channels etc No output is produced
.It Fl add
A new single channel waveform is created by adding the corresponding sample
points of each input waveform
.It Fl pc Ar LONGEST | FIRST
Combine input waveforms to form a single multichannel waveform. The argument to
this option controls how long the new waveform should be. If the option is
LONGEST, the output wave if the length of the longest input wave and shorter
waves are padded with zeros at the end. If the option is FIRST, the length of
the new waveform is the length of the first file on the command line, and
subsequent waves are padded or cut to this length
.It Fl key Ar keylab file
Label file designating subsections, for use with
.Fl divide.
The KEYLAB file is a label file which specifies where chunks (such as individual
sentences) in a waveform begin and end. See section on wave extraction.
.It Fl divide
Divide a single input waveform into multiple output waveforms. Each output
waveform is extracted from the input waveform by using the KEYLAB file, which
specifies the start and stop times for each chunk. The output files are named
according to the filename in the KEYLAB file, with extension given by \-ext.
See section on wave extraction
.It Fl ext Ar file extension
File extension for divided waveforms
.It Fl extract Ar file
Used in conjunction with \-key to extract a single section of waveform from the
input waveform. The argument is the name of a file given in the file column of
the KEYLAB file.
.El
.Sh EXAMPLES
.Sh BUGS
.Sh SEE ALSO
.Xr ch_track 1
.Xr ch_utt 1
.Xr na_record 1
.Xr na_play 1