summaryrefslogtreecommitdiff
path: root/opcodes/filebit.xml
blob: f0c2e338363c0c59fafd9464b858cd785e523a93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<refentry id="filebit">
<indexterm id="IndexFileBit"><primary>filebit</primary></indexterm>
  <refentryinfo><title>Signal I/O:Soundfile Queries</title></refentryinfo>
  <refmeta>
    <refentrytitle>filebit</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>filebit</refname>
    <refpurpose>
      Returns the number of bits in each sample in a sound file.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Returns the number of bits in each sample in a sound file.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ir <command>filebit</command> ifilcod [, iallowraw]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifilcod</emphasis> -- sound file to be queried
    </para>
    <para>
      <emphasis>iallowraw</emphasis> -- (Optional) Allow raw sound files (default=1)
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>filebit</emphasis> returns the number of bits in each
      sample in the sound file <emphasis>ifilcod</emphasis>.  In the
      case of floating point samples the value -1 is returned for
      floats and -2 for doubles.  For non-PCM formats the value is
      negative, and based on libsndfile's format encoding.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the filebit opcode. It uses the file <ulink url="examples/filebit.csd"><citetitle>filebit.csd</citetitle></ulink>,
and <ulink url="examples/mary.wav"><citetitle>mary.wav</citetitle></ulink>.

      <example>
        <title>Example of the filebit opcode.</title>

        

        <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>
          <xi:include href="examples-xml/filebit.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>

      The audio file <quote>mary.wav</quote> is in monoaural CD format, so <emphasis>filebit</emphasis>'s output should include a line like this:
      <screen>
instr 1:  ibits = 16.000
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="filelen"><citetitle>filelen</citetitle></link>,
      <link linkend="filenchnls"><citetitle>filenchnls</citetitle></link>,
      <link linkend="filepeak"><citetitle>filepeak</citetitle></link>,
      <link linkend="filesr"><citetitle>filesr</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namevictor;</member>
        <member>July 1999</member>
      </simplelist>
    </para>
    <para>Example written by &namejohn;.</para>

    <para>New in Csound version 5.11</para>
  </refsect1>
</refentry>