| 1 |
|
| 2 |
<refentry id="src_conv"> |
| 3 |
<refentryinfo><title>Utilities</title></refentryinfo> |
| 4 |
<refmeta> |
| 5 |
<refentrytitle>src_conv</refentrytitle> |
| 6 |
</refmeta> |
| 7 |
|
| 8 |
<refnamediv> |
| 9 |
<refname>src_conv</refname> |
| 10 |
<refpurpose> |
| 11 |
Converts the sample rate of an audio file. |
| 12 |
<indexterm id="IndexSrc_Conv"><primary>src_conv</primary></indexterm> |
| 13 |
</refpurpose> |
| 14 |
</refnamediv> |
| 15 |
|
| 16 |
<refsect1> |
| 17 |
<title>Description</title> |
| 18 |
<para> |
| 19 |
Converts the sample rate of an audio file at sample rate Rin to |
| 20 |
a sample rate of Rout. Optionally the ratio (Rin / Rout) may be |
| 21 |
linearly time-varying according to a set of (time, ratio) pairs in |
| 22 |
an auxiliary file. |
| 23 |
</para> |
| 24 |
</refsect1> |
| 25 |
|
| 26 |
<refsect1> |
| 27 |
<title>Syntax</title> |
| 28 |
<synopsis><command>src_conv</command> [flags] infile</synopsis> |
| 29 |
</refsect1> |
| 30 |
|
| 31 |
<refsect1> |
| 32 |
<title>Initialization</title> |
| 33 |
<para> |
| 34 |
Flags: |
| 35 |
<itemizedlist> |
| 36 |
<listitem><para>-<emphasis>P num</emphasis> = pitch |
| 37 |
transposition ratio (srate / r) [don't specify both P and |
| 38 |
r]</para></listitem> |
| 39 |
<listitem><para>-<emphasis>Q num</emphasis> =quality factor |
| 40 |
(1, 2, 3, 4 or 5: default = 3)</para></listitem> |
| 41 |
<listitem><para>-<emphasis>i filnam</emphasis> = auxiliary |
| 42 |
breakpoints file (no breakpoint by default. i.e. No ratio change) |
| 43 |
</para></listitem> |
| 44 |
<listitem><para>-<emphasis>r num</emphasis> = output sample |
| 45 |
rate (must be specified if no P)</para></listitem> |
| 46 |
<listitem><para>-<emphasis>o fnam</emphasis> = sound output |
| 47 |
filename (default: test.wav)</para></listitem> |
| 48 |
<listitem><para>-<emphasis>A</emphasis> = create an AIFF |
| 49 |
format output soundfile</para></listitem> |
| 50 |
<listitem><para>-<emphasis>J</emphasis> = create an IRCAM |
| 51 |
format output soundfile</para></listitem> |
| 52 |
<listitem><para>-<emphasis>W</emphasis> = create a WAV format |
| 53 |
output soundfile (default after Csound version 6.15)</para></listitem> |
| 54 |
<listitem><para>-<emphasis>h</emphasis> = no header on output |
| 55 |
soundfile</para></listitem> |
| 56 |
<listitem><para>-<emphasis>c</emphasis> = 8-bit signed_char |
| 57 |
sound samples</para></listitem> |
| 58 |
<listitem><para>-<emphasis>a</emphasis> = alaw sound |
| 59 |
samples</para></listitem> |
| 60 |
<listitem><para>-<emphasis>8</emphasis> = 8-bit unsigned_char |
| 61 |
sound samples</para></listitem> |
| 62 |
<listitem><para>-<emphasis>u</emphasis> = ulaw sound |
| 63 |
samples</para></listitem> |
| 64 |
<listitem><para>-<emphasis>s</emphasis> = short_int (16 bit) sound |
| 65 |
samples (default)</para></listitem> |
| 66 |
<listitem><para>-<emphasis>3</emphasis> = 24-bit sound |
| 67 |
samples</para></listitem> |
| 68 |
<listitem><para>-<emphasis>l</emphasis> = long_int sound |
| 69 |
samples</para></listitem> |
| 70 |
<listitem><para>-<emphasis>f</emphasis> = float sound |
| 71 |
samples</para></listitem> |
| 72 |
<listitem><para>-<emphasis>r N</emphasis> = orchestra srate |
| 73 |
override</para></listitem> |
| 74 |
<listitem><para>-<emphasis>K</emphasis> = Do not generate PEAK |
| 75 |
chunks</para></listitem> |
| 76 |
<listitem><para>-<emphasis>R</emphasis> = continually rewrite |
| 77 |
header while writing soundfile (WAV/AIFF)</para></listitem> |
| 78 |
<listitem><para>-<emphasis>H#</emphasis> = print a heartbeat |
| 79 |
style 1, 2 or 3 at each soundfile write</para></listitem> |
| 80 |
<listitem><para>-<emphasis>N</emphasis> = notify (ring the |
| 81 |
bell) when done</para></listitem> |
| 82 |
|
| 83 |
|
| 84 |
</itemizedlist> |
| 85 |
</para> |
| 86 |
|
| 87 |
<para> |
| 88 |
This program performs arbitrary sample-rate conversion with high |
| 89 |
fidelity using the libsamplerate library. |
| 90 |
</para> |
| 91 |
|
| 92 |
<para>The five levels of accuracy are: |
| 93 |
<itemizedlist> |
| 94 |
<listitem> 1: A linear converter. The quality is poor, but the |
| 95 |
conversion speed is blindingly fast. </listitem> |
| 96 |
<listitem> 2: A Zero Order Hold converter (interpolated value is |
| 97 |
equal to the last value). The quality is poor but the conversion |
| 98 |
speed is blindingly fast.</listitem> |
| 99 |
<listitem> 3: This is the fastest bandlimited interpolator and |
| 100 |
has an SNR of 97dB and a bandwidth of 80%.</listitem> |
| 101 |
<listitem> 4: This is another bandlimited interpolator much like |
| 102 |
the previous one. It has an SNR of 97dB and a bandwidth of |
| 103 |
90%. The speed of the conversion is much faster than the next |
| 104 |
one. Blindingly fast.</listitem> |
| 105 |
<listitem> 5: This is a bandlimited interpolator derived from |
| 106 |
the mathematical sinc function and this is the highest quality |
| 107 |
sinc based converter, providing a worst case Signal-to-Noise |
| 108 |
Ratio (SNR) of 97dB at a bandwidth of 97%.</listitem> |
| 109 |
</itemizedlist> |
| 110 |
</para> |
| 111 |
</refsect1> |
| 112 |
|
| 113 |
<refsect1> |
| 114 |
<title>Examples</title> |
| 115 |
<para> |
| 116 |
Here is an example of src_conv. It uses the file <ulink url="examples/src_conv.csd"><citetitle>src_conv.csd</citetitle></ulink>. |
| 117 |
<example> |
| 118 |
<title>Example of src_conv.</title> |
| 119 |
<para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 120 |
<xi:include href="examples-xml/src_conv.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 121 |
</example> |
| 122 |
</para> |
| 123 |
</refsect1> |
| 124 |
|
| 125 |
<refsect1> |
| 126 |
<title>Credits</title> |
| 127 |
<para>Author: &namejohn; based on code by Erik de Castro Lopo</para> |
| 128 |
<para>May 2015</para> |
| 129 |
</refsect1> |
| 130 |
</refentry> |