Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > 4f48f620eaa1d8b8f904a92a0540d40f > files > 807

audaspace-doc-1.3.0-18.mga7.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sound &#8212; audaspace 1.3.0 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Handle" href="handle.html" />
    <link rel="prev" title="Device" href="device.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="sound">
<h1>Sound<a class="headerlink" href="#sound" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="aud.Sound">
<em class="property">class </em><code class="descclassname">aud.</code><code class="descname">Sound</code><a class="headerlink" href="#aud.Sound" title="Permalink to this definition">¶</a></dt>
<dd><p>Sound objects are immutable and represent a sound that can be played simultaneously multiple times. They are called factories because they create reader objects internally that are used for playback.</p>
<dl class="method">
<dt id="aud.Sound.ADSR">
<code class="descname">ADSR</code><span class="sig-paren">(</span><em>attack</em>, <em>decay</em>, <em>sustain</em>, <em>release</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.ADSR" title="Permalink to this definition">¶</a></dt>
<dd><p>Attack-Decay-Sustain-Release envelopes the volume of a sound. Note: there is currently no way to trigger the release with this API.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>attack</strong> (<em>float</em>) – The attack time in seconds.</li>
<li><strong>decay</strong> (<em>float</em>) – The decay time in seconds.</li>
<li><strong>sustain</strong> (<em>float</em>) – The sustain level.</li>
<li><strong>release</strong> (<em>float</em>) – The release level.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.accumulate">
<code class="descname">accumulate</code><span class="sig-paren">(</span><em>additive=False</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.accumulate" title="Permalink to this definition">¶</a></dt>
<dd><p>Accumulates a sound by summing over positive input differences thus generating a monotonic sigal. If additivity is set to true negative input differences get added too, but positive ones with a factor of two. Note that with additivity the signal is not monotonic anymore.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>additive</strong> – Whether the accumulation should be additive or not.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.addSound">
<code class="descname">addSound</code><span class="sig-paren">(</span><em>sound</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.addSound" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a new sound to a sound list.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>sound</strong> (<a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a>) – The sound that will be added to the list.</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You can only add a sound to a sound list.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.binaural">
<code class="descname">binaural</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.binaural" title="Permalink to this definition">¶</a></dt>
<dd><p>convolver()</p>
<p>Creates a binaural sound using another sound as source. The original sound must be mono</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>hrtfs</strong> – An HRTF set.</li>
<li><strong>source</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">Source</span></code>) – An object representing the source position of the sound.</li>
<li><strong>threadPool</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">ThreadPool</span></code>) – A thread pool used to parallelize convolution.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.buffer">
<code class="descname">buffer</code><span class="sig-paren">(</span><em>data</em>, <em>rate</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.buffer" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a sound from a data buffer.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> (<em>numpy.ndarray</em>) – The data as two dimensional numpy array.</li>
<li><strong>rate</strong> (<em>double</em>) – The sample rate.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.cache">
<code class="descname">cache</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.cache" title="Permalink to this definition">¶</a></dt>
<dd><p>Caches a sound into RAM.
This saves CPU usage needed for decoding and file access if the underlying sound reads from a file on the harddisk, but it consumes a lot of memory.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Only known-length factories can be buffered.</p>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Raw PCM data needs a lot of space, only buffer short factories.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.convolver">
<code class="descname">convolver</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.convolver" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a sound that will apply convolution to another sound.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>impulseResponse</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">ImpulseResponse</span></code>) – The filter with which convolve the sound.</li>
<li><strong>threadPool</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">ThreadPool</span></code>) – A thread pool used to parallelize convolution.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.data">
<code class="descname">data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.data" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieves the data of the sound as numpy array.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A two dimensional numpy float array.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Best efficiency with cached sounds.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.delay">
<code class="descname">delay</code><span class="sig-paren">(</span><em>time</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.delay" title="Permalink to this definition">¶</a></dt>
<dd><p>Delays by playing adding silence in front of the other sound’s data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>time</strong> (<em>float</em>) – How many seconds of silence should be added before the sound.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.envelope">
<code class="descname">envelope</code><span class="sig-paren">(</span><em>attack</em>, <em>release</em>, <em>threshold</em>, <em>arthreshold</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.envelope" title="Permalink to this definition">¶</a></dt>
<dd><p>Delays by playing adding silence in front of the other sound’s data.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>attack</strong> (<em>float</em>) – The attack factor.</li>
<li><strong>release</strong> (<em>float</em>) – The release factor.</li>
<li><strong>threshold</strong> (<em>float</em>) – The general threshold value.</li>
<li><strong>arthreshold</strong> (<em>float</em>) – The attack/release threshold value.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.fadein">
<code class="descname">fadein</code><span class="sig-paren">(</span><em>start</em>, <em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.fadein" title="Permalink to this definition">¶</a></dt>
<dd><p>Fades a sound in by raising the volume linearly in the given time interval.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>start</strong> (<em>float</em>) – Time in seconds when the fading should start.</li>
<li><strong>length</strong> (<em>float</em>) – Time in seconds how long the fading should last.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Before the fade starts it plays silence.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.fadeout">
<code class="descname">fadeout</code><span class="sig-paren">(</span><em>start</em>, <em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.fadeout" title="Permalink to this definition">¶</a></dt>
<dd><p>Fades a sound in by lowering the volume linearly in the given time interval.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>start</strong> (<em>float</em>) – Time in seconds when the fading should start.</li>
<li><strong>length</strong> (<em>float</em>) – Time in seconds how long the fading should last.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">After the fade this sound plays silence, so that the length of the sound is not altered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.file">
<code class="descname">file</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.file" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a sound object of a sound file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> (<em>string</em>) – Path of the file.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If the file doesn’t exist or can’t be read you will not get an exception immediately, but when you try to start playback of that sound.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.filter">
<code class="descname">filter</code><span class="sig-paren">(</span><em>b</em>, <em>a = (1)</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.filter" title="Permalink to this definition">¶</a></dt>
<dd><p>Filters a sound with the supplied IIR filter coefficients.
Without the second parameter you’ll get a FIR filter.
If the first value of the a sequence is 0 it will be set to 1 automatically.
If the first value of the a sequence is neither 0 nor 1, all filter coefficients will be scaled by this value so that it is 1 in the end, you don’t have to scale yourself.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>b</strong> (<em>sequence of float</em>) – The nominator filter coefficients.</li>
<li><strong>a</strong> (<em>sequence of float</em>) – The denominator filter coefficients.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.highpass">
<code class="descname">highpass</code><span class="sig-paren">(</span><em>frequency</em>, <em>Q=0.5</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.highpass" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a second order highpass filter based on the transfer function H(s) = s^2 / (s^2 + s/Q + 1)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>frequency</strong> (<em>float</em>) – The cut off trequency of the highpass.</li>
<li><strong>Q</strong> (<em>float</em>) – Q factor of the lowpass.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.join">
<code class="descname">join</code><span class="sig-paren">(</span><em>sound</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.join" title="Permalink to this definition">¶</a></dt>
<dd><p>Plays two factories in sequence.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>sound</strong> (<a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a>) – The sound to play second.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The two factories have to have the same specifications (channels and samplerate).</p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="aud.Sound.length">
<code class="descname">length</code><a class="headerlink" href="#aud.Sound.length" title="Permalink to this definition">¶</a></dt>
<dd><p>The sample specification of the sound as a tuple with rate and channel count.</p>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.limit">
<code class="descname">limit</code><span class="sig-paren">(</span><em>start</em>, <em>end</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.limit" title="Permalink to this definition">¶</a></dt>
<dd><p>Limits a sound within a specific start and end time.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>start</strong> (<em>float</em>) – Start time in seconds.</li>
<li><strong>end</strong> (<em>float</em>) – End time in seconds.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.list">
<code class="descname">list</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.list" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates an empty sound list that can contain several sounds.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>random</strong> (<em>int</em>) – wether the playback will be random or not.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.loop">
<code class="descname">loop</code><span class="sig-paren">(</span><em>count</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.loop" title="Permalink to this definition">¶</a></dt>
<dd><p>Loops a sound.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>count</strong> (<em>integer</em>) – How often the sound should be looped. Negative values mean endlessly.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This is a filter function, you might consider using <a class="reference internal" href="handle.html#aud.Handle.loop_count" title="aud.Handle.loop_count"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Handle.loop_count</span></code></a> instead.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.lowpass">
<code class="descname">lowpass</code><span class="sig-paren">(</span><em>frequency</em>, <em>Q=0.5</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.lowpass" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a second order lowpass filter based on the transfer function H(s) = 1 / (s^2 + s/Q + 1)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>frequency</strong> (<em>float</em>) – The cut off trequency of the lowpass.</li>
<li><strong>Q</strong> (<em>float</em>) – Q factor of the lowpass.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.mix">
<code class="descname">mix</code><span class="sig-paren">(</span><em>sound</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.mix" title="Permalink to this definition">¶</a></dt>
<dd><p>Mixes two factories.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>sound</strong> (<a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a>) – The sound to mix over the other.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The two factories have to have the same specifications (channels and samplerate).</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.mutable">
<code class="descname">mutable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.mutable" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a sound that will be restarted when sought backwards.
If the original sound is a sound list, the playing sound can change.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.pingpong">
<code class="descname">pingpong</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.pingpong" title="Permalink to this definition">¶</a></dt>
<dd><p>Plays a sound forward and then backward.
This is like joining a sound with its reverse.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.pitch">
<code class="descname">pitch</code><span class="sig-paren">(</span><em>factor</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.pitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Changes the pitch of a sound with a specific factor.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>factor</strong> (<em>float</em>) – The factor to change the pitch with.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This is done by changing the sample rate of the underlying sound, which has to be an integer, so the factor value rounded and the factor may not be 100 % accurate.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This is a filter function, you might consider using <a class="reference internal" href="handle.html#aud.Handle.pitch" title="aud.Handle.pitch"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Handle.pitch</span></code></a> instead.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.rechannel">
<code class="descname">rechannel</code><span class="sig-paren">(</span><em>channels</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.rechannel" title="Permalink to this definition">¶</a></dt>
<dd><p>Rechannels the sound.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channels</strong> (<em>int</em>) – The new channel configuration.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.resample">
<code class="descname">resample</code><span class="sig-paren">(</span><em>rate</em>, <em>high_quality</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.resample" title="Permalink to this definition">¶</a></dt>
<dd><p>Resamples the sound.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>rate</strong> (<em>double</em>) – The new sample rate.</li>
<li><strong>high_quality</strong> (<em>bool</em>) – When true use a higher quality but slower resampler.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.reverse">
<code class="descname">reverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Plays a sound reversed.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The sound has to have a finite length and has to be seekable. It’s recommended to use this only with factories         with fast and accurate seeking, which is not true for encoded audio files, such ones should be buffered using <a class="reference internal" href="#aud.Sound.cache" title="aud.Sound.cache"><code class="xref py py-meth docutils literal notranslate"><span class="pre">cache()</span></code></a> before being played reversed.</p>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If seeking is not accurate in the underlying sound you’ll likely hear skips/jumps/cracks.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.sawtooth">
<code class="descname">sawtooth</code><span class="sig-paren">(</span><em>frequency</em>, <em>rate=48000</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.sawtooth" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a sawtooth sound which plays a sawtooth wave.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>frequency</strong> (<em>float</em>) – The frequency of the sawtooth wave in Hz.</li>
<li><strong>rate</strong> (<em>int</em>) – The sampling rate in Hz. It’s recommended to set this value to the playback device’s samling rate to avoid resamping.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.silence">
<code class="descname">silence</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.silence" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a silence sound which plays simple silence.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.sine">
<code class="descname">sine</code><span class="sig-paren">(</span><em>frequency</em>, <em>rate=48000</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.sine" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a sine sound which plays a sine wave.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>frequency</strong> (<em>float</em>) – The frequency of the sine wave in Hz.</li>
<li><strong>rate</strong> (<em>int</em>) – The sampling rate in Hz. It’s recommended to set this value to the playback device’s samling rate to avoid resamping.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="aud.Sound.specs">
<code class="descname">specs</code><a class="headerlink" href="#aud.Sound.specs" title="Permalink to this definition">¶</a></dt>
<dd><p>The sample specification of the sound as a tuple with rate and channel count.</p>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.square">
<code class="descname">square</code><span class="sig-paren">(</span><em>frequency</em>, <em>rate=48000</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.square" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a square sound which plays a square wave.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>frequency</strong> (<em>float</em>) – The frequency of the square wave in Hz.</li>
<li><strong>rate</strong> (<em>int</em>) – The sampling rate in Hz. It’s recommended to set this value to the playback device’s samling rate to avoid resamping.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.sum">
<code class="descname">sum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.sum" title="Permalink to this definition">¶</a></dt>
<dd><p>Sums the samples of a sound.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.threshold">
<code class="descname">threshold</code><span class="sig-paren">(</span><em>threshold = 0</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.threshold" title="Permalink to this definition">¶</a></dt>
<dd><p>Makes a threshold wave out of an audio wave by setting all samples with a amplitude &gt;= threshold to 1, all &lt;= -threshold to -1 and all between to 0.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>threshold</strong> (<em>float</em>) – Threshold value over which an amplitude counts non-zero.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.triangle">
<code class="descname">triangle</code><span class="sig-paren">(</span><em>frequency</em>, <em>rate=48000</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.triangle" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a triangle sound which plays a triangle wave.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>frequency</strong> (<em>float</em>) – The frequency of the triangle wave in Hz.</li>
<li><strong>rate</strong> (<em>int</em>) – The sampling rate in Hz. It’s recommended to set this value to the playback device’s samling rate to avoid resamping.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.volume">
<code class="descname">volume</code><span class="sig-paren">(</span><em>volume</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.volume" title="Permalink to this definition">¶</a></dt>
<dd><p>Changes the volume of a sound.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>volume</strong> (<em>float</em>) – The new volume..</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The created <a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a> object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#aud.Sound" title="aud.Sound"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sound</span></code></a></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Should be in the range [0, 1] to avoid clipping.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This is a filter function, you might consider using <a class="reference internal" href="handle.html#aud.Handle.volume" title="aud.Handle.volume"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Handle.volume</span></code></a> instead.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="aud.Sound.write">
<code class="descname">write</code><span class="sig-paren">(</span><em>filename</em>, <em>rate</em>, <em>channels</em>, <em>format</em>, <em>container</em>, <em>codec</em>, <em>bitrate</em>, <em>buffersize</em><span class="sig-paren">)</span><a class="headerlink" href="#aud.Sound.write" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the sound to a file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>filename</strong> (<em>string</em>) – The path to write to.</li>
<li><strong>rate</strong> (<em>int</em>) – The sample rate to write with.</li>
<li><strong>channels</strong> (<em>int</em>) – The number of channels to write with.</li>
<li><strong>format</strong> (<em>int</em>) – The sample format to write with.</li>
<li><strong>container</strong> (<em>int</em>) – The container format for the file.</li>
<li><strong>codec</strong> (<em>int</em>) – The codec to use in the file.</li>
<li><strong>bitrate</strong> (<em>int</em>) – The bitrate to write with.</li>
<li><strong>buffersize</strong> (<em>int</em>) – The size of the writing buffer.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">audaspace</a></h1>








<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorials.html">Tutorials</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="device.html">Device</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Sound</a></li>
<li class="toctree-l1"><a class="reference internal" href="handle.html">Handle</a></li>
<li class="toctree-l1"><a class="reference internal" href="sequence.html">Sequence</a></li>
<li class="toctree-l1"><a class="reference internal" href="sequence_entry.html">Sequence Entry</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
      <li>Previous: <a href="device.html" title="previous chapter">Device</a></li>
      <li>Next: <a href="handle.html" title="next chapter">Handle</a></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2009-2015, Jörg Müller.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.3</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
      
      |
      <a href="_sources/sound.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>