| 1 | |
| 2 | <refentry id="in"> |
| 3 | <indexterm id="Indexin"><primary>in</primary></indexterm> |
| 4 | <refentryinfo><title>Signal I/O:Signal Input</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>in</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>in</refname> |
| 13 | <refpurpose> |
| 14 | Reads mono audio data from an external device or stream. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Reads audio data from an external device or stream. |
| 22 | </para> |
| 23 | |
| 24 | <warning> |
| 25 | <title>Warning</title> |
| 26 | <para> |
| 27 | There are two versions of this opcode. The first is designed |
| 28 | to be used only with orchestras that have |
| 29 | inchnls=1. Doing so with orchestras with inchnls > 1 will |
| 30 | cause incorrect audio input. |
| 31 | </para> |
| 32 | <para> |
| 33 | The second form will read multiple channels into an array. |
| 34 | </para> |
| 35 | </warning> |
| 36 | </refsect1> |
| 37 | |
| 38 | <refsect1> |
| 39 | <title>Syntax</title> |
| 40 | <synopsis>ar1 <command>in</command></synopsis> |
| 41 | <synopsis>aarray <command>in</command></synopsis> |
| 42 | </refsect1> |
| 43 | |
| 44 | <refsect1> |
| 45 | <title>Performance</title> |
| 46 | <para> |
| 47 | Form 1 reads mono audio data from an external device or |
| 48 | stream. If the command-line <link |
| 49 | linkend="FlagsMinusLowerI"><citetitle>-i</citetitle></link> flag |
| 50 | is set, sound is read continuously from the audio input stream |
| 51 | (e.g. <emphasis>stdin</emphasis> or a soundfile) into an |
| 52 | internal buffer. Any number of these opcodes can read freely |
| 53 | from this buffer. |
| 54 | </para> |
| 55 | <para> |
| 56 | The second format will read upto ichnls of audio into an audio |
| 57 | array, which must be initialised. |
| 58 | </para> |
| 59 | </refsect1> |
| 60 | |
| 61 | <refsect1> |
| 62 | <title>Examples</title> |
| 63 | <para> |
| 64 | Here is an example of the in opcode. It uses the file <ulink url="examples/in.csd"><citetitle>in.csd</citetitle></ulink>. |
| 65 | <example> |
| 66 | <title>Example of the in opcode.</title> |
| 67 | <xi:include href="examples-xml/in.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 68 | </example> |
| 69 | </para> |
| 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>See also</title> |
| 74 | <para><link linkend="SigioInput"><citetitle>Signal Input</citetitle></link></para> |
| 75 | </refsect1> |
| 76 | |
| 77 | <refsect1> |
| 78 | <title>Credits</title> |
| 79 | <para> |
| 80 | <simplelist> |
| 81 | <member>Authors: &namebarry;, &namematt;/&namemike;</member> |
| 82 | <member>MIT, Mills College</member> |
| 83 | <member>1993-1997</member> |
| 84 | <member>Authors: &namejohn;</member> |
| 85 | <member>NUIM, 2013</member> |
| 86 | </simplelist> |
| 87 | </para> |
| 88 | <para>Already in version 3.30</para> |
| 89 | <para>Array version in versio 6.01</para> |
| 90 | </refsect1> |
| 91 | </refentry> |