SRConv
[
NextMusic Home Page
|
Sound and Music Programs Page
|
Program List ]
Author: Jean Laroche
Platforms: NeXT
Prerequisites: NS2.2 or higher?
Price: free
Demo: N/A
To acquire: ftp://ftp.eecs.umich.edu/pub/nextmusic/Srconv.tar.Z (24k)
Information: ?
Entry updated: 12 November 1996
Description: A command-line utility for converting soundfiles to any sampling rate using the DSP.
SRCONV(1) UNIX Programmer's Manual SRCONV(1)
NAME
srconv - convert soundfiles to any sampling rate.
SYNOPSIS
srconv [ -SIvsosibcrUDK ] sound1 sound2
DESCRIPTION
srconv is a sampling rate converter implemented on the DSP.
The -S flag lets you specify the output sampling rate. When
the original sound is a soundfile, its initial sampling rate
is read from the header and the sound is converted to the
sampling rate specified by the -S flag. When the original
sound is a raw headerless binary file (short ints), you need
to specify its initial sampling rate using the -I flag
(srconv automatically recognize the file is not a sound-
file). When converting binary files, srconv assumes the
sound is mono, unless you specify it is stereo. srconv can
convert mono, stereo soundfiles, convert only one of the two
channels, or add the two channels and convert the sum (for
stereo original soundfile). srconv can swap sound bytes
before or after converting (or both), for compatibility with
DEC machines, PCs etc... srconv can either write its output
as a soundfile (with a header) or as a raw headerless binary
file.
OPTIONS
-v Verbose. Gives additional informations.
-S sampling rate
Specifies the output sampling rate. To convert header-
less files from one sampling rate to another, this flag
should be used in conjunction with the -SI flag.
-I input sampling rate
This can be used to specify the sound's original sam-
pling rate. When the original sound is a soundfile
(with a header), it's original sampling rate is nor-
mally read from the header. This option overrides the
header's sampling rate. When the original sound is a
headerless binary file, this option specifies its sam-
pling rate.
-b Sounfile output. With this option, the converted sound
is written in a soundfile with a 28 byte header.
-si This can be used to swap the input sound bytes before
converting. Use this if your sound comes either from a
DEC machine or from a PC. This option is valid only
when the original sound is headerless.
-so This can be used to swap the output sound bytes after
converting. Use this if you want the converted sound to
be in DEC or in PC format. This option is valid only
with the -b option.
-cs converts the sound in stereo mode. Valid either when
the input sound is a stereo soundfile or when it's a
raw binary file.
-cl converts only the sound's left channel. Valid only when
the input sound is a stereo soundfile (not valid for
raw binary files).
-cr converts only the sound's right channel. Valid only
when the input sound is a stereo soundfile (not valid
for raw binary files).
-c+ mixes the sound's two channels, and converts them in
mono. Valid only when the input sound is a stereo
soundfile (not valid for raw binary files).
-w This option makes it possible to rescale the output
sound. Use this if your output sound clicks. The
default rescaling value is 0.9. This option is disabled
when bit faithful conversion is performed.
-r This option forces the output header to contain the
exact frequency you specified with the -S option. Due
to the way srconv works, it sometimes can't convert
exactly to the requested sampling rate, but only to an
approximation. Normally, the approximated sampling rate
is written in the output sound's header. If you use the
-r option, the exact requested sampling rate is written
instead.
-K filter length
This can be use to specify the filter length you want
to use. This length is normally calculated automati-
cally, so you shouldn't need to use this option.
-B This can be use to specify the type of filter windowing
you want to use. By default, a Hanning window is used,
giving a rejection of about -40dB to -50dB. It may be
necessary in some cases to use a Blackman window to get
more rejection (about -60dB), at the expense of a wider
transition band. This can be done by use of the -B
flag.
-U upward conversion factor
upward conversion factor. Normally, you don't need to
use this option.
-D downward conversion factor
downward conversion factor. Normally, you don't need to
use this option.
EXAMPLE
"srconv -I16000 -S24000 file1 file2" converts file1 from
16kHz to 24kHz and writes it into a headerless file: file2.
"srconv -S24000 -b file1.snd file2.snd" converts file1.snd
from its original sampling rate to 24kHz and writes the out-
put in the soundfile file2.snd.
SEE ALSO
sndinfo(1), record, play, fromsnd, tosnd
AUTHOR
Jean Laroche, June 1992, TELECOM PARIS.
Eric M. Mrozek (mrozek@umich.edu), EECS-Systems, University of Michigan