srconv
Prev | File Conversion (HET_IMPORT, HET_EXPORT, PVLOOK, PV_EXPORT, PV_IMPORT, SDIF2AD, SRCONV) | Next

## srconv

srconv — Converts the sample rate of an audio file.

## Description

Converts the sample rate of an audio file at sample rate Rin to a sample rate of Rout. Optionally the ratio (Rin / Rout) may be linearly time-varying according to a set of (time, ratio) pairs in an auxiliary file.

## Syntax

    srconv [flags] infile

## Initialization

Flags:

- -P num = pitch transposition ratio (srate / r) [don't specify both P and r]

- -P num = pitch transposition ratio (srate / r) [don't specify both P and r]

- -Q num =quality factor (1, 2, 3, or 4: default = 2)

- -i filnam = auxiliary breakpoints file (no breakpoint by default. i.e. No ratio change)

- -r num = output sample rate (must be specified)

- -o fnam = sound output filename

- -A = create an AIFF format output soundfile

- -J = create an IRCAM format output soundfile

- -W = create a WAV format output soundfile

- -h = no header on output soundfile

- -c = 8-bit signed_char sound samples

- -a = alaw sound samples

- -8 = 8-bit unsigned_char sound samples

- -u = ulaw sound samples

- -s = short_int sound samples

- -l = long_int sound samples

- -f = float sound samples

- -r N = orchestra srate override

- -K = Do not generate PEAK chunks

- -R = continually rewrite header while writing soundfile (WAV/AIFF)

- -H# = print a heartbeat style 1, 2 or 3 at each soundfile write

- -N = notify (ring the bell) when score or miditrack is done

- -- fnam = log output to file

This program performs arbitrary sample-rate conversion with high fidelity. The method is to step through the input at the desired sampling increment, and to compute the output points as appropriately weighted averages of the surrounding input points. There are two cases to consider:

1. sample rates are in a small-integer ratio - weights are obtained from table.

2. sample rates are in a large-integer ratio - weights are linearly interpolated from table.

Calculate increment: if decimating, then window is impulse response of low-pass filter with cutoff frequency at half of output sample rate; if interpolating, then window is impulse response of lowpass filter with cutoff frequency at half of input sample rate.

## Credits

Author: Mark Dolson

August 26, 1989

Author: John ffitch

December 30, 2000

Prev | Up | Next
sdif2ad | Home | Other Csound Utilities (CS, CSB64ENC, ENVEXT, EXTRACTOR, MAKECSD, MIXER, SCALE)