| 1 | |
| 2 | <refentry id="filesr"> |
| 3 | <indexterm id="IndexFilesr"><primary>filesr</primary></indexterm> |
| 4 | <refentryinfo><title>Signal I/O:Soundfile Queries</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>filesr</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>filesr</refname> |
| 11 | <refpurpose> |
| 12 | Returns the sample rate of a sound file. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Returns the sample rate of a sound file. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>ir <command>filesr</command> ifilcod [, iallowraw]</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Initialization</title> |
| 30 | <para> |
| 31 | <emphasis>ifilcod</emphasis> -- sound file to be queried |
| 32 | </para> |
| 33 | <para> |
| 34 | <emphasis>iallowraw</emphasis> -- (Optional) Allow raw sound files (default=1) |
| 35 | </para> |
| 36 | </refsect1> |
| 37 | |
| 38 | <refsect1> |
| 39 | <title>Performance</title> |
| 40 | <para> |
| 41 | <emphasis>filesr</emphasis> returns the sample rate of the sound file <emphasis>ifilcod</emphasis>. <emphasis>filesr</emphasis> can return the sample rate of convolve and PVOC files if the <emphasis>iallowraw</emphasis> flag is not zero (it is non-zero by default). |
| 42 | </para> |
| 43 | </refsect1> |
| 44 | |
| 45 | <refsect1> |
| 46 | <title>Examples</title> |
| 47 | <para> |
| 48 | Here is an example of the filesr opcode. It uses the file <ulink url="examples/filesr.csd"><citetitle>filesr.csd</citetitle></ulink>, |
| 49 | and <ulink url="examples/drumsMlp.wav"><citetitle>drumsMlp.wav</citetitle></ulink>. |
| 50 | |
| 51 | <example> |
| 52 | <title>Example of the filesr opcode.</title> |
| 53 | <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> |
| 54 | <xi:include href="examples-xml/filesr.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 55 | </example> |
| 56 | |
| 57 | The audio file <quote>drumsMlp.wav</quote> was sampled at 44.1 KHz. So <emphasis>filesr</emphasis>'s output should include a line like this: |
| 58 | <screen> |
| 59 | sample rate = 44100.000000, size = 131072.000000 |
| 60 | </screen> |
| 61 | </para> |
| 62 | </refsect1> |
| 63 | |
| 64 | <refsect1> |
| 65 | <title>See also</title> |
| 66 | <para><link linkend="SigioQueries"><citetitle>Sound File Queries</citetitle></link></para> |
| 67 | </refsect1> |
| 68 | |
| 69 | <refsect1> |
| 70 | <title>Credits</title> |
| 71 | <para> |
| 72 | <simplelist> |
| 73 | <member>Author: &namematt;</member> |
| 74 | <member>July 1999</member> |
| 75 | </simplelist> |
| 76 | </para> |
| 77 | |
| 78 | <para>New in Csound version 3.57</para> |
| 79 | </refsect1> |
| 80 | </refentry> |