🎛 🔊 A Python library for audio.
C audioaudio-processingaudio-productionaudio-researchaudio-unitaugmentationjucemachine-learningpybind11pythonvst3vst3-host
Properly handle duration for MP3 files without Xing or Info frames.
Peter Sobot5a6348c3a488
diff --git a/docs/genindex.html b/docs/genindex.htmlindex 9b79ad8..13901b4 100644--- a/docs/genindex.html+++ b/docs/genindex.html@@ -389,12 +389,18 @@</li><li><a href="reference/pedalboard.html#pedalboard.Distortion">Distortion (class in pedalboard)</a></li>- </ul></td>- <td style="width: 33%; vertical-align: top;"><ul><li><a href="reference/pedalboard.io.html#pedalboard.io.ReadableAudioFile.duration">duration (pedalboard.io.ReadableAudioFile property)</a><ul><li><a href="reference/pedalboard.io.html#pedalboard.io.ResampledReadableAudioFile.duration">(pedalboard.io.ResampledReadableAudioFile property)</a>+</li>+ </ul></li>+ </ul></td>+ <td style="width: 33%; vertical-align: top;"><ul>+ <li><a href="reference/pedalboard.io.html#pedalboard.io.ReadableAudioFile.duration_is_accurate">duration_is_accurate (pedalboard.io.ReadableAudioFile property)</a>++ <ul>+ <li><a href="reference/pedalboard.io.html#pedalboard.io.ResampledReadableAudioFile.duration_is_accurate">(pedalboard.io.ResampledReadableAudioFile property)</a></li></ul></li></ul></td>diff --git a/docs/reference/pedalboard.io.html b/docs/reference/pedalboard.io.htmlindex 5b0a5c6..a564ed4 100644--- a/docs/reference/pedalboard.io.html+++ b/docs/reference/pedalboard.io.html@@ -472,16 +472,37 @@ same arguments to <a class="reference internal" href="#pedalboard.io.AudioFile"<dt class="sig sig-object py" id="pedalboard.io.ReadableAudioFile.read"><span class="sig-name descname"><span class="pre">read</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">num_frames</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">ndarray</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">dtype</span><span class="p"><span class="pre">[</span></span><span class="pre">float32</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#pedalboard.io.ReadableAudioFile.read" title="Permalink to this definition">#</a></dt><dd><p>Read the given number of frames (samples in each channel) from this audio file at its current position.</p>-<p><code class="docutils literal notranslate"><span class="pre">num_frames</span></code> is a required argument, as audio files can be deceptively large. (Consider that an hour-long <code class="docutils literal notranslate"><span class="pre">.ogg</span></code> file may be only a handful of megabytes on disk, but may decompress to nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid hard-to-debug memory problems and out-of-memory crashes.</p>-<p>Audio samples are returned as a multi-dimensional <code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> with the shape <code class="docutils literal notranslate"><span class="pre">(channels,</span> <span class="pre">samples)</span></code>; i.e.: a stereo audio file will have shape <code class="docutils literal notranslate"><span class="pre">(2,</span> <span class="pre"><length>)</span></code>. Returned data is always in the <code class="docutils literal notranslate"><span class="pre">float32</span></code> datatype.</p>-<p>For most (but not all) audio files, the minimum possible sample value will be <code class="docutils literal notranslate"><span class="pre">-1.0f</span></code> and the maximum sample value will be <code class="docutils literal notranslate"><span class="pre">+1.0f</span></code>.</p>+<p><code class="docutils literal notranslate"><span class="pre">num_frames</span></code> is a required argument, as audio files can be deceptively large. (Consider that+an hour-long <code class="docutils literal notranslate"><span class="pre">.ogg</span></code> file may be only a handful of megabytes on disk, but may decompress to+nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+hard-to-debug memory problems and out-of-memory crashes.</p>+<p>Audio samples are returned as a multi-dimensional <code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> with the shape+<code class="docutils literal notranslate"><span class="pre">(channels,</span> <span class="pre">samples)</span></code>; i.e.: a stereo audio file will have shape <code class="docutils literal notranslate"><span class="pre">(2,</span> <span class="pre"><length>)</span></code>.+Returned data is always in the <code class="docutils literal notranslate"><span class="pre">float32</span></code> datatype.</p>+<p>If the file does not contain enough audio data to fill <code class="docutils literal notranslate"><span class="pre">num_frames</span></code>, the returned+<code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> will contain as many frames as could be read from the file. (See+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate" title="pedalboard.io.ReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> for more information about situations+in which this may be true.)</p>+<p>For most (but not all) audio files, the minimum possible sample value will be <code class="docutils literal notranslate"><span class="pre">-1.0f</span></code> and the+maximum sample value will be <code class="docutils literal notranslate"><span class="pre">+1.0f</span></code>.</p></dd></dl><dl class="py method"><dt class="sig sig-object py" id="pedalboard.io.ReadableAudioFile.read_raw"><span class="sig-name descname"><span class="pre">read_raw</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">num_frames</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">ndarray</span></span></span><a class="headerlink" href="#pedalboard.io.ReadableAudioFile.read_raw" title="Permalink to this definition">#</a></dt>-<dd><p>Read the given number of frames (samples in each channel) from this audio file at the current position.</p>-<p>Audio samples are returned as a multi-dimensional <code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> with the shape <code class="docutils literal notranslate"><span class="pre">(channels,</span> <span class="pre">samples)</span></code>; i.e.: a stereo audio file will have shape <code class="docutils literal notranslate"><span class="pre">(2,</span> <span class="pre"><length>)</span></code>. Returned data is in the raw format stored by the underlying file (one of <code class="docutils literal notranslate"><span class="pre">int8</span></code>, <code class="docutils literal notranslate"><span class="pre">int16</span></code>, <code class="docutils literal notranslate"><span class="pre">int32</span></code>, or <code class="docutils literal notranslate"><span class="pre">float32</span></code>).</p>+<dd><p>Read the given number of frames (samples in each channel) from this audio file at its current position.</p>+<p><code class="docutils literal notranslate"><span class="pre">num_frames</span></code> is a required argument, as audio files can be deceptively large. (Consider that+an hour-long <code class="docutils literal notranslate"><span class="pre">.ogg</span></code> file may be only a handful of megabytes on disk, but may decompress to+nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+hard-to-debug memory problems and out-of-memory crashes.</p>+<p>Audio samples are returned as a multi-dimensional <code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> with the shape+<code class="docutils literal notranslate"><span class="pre">(channels,</span> <span class="pre">samples)</span></code>; i.e.: a stereo audio file will have shape <code class="docutils literal notranslate"><span class="pre">(2,</span> <span class="pre"><length>)</span></code>.+Returned data is in the raw format stored by the underlying file (one of <code class="docutils literal notranslate"><span class="pre">int8</span></code>, <code class="docutils literal notranslate"><span class="pre">int16</span></code>,+<code class="docutils literal notranslate"><span class="pre">int32</span></code>, or <code class="docutils literal notranslate"><span class="pre">float32</span></code>) and may have any magnitude.</p>+<p>If the file does not contain enough audio data to fill <code class="docutils literal notranslate"><span class="pre">num_frames</span></code>, the returned+<code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> will contain as many frames as could be read from the file. (See+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate" title="pedalboard.io.ReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> for more information about situations+in which this may be true.)</p></dd></dl><dl class="py method">@@ -519,6 +540,33 @@ same arguments to <a class="reference internal" href="#pedalboard.io.AudioFile"<dt class="sig sig-object py" id="pedalboard.io.ReadableAudioFile.duration"><em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">duration</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">float</span></em><a class="headerlink" href="#pedalboard.io.ReadableAudioFile.duration" title="Permalink to this definition">#</a></dt><dd><p>The duration of this file in seconds (<code class="docutils literal notranslate"><span class="pre">frames</span></code> divided by <code class="docutils literal notranslate"><span class="pre">samplerate</span></code>).</p>+<div class="admonition warning">+<p class="admonition-title">Warning</p>+<p><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> may be an overestimate for certain MP3 files.+Use <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate" title="pedalboard.io.ReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> property to determine if+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> is accurate. (See the documentation for the+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> attribute for more details.)</p>+</div>+</dd></dl>++<dl class="py property">+<dt class="sig sig-object py" id="pedalboard.io.ReadableAudioFile.duration_is_accurate">+<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">duration_is_accurate</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">bool</span></em><a class="headerlink" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate" title="Permalink to this definition">#</a></dt>+<dd><p>Returns <code class="xref py py-const docutils literal notranslate"><span class="pre">True</span></code> if this file’s <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> attributes are accurate, or <code class="xref py py-const docutils literal notranslate"><span class="pre">False</span></code> if the+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> attributes are estimates based+on the file’s size and bitrate.</p>+<p>If <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate" title="pedalboard.io.ReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> is <code class="xref py py-const docutils literal notranslate"><span class="pre">False</span></code>, this value will+change to <code class="xref py py-const docutils literal notranslate"><span class="pre">True</span></code> once the file is read to completion. Once+<code class="xref py py-const docutils literal notranslate"><span class="pre">True</span></code>, this value will not change back to <code class="xref py py-const docutils literal notranslate"><span class="pre">False</span></code>+for the same <a class="reference internal" href="#pedalboard.io.AudioFile" title="pedalboard.io.AudioFile"><code class="xref py py-class docutils literal notranslate"><span class="pre">AudioFile</span></code></a> object (even after calls to <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.seek" title="pedalboard.io.ReadableAudioFile.seek"><code class="xref py py-meth docutils literal notranslate"><span class="pre">seek()</span></code></a>).</p>+<div class="admonition note">+<p class="admonition-title">Note</p>+<p><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate" title="pedalboard.io.ReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> can only ever be <code class="xref py py-const docutils literal notranslate"><span class="pre">False</span></code>+when reading certain MP3 files. For files in other formats than MP3,+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate" title="pedalboard.io.ReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> will always be equal to <code class="xref py py-const docutils literal notranslate"><span class="pre">True</span></code>.</p>+</div>+<p><em>Introduced in v0.7.2.</em></p></dd></dl><dl class="py property">@@ -532,7 +580,42 @@ same arguments to <a class="reference internal" href="#pedalboard.io.AudioFile"<dt class="sig sig-object py" id="pedalboard.io.ReadableAudioFile.frames"><em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">frames</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">int</span></em><a class="headerlink" href="#pedalboard.io.ReadableAudioFile.frames" title="Permalink to this definition">#</a></dt><dd><p>The total number of frames (samples per channel) in this file.</p>-<p>For example, if this file contains 10 seconds of stereo audio at sample rate of 44,100 Hz, <code class="docutils literal notranslate"><span class="pre">frames</span></code> will return <code class="docutils literal notranslate"><span class="pre">441,000</span></code>.</p>+<p>For example, if this file contains 10 seconds of stereo audio at sample rate+of 44,100 Hz, <code class="docutils literal notranslate"><span class="pre">frames</span></code> will return <code class="docutils literal notranslate"><span class="pre">441,000</span></code>.</p>+<div class="admonition warning">+<p class="admonition-title">Warning</p>+<p>When reading certain MP3 files that have been encoded in constant bitrate mode,+the <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> properties may initially be estimates+and <strong>may change as the file is read</strong>. The <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate" title="pedalboard.io.ReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a>+property indicates if the values of <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a>+are estimates or exact values.</p>+<p>This discrepancy is due to the fact that MP3 files are not required to have+headers that indicate the duration of the file. If an MP3 file is opened and a+<code class="docutils literal notranslate"><span class="pre">Xing</span></code> or <code class="docutils literal notranslate"><span class="pre">Info</span></code> header frame is not found, the initial value of the+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> attributes are estimates based on the file’s+bitrate and size. This may result in an overestimate of the file’s duration+if there is additional data present in the file after the audio stream is finished.</p>+<p>If the exact number of frames in the file is required, read the entire file+first before accessing the <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> or <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> properties.+This operation forces each frame to be parsed and guarantees that+<a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration" title="pedalboard.io.ReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> are correct, at the expense of+scanning the entire file:</p>+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">with</span> <span class="n">AudioFile</span><span class="p">(</span><span class="s2">"my_file.mp3"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>+ <span class="k">while</span> <span class="n">f</span><span class="o">.</span><span class="n">tell</span><span class="p">()</span> <span class="o"><</span> <span class="n">f</span><span class="o">.</span><span class="n">frames</span><span class="p">:</span>+ <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">samplerate</span> <span class="o">*</span> <span class="mi">60</span><span class="p">)</span>++ <span class="c1"># f.frames is now guaranteed to be accurate, as the entire file has been read:</span>+ <span class="k">assert</span> <span class="n">f</span><span class="o">.</span><span class="n">duration_is_accurate</span> <span class="o">==</span> <span class="kc">True</span>++ <span class="n">f</span><span class="o">.</span><span class="n">seek</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>+ <span class="n">num_channels</span><span class="p">,</span> <span class="n">num_samples</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">frames</span><span class="p">)</span><span class="o">.</span><span class="n">shape</span>+ <span class="k">assert</span> <span class="n">num_samples</span> <span class="o">==</span> <span class="n">f</span><span class="o">.</span><span class="n">frames</span>+</pre></div>+</div>+<p>This behaviour is present in v0.7.2 and later; prior versions would+raise an exception when trying to read the ends of MP3 files that contained+trailing non-audio data and lacked <code class="docutils literal notranslate"><span class="pre">Xing</span></code> or <code class="docutils literal notranslate"><span class="pre">Info</span></code> headers.</p>+</div></dd></dl><dl class="py property">@@ -600,10 +683,22 @@ reads, seeking through files, and using a constant amount of memory.</p><dl class="py method"><dt class="sig sig-object py" id="pedalboard.io.ResampledReadableAudioFile.read"><span class="sig-name descname"><span class="pre">read</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">num_frames</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">ndarray</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">dtype</span><span class="p"><span class="pre">[</span></span><span class="pre">float32</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#pedalboard.io.ResampledReadableAudioFile.read" title="Permalink to this definition">#</a></dt>-<dd><p>Read the given number of frames (samples in each channel, at the target sample rate) from this audio file at its current position, automatically resampling on-the-fly to <code class="docutils literal notranslate"><span class="pre">target_sample_rate</span></code>.</p>-<p><code class="docutils literal notranslate"><span class="pre">num_frames</span></code> is a required argument, as audio files can be deceptively large. (Consider that an hour-long <code class="docutils literal notranslate"><span class="pre">.ogg</span></code> file may be only a handful of megabytes on disk, but may decompress to nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid hard-to-debug memory problems and out-of-memory crashes.</p>-<p>Audio samples are returned as a multi-dimensional <code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> with the shape <code class="docutils literal notranslate"><span class="pre">(channels,</span> <span class="pre">samples)</span></code>; i.e.: a stereo audio file will have shape <code class="docutils literal notranslate"><span class="pre">(2,</span> <span class="pre"><length>)</span></code>. Returned data is always in the <code class="docutils literal notranslate"><span class="pre">float32</span></code> datatype.</p>-<p>For most (but not all) audio files, the minimum possible sample value will be <code class="docutils literal notranslate"><span class="pre">-1.0f</span></code> and the maximum sample value will be <code class="docutils literal notranslate"><span class="pre">+1.0f</span></code>.</p>+<dd><p>Read the given number of frames (samples in each channel, at the target sample rate)+from this audio file at its current position, automatically resampling on-the-fly to+<code class="docutils literal notranslate"><span class="pre">target_sample_rate</span></code>.</p>+<p><code class="docutils literal notranslate"><span class="pre">num_frames</span></code> is a required argument, as audio files can be deceptively large. (Consider that+an hour-long <code class="docutils literal notranslate"><span class="pre">.ogg</span></code> file may be only a handful of megabytes on disk, but may decompress to+nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+hard-to-debug memory problems and out-of-memory crashes.</p>+<p>Audio samples are returned as a multi-dimensional <code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> with the shape+<code class="docutils literal notranslate"><span class="pre">(channels,</span> <span class="pre">samples)</span></code>; i.e.: a stereo audio file will have shape <code class="docutils literal notranslate"><span class="pre">(2,</span> <span class="pre"><length>)</span></code>.+Returned data is always in the <code class="docutils literal notranslate"><span class="pre">float32</span></code> datatype.</p>+<p>If the file does not contain enough audio data to fill <code class="docutils literal notranslate"><span class="pre">num_frames</span></code>, the returned+<code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.array</span></code> will contain as many frames as could be read from the file. (See+<a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.frames" title="pedalboard.io.ResampledReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration_is_accurate" title="pedalboard.io.ResampledReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> for more information about situations+in which this may be true.)</p>+<p>For most (but not all) audio files, the minimum possible sample value will be <code class="docutils literal notranslate"><span class="pre">-1.0f</span></code> and the+maximum sample value will be <code class="docutils literal notranslate"><span class="pre">+1.0f</span></code>.</p></dd></dl><dl class="py method">@@ -635,6 +730,30 @@ reads, seeking through files, and using a constant amount of memory.</p><dt class="sig sig-object py" id="pedalboard.io.ResampledReadableAudioFile.duration"><em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">duration</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">float</span></em><a class="headerlink" href="#pedalboard.io.ResampledReadableAudioFile.duration" title="Permalink to this definition">#</a></dt><dd><p>The duration of this file in seconds (<code class="docutils literal notranslate"><span class="pre">frames</span></code> divided by <code class="docutils literal notranslate"><span class="pre">samplerate</span></code>).</p>+<div class="admonition warning">+<p class="admonition-title">Warning</p>+<p>When reading certain MP3 files, the <a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.frames" title="pedalboard.io.ResampledReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration" title="pedalboard.io.ResampledReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> properties may initially be estimates and <strong>may change as the file is read</strong>. See the documentation for <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ReadableAudioFile.frames</span></code></a> for more details.</p>+</div>+</dd></dl>++<dl class="py property">+<dt class="sig sig-object py" id="pedalboard.io.ResampledReadableAudioFile.duration_is_accurate">+<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">duration_is_accurate</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">bool</span></em><a class="headerlink" href="#pedalboard.io.ResampledReadableAudioFile.duration_is_accurate" title="Permalink to this definition">#</a></dt>+<dd><p>Returns <code class="xref py py-const docutils literal notranslate"><span class="pre">True</span></code> if this file’s <a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.frames" title="pedalboard.io.ResampledReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and+<a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration" title="pedalboard.io.ResampledReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> attributes are accurate, or <code class="xref py py-const docutils literal notranslate"><span class="pre">False</span></code> if the+<a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.frames" title="pedalboard.io.ResampledReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration" title="pedalboard.io.ResampledReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> attributes are estimates based+on the file’s size and bitrate.</p>+<p><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration_is_accurate" title="pedalboard.io.ResampledReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> will change from <code class="xref py py-const docutils literal notranslate"><span class="pre">False</span></code> to+<code class="xref py py-const docutils literal notranslate"><span class="pre">True</span></code> as the file is read to completion. Once <code class="xref py py-const docutils literal notranslate"><span class="pre">True</span></code>,+this value will not change back to <code class="xref py py-const docutils literal notranslate"><span class="pre">False</span></code> for the same+<a class="reference internal" href="#pedalboard.io.AudioFile" title="pedalboard.io.AudioFile"><code class="xref py py-class docutils literal notranslate"><span class="pre">AudioFile</span></code></a> object (even after calls to <a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.seek" title="pedalboard.io.ResampledReadableAudioFile.seek"><code class="xref py py-meth docutils literal notranslate"><span class="pre">seek()</span></code></a>).</p>+<div class="admonition note">+<p class="admonition-title">Note</p>+<p><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration_is_accurate" title="pedalboard.io.ResampledReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> can only ever be <code class="xref py py-const docutils literal notranslate"><span class="pre">False</span></code>+when reading certain MP3 files. For files in other formats than MP3,+<a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration_is_accurate" title="pedalboard.io.ResampledReadableAudioFile.duration_is_accurate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration_is_accurate</span></code></a> will always be equal to <code class="xref py py-const docutils literal notranslate"><span class="pre">True</span></code>.</p>+</div>+<p><em>Introduced in v0.7.2.</em></p></dd></dl><dl class="py property">@@ -650,6 +769,10 @@ reads, seeking through files, and using a constant amount of memory.</p><dd><p>The total number of frames (samples per channel) in this file, at the target sample rate.</p><p>For example, if this file contains 10 seconds of stereo audio at sample rate of 44,100 Hz, and <code class="docutils literal notranslate"><span class="pre">target_sample_rate</span></code> is 22,050 Hz, <code class="docutils literal notranslate"><span class="pre">frames</span></code> will return <code class="docutils literal notranslate"><span class="pre">22,050</span></code>.</p><p>Note that different <code class="docutils literal notranslate"><span class="pre">resampling_quality</span></code> values used for resampling may cause <code class="docutils literal notranslate"><span class="pre">frames</span></code> to differ by ± 1 from its expected value.</p>+<div class="admonition warning">+<p class="admonition-title">Warning</p>+<p>When reading certain MP3 files, the <a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.frames" title="pedalboard.io.ResampledReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">frames</span></code></a> and <a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration" title="pedalboard.io.ResampledReadableAudioFile.duration"><code class="xref py py-attr docutils literal notranslate"><span class="pre">duration</span></code></a> properties may initially be estimates and <strong>may change as the file is read</strong>. See the documentation for <a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames" title="pedalboard.io.ReadableAudioFile.frames"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ReadableAudioFile.frames</span></code></a> for more details.</p>+</div></dd></dl><dl class="py property">@@ -916,6 +1039,7 @@ second argument.</p><li><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.tell"><code class="docutils literal notranslate"><span class="pre">ReadableAudioFile.tell()</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.closed"><code class="docutils literal notranslate"><span class="pre">ReadableAudioFile.closed</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration"><code class="docutils literal notranslate"><span class="pre">ReadableAudioFile.duration</span></code></a></li>+<li><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.duration_is_accurate"><code class="docutils literal notranslate"><span class="pre">ReadableAudioFile.duration_is_accurate</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.file_dtype"><code class="docutils literal notranslate"><span class="pre">ReadableAudioFile.file_dtype</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.frames"><code class="docutils literal notranslate"><span class="pre">ReadableAudioFile.frames</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ReadableAudioFile.name"><code class="docutils literal notranslate"><span class="pre">ReadableAudioFile.name</span></code></a></li>@@ -933,6 +1057,7 @@ second argument.</p><li><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.tell"><code class="docutils literal notranslate"><span class="pre">ResampledReadableAudioFile.tell()</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.closed"><code class="docutils literal notranslate"><span class="pre">ResampledReadableAudioFile.closed</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration"><code class="docutils literal notranslate"><span class="pre">ResampledReadableAudioFile.duration</span></code></a></li>+<li><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.duration_is_accurate"><code class="docutils literal notranslate"><span class="pre">ResampledReadableAudioFile.duration_is_accurate</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.file_dtype"><code class="docutils literal notranslate"><span class="pre">ResampledReadableAudioFile.file_dtype</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.frames"><code class="docutils literal notranslate"><span class="pre">ResampledReadableAudioFile.frames</span></code></a></li><li><a class="reference internal" href="#pedalboard.io.ResampledReadableAudioFile.name"><code class="docutils literal notranslate"><span class="pre">ResampledReadableAudioFile.name</span></code></a></li>diff --git a/docs/searchindex.js b/docs/searchindex.jsindex c0e1b8b..9255fbf 100644--- a/docs/searchindex.js+++ b/docs/searchindex.js@@ -1 +1 @@-Search.setIndex({"docnames": ["compatibility", "examples", "faq", "index", "internals", "license", "reference/pedalboard", "reference/pedalboard.io"], "filenames": ["compatibility.rst", "examples.rst", "faq.rst", "index.rst", "internals.rst", "license.rst", "reference/pedalboard.rst", "reference/pedalboard.io.rst"], "titles": ["Plugin Compatibility", "Examples", "Frequently Asked Questions", "Features", "Pedalboard Internals", "License", "The <code class=\"docutils literal notranslate\"><span class=\"pre\">pedalboard</span></code> API", "The <code class=\"docutils literal notranslate\"><span class=\"pre\">pedalboard.io</span></code> API"], "terms": {"pedalboard": [0, 3, 5], "allow": [0, 1, 2, 3, 6, 7], "load": [0, 1, 3, 4, 6], "vst3": [0, 3, 4, 5, 6], "audio": [0, 3, 4, 5, 6, 7], "unit": [0, 2, 3, 4, 6], "which": [0, 2, 5, 6, 7], "could": [0, 2, 6], "contain": [0, 1, 2, 6, 7], "ani": [0, 2, 4, 6, 7], "code": [0, 2, 4, 5, 7], "most": [0, 2, 3, 4, 6, 7], "have": [0, 2, 4, 6, 7], "been": [0, 7], "test": [0, 3, 4], "work": [0, 1, 3, 6, 7], "just": [0, 1, 2, 4, 6, 7], "fine": [0, 2], "some": [0, 1, 4, 7], "mai": [0, 4, 6, 7], "worst": [0, 7], "even": [0, 3], "crash": [0, 7], "python": [0, 1, 2, 3, 4, 6, 7], "interpret": [0, 2, 3, 7], "without": [0, 2, 3, 6, 7], "warn": 0, "abil": 0, "catch": 0, "error": 0, "ar": [0, 1, 2, 3, 4, 5, 6, 7], "well": [0, 3, 4, 6, 7], "behav": [0, 1], "conform": 0, "set": [0, 1, 2, 6, 7], "convent": 0, "how": [0, 1, 6], "suppos": 0, "mani": [0, 3, 6, 7], "do": [0, 1, 7], "specif": [0, 6], "attempt": [0, 7], "detect": [0, 6], "common": [0, 3], "program": [0, 1, 2], "can": [0, 1, 3, 4, 6, 7], "around": [0, 4, 6], "issu": [0, 2, 4], "includ": [0, 1, 2, 3, 4, 5], "automat": [0, 3, 6, 7], "don": [0, 1, 7], "t": [0, 1, 2, 7], "clear": [0, 6], "intern": [0, 3, 6, 7], "state": [0, 6, 7], "when": [0, 2, 3, 4, 6, 7], "ask": [0, 3], "so": [0, 1, 2, 6, 7], "misbehav": 0, "notic": 0, "If": [0, 1, 3, 6, 7], "i": [0, 1, 2, 3, 4, 5, 6, 7], "being": [0, 7], "render": [0, 7], "incorrectli": 0, "leak": [0, 7], "from": [0, 1, 2, 3, 5, 6, 7], "one": [0, 1, 3, 6, 7], "process": [0, 1, 2, 3, 4, 5, 6, 7], "call": [0, 6, 7], "next": 0, "an": [0, 1, 2, 4, 6, 7], "undesir": 0, "fashion": [0, 2], "try": [0, 6], "pass": [0, 2, 6, 7], "silenc": 0, "between": [0, 2, 6, 7], "ensur": [0, 2, 4, 7], "reverb": [0, 1, 2, 3, 6, 7], "tail": [0, 2, 6], "other": [0, 1, 3, 6, 7], "ha": [0, 1, 6, 7], "time": [0, 1, 3, 6, 7], "fade": 0, "reload": 0, "everi": [0, 4, 7], "load_plugin": [0, 1, 3, 4, 6], "import": [1, 2, 4, 6, 7], "choru": [1, 3, 6], "io": [1, 2, 3, 6], "audiofil": [1, 2, 7], "read": [1, 2, 3, 6, 7], "whole": 1, "file": [1, 2, 3, 4, 6, 7], "wav": [1, 2, 3, 7], "f": [1, 7], "frame": [1, 2, 7], "sampler": [1, 2, 7], "object": [1, 2, 6, 7], "multipl": [1, 2, 3, 6, 7], "board": [1, 2], "room_siz": [1, 6], "0": [1, 2, 6, 7], "25": [1, 6], "run": [3, 6, 7], "through": [1, 2, 6, 7], "thi": [1, 2, 5, 6, 7], "write": [1, 2, 3, 6, 7], "back": [1, 6, 7], "output": [1, 2, 6, 7], "w": [1, 2, 7], "shape": [1, 2, 7], "It": [1, 3], "smaller": [1, 2, 7], "resampl": [1, 3, 6, 7], "our": [1, 2], "desir": 1, "sampl": [1, 2, 6, 7], "rate": [1, 2, 6, 7], "44100": [1, 7], "input": [1, 2, 6, 7], "resampled_to": [1, 7], "pretti": 1, "interest": 1, "sound": [1, 6], "compressor": [1, 2, 3, 6], "threshold_db": [1, 6], "50": [1, 6], "ratio": [1, 6], "gain": [1, 3, 6], "gain_db": [1, 6], "30": [1, 7], "ladderfilt": [1, 3, 6], "mode": [1, 6, 7], "hpf12": [1, 6], "cutoff_hz": [1, 6], "900": 1, "phaser": [1, 3, 6], "convolut": [1, 3, 6], "guitar_amp": 1, "1": [1, 2, 3, 6, 7], "like": [1, 3, 6, 7], "list": [1, 6, 7], "you": [1, 3, 7], "add": [1, 2, 3, 4, 6, 7], "append": [1, 6, 7], "10": [1, 3, 6, 7], "limit": [1, 3, 6], "chang": [1, 3, 6, 7], "paramet": [1, 3, 6, 7], "easili": 1, "40": 1, "known": 1, "path": [1, 6, 7], "disk": [1, 7], "vst": [1, 3, 5], "roughrider3": 1, "print": [1, 6, 7], "kei": [1, 6], "dict_kei": 1, "sc_hpf_hz": 1, "input_lvl_db": 1, "sensitivity_db": 1, "attack_m": [1, 6], "release_m": [1, 6], "makeup_db": 1, "mix": [1, 6], "output_lvl_db": 1, "sc_activ": 1, "full_bandwidth": 1, "bypass": 1, "15": 1, "r": [1, 7], "put": 1, "same": [1, 4, 6, 7], "instanc": [1, 4, 6, 7], "delai": [1, 2, 3, 6], "pitch": [1, 3, 6], "shift": [1, 6], "themselv": [1, 6], "nest": [1, 6], "them": [1, 6], "much": [1, 6], "distort": [1, 3, 6], "pitchshift": [1, 3, 5, 6], "passthrough": 1, "delay_and_pitch_shift": 1, "delay_second": [1, 6], "semiton": [1, 6], "7": [1, 3, 6, 7], "3": [1, 3, 6], "delay_longer_and_more_pitch_shift": 1, "5": [1, 6], "12": [1, 6], "6": [1, 3, 5, 6, 7], "front": 1, "all": [1, 2, 3, 4, 6, 7], "simultan": 1, "final": 1, "For": [1, 6, 7], "more": [1, 3, 4, 6, 7], "see": [1, 2, 6, 7], "folder": 1, "repositori": [1, 4], "demo": 1, "colab": 1, "notebook": 1, "interact": [1, 7], "web": 1, "hug": 1, "face": 1, "space": 1, "gradio": 1, "via": [1, 3, 6, 7], "ak391": 1, "technic": 2, "ye": 2, "pull": [2, 5], "request": 2, "98": 2, "experiment": [2, 3], "interfac": [1, 2, 4, 6, 7], "written": [2, 4, 7], "c": [2, 4, 7], "stefanobazzi": 2, "guitarboard": 2, "project": [2, 5], "exampl": [2, 3, 4, 6, 7], "sounddevic": 2, "librari": [2, 3, 4, 5, 6, 7], "howev": [2, 6], "coupl": 2, "big": 2, "caveat": 2, "talk": 2, "about": [1, 2], "context": [2, 7], "languag": 2, "garbag": 2, "collect": 2, "mean": 2, "your": [1, 2, 7], "randomli": 2, "paus": 2, "regular": [1, 2, 6, 7], "interv": 2, "clean": 2, "up": [1, 2, 3, 6], "unus": [2, 7], "In": [2, 7], "result": [2, 7], "random": [2, 7], "pop": 2, "click": 2, "drop": 2, "out": [1, 2, 3, 6, 7], "veri": 2, "difficult": 2, "prevent": [2, 7], "global": [2, 3, 7], "lock": [2, 3, 7], "also": [2, 3, 4, 6, 7], "potenti": [2, 7], "unbound": [2, 7], "switch": 2, "thread": [2, 3, 4, 7], "oper": [2, 6, 7], "system": [2, 6, 7], "separ": 2, "high": [2, 6, 7], "prioriti": 2, "block": [2, 6, 7], "caus": [2, 6, 7], "stutter": 2, "access": [2, 6, 7], "mutat": 2, "note": [1, 2, 6, 7], "applic": [2, 4], "stream": [1, 2, 3, 6, 7], "larg": [2, 7], "buffer": [2, 6, 7], "size": [2, 4, 6], "second": [1, 2, 6, 7], "soft": 2, "requir": [2, 3, 4, 6, 7], "case": [2, 3, 4, 6, 7], "network": 2, "data": [2, 3, 7], "offlin": 2, "chunk": [1, 2, 6, 7], "while": [1, 2, 6, 7], "built": [2, 3], "function": [2, 4, 6, 7], "possibl": [2, 3, 7], "vari": 2, "manual": [2, 3], "tqdm": 2, "step": 2, "would": [2, 4, 6, 7], "give": [2, 6], "smoother": 2, "transit": 2, "expens": [2, 6], "speed": [2, 3, 4, 6, 7], "step_size_in_sampl": 2, "100": [2, 6, 7], "_n_": 2, "af": 2, "open": [1, 2, 4, 7], "we": 2, "directli": [2, 6, 7], "save": 2, "memori": [2, 3, 6, 7], "num_channel": [1, 2, 7], "o": [1, 2, 3, 6, 7], "creat": [2, 3, 6, 7], "progress": 2, "bar": 2, "show": [2, 4, 6], "total": [2, 7], "pbar": 2, "rang": [2, 3, 6], "wet": [2, 6], "equal": [2, 3, 6, 7], "percentag": [2, 6], "track": 2, "e": [2, 6, 7], "make": [2, 3], "ramp": 2, "percentage_through_track": 2, "wet_level": [2, 6, 7], "updat": 2, "number": [2, 3, 5, 6, 7], "receiv": [2, 6, 7], "reset": [1, 2, 6, 7], "fals": [1, 2, 6, 7], "aren": 2, "cut": [2, 6], "off": [2, 6], "With": 2, "techniqu": [2, 6], "autom": 2, "usual": [2, 6, 7], "somewher": 2, "000": [2, 7], "2m": 2, "22m": 2, "44": [2, 6, 7], "1khz": [2, 6], "small": 2, "enough": 2, "avoid": [2, 7], "hear": 2, "artifact": [2, 6], "slow": [2, 6], "down": 2, "dramat": 2, "Not": [2, 4, 6, 7], "yet": 2, "The": [1, 2, 4, 5], "underli": [2, 6, 7], "framework": 2, "juce": [2, 4, 5], "au": [2, 7], "itself": [2, 4, 6], "modifi": 2, "either": [2, 7], "although": [2, 6, 7], "ad": [1, 3, 6, 7], "effect": [3, 4, 6, 7], "support": [1, 3, 4, 6, 7], "popular": 3, "format": [3, 6, 7], "box": 3, "us": [3, 4, 5, 6, 7], "third": [3, 6], "parti": [3, 6], "plugin": [3, 5, 6, 7], "wa": [3, 6, 7], "spotifi": [1, 3, 5], "": [3, 4, 6, 7], "intellig": 3, "lab": 3, "enabl": 3, "studio": 3, "qualiti": [3, 6, 7], "within": [3, 4, 6], "tensorflow": 3, "augment": 3, "improv": 3, "machin": [3, 4], "learn": [3, 4], "model": [3, 6], "help": 3, "content": [3, 7], "creation": 3, "digit": [3, 4, 6], "workstat": 3, "util": [3, 6], "aiff": [3, 7], "flac": [3, 7], "mp3": [3, 6, 7], "ogg": [3, 7], "platform": [3, 4, 6, 7], "depend": [3, 4, 6, 7], "addit": [3, 4, 6, 7], "aac": [3, 7], "ac3": [3, 7], "wma": [3, 7], "fly": [3, 7], "usag": [3, 6], "basic": [3, 6, 7], "transform": 3, "guitar": [3, 6], "style": 3, "clip": [3, 6], "loud": [3, 6], "dynam": [3, 6], "filter": [3, 6], "highpassfilt": [3, 6], "lowpassfilt": [3, 6], "spatial": 3, "lossi": [3, 6], "compress": [3, 6, 7], "gsmfullratecompressor": [3, 5, 6], "mp3compressor": [3, 5, 6], "reduct": [3, 6], "bitcrush": [3, 6], "maco": [1, 3, 4, 6, 7], "window": [1, 3, 4, 6, 7], "linux": [3, 4, 6, 7], "strong": 3, "safeti": [3, 7], "guarante": 3, "releas": [3, 6, 7], "gil": 3, "cpu": 3, "core": [3, 5], "No": [3, 6], "need": [3, 4, 7], "multiprocess": 3, "onli": [3, 6, 7], "300x": 3, "faster": 3, "than": [3, 4, 6, 7], "pysox": 3, "singl": [3, 6], "2": [3, 6, 7], "5x": 3, "soxbind": 3, "icorv": 3, "4x": 3, "librosa": 3, "tf": 3, "pipelin": 3, "avail": [3, 4, 6, 7], "pypi": 3, "wheel": [3, 4], "pip": 3, "That": 3, "new": [3, 7], "follow": [3, 4, 5, 6, 7], "md": 3, "robust": 3, "guid": 3, "thoroughli": 3, "8": [3, 6], "9": 3, "11": 3, "heavili": 3, "product": 3, "github": [1, 3], "manylinux": 3, "x86_64": 3, "intel": 3, "amd": 3, "aarch64": 3, "arm": 3, "appl": [3, 6], "silicon": 3, "rel": 3, "modern": 3, "glibc": 3, "27": 3, "both": [3, 6], "wide": [3, 6], "amd64": 3, "x86": 3, "64": [3, 6], "api": [3, 4], "quick": 3, "start": [3, 7], "parallel": [3, 6], "chain": [3, 6, 7], "frequent": 3, "question": 3, "live": [3, 7], "real": [1, 3, 6, 7], "doe": [3, 4, 6, 7], "over": [3, 6], "instrument": 3, "instead": [1, 3, 6, 7], "accept": [3, 6, 7], "midi": 3, "design": [3, 6], "consider": 3, "licens": [3, 4], "repo": 3, "wrapper": [4, 6], "sourc": [4, 7], "cross": [4, 6], "develop": 4, "pybind11": 4, "bind": 4, "goal": [4, 7], "expos": [4, 6], "signal": [4, 6], "idiomat": 4, "wai": [4, 7], "provid": [4, 6, 7], "raw": [4, 6, 7], "perform": [4, 7], "dsp": 4, "hide": 4, "complex": 4, "programm": 4, "intuit": 4, "varieti": 4, "reason": 4, "wider": 4, "compat": [4, 5, 6], "notabl": 4, "rare": [4, 6], "fewer": [4, 6], "simpler": 4, "remov": [4, 6], "copi": 4, "associ": 4, "resourc": [4, 7], "option": [4, 6, 7], "might": 4, "meant": 4, "music": 4, "appropri": [4, 6], "vice": 4, "versa": 4, "stabil": 4, "environ": 4, "where": 4, "implement": [4, 6, 7], "logic": 4, "portabl": 4, "safe": [4, 7], "constraint": 4, "should": [4, 6, 7], "consid": [4, 6, 7], "gplv3": [4, 5], "static": [4, 5, 6], "link": 4, "vendor": 4, "git": 4, "submodul": 4, "binari": [4, 7], "distribut": 4, "Will": [4, 7], "increas": [4, 6, 7], "amount": [4, 6, 7], "compil": [4, 5], "runtim": 4, "cannot": [4, 6], "user": 4, "instal": [4, 6, 7], "softwar": 4, "complic": 4, "simplic": 4, "packag": [4, 6, 7], "copyright": 5, "2021": 5, "2022": [1, 5], "ab": 5, "under": [5, 7], "gnu": 5, "gener": [5, 6], "public": 5, "v3": 5, "carri": 5, "dual": 5, "commerci": 5, "sdk": 5, "bundl": [5, 6], "own": [5, 6], "steinberg": [5, 6], "media": 5, "technologi": 5, "gmbh": [5, 6], "rubber": [5, 6], "band": [5, 6], "gplv2": 5, "newer": 5, "libmp3lam": 5, "lame": [5, 6, 7], "lgplv2": 5, "upgrad": 5, "inclus": 5, "permit": 5, "libgsm": 5, "isc": 5, "regist": 5, "trademark": 5, "modul": [6, 7], "class": [6, 7], "subclass": 6, "each": [6, 7], "appli": 6, "audiounitplugin": 6, "path_to_plugin_fil": 6, "str": [6, 7], "parameter_valu": 6, "dict": 6, "union": [6, 7], "int": [1, 6, 7], "float": [6, 7], "bool": [6, 7], "plugin_nam": 6, "none": [6, 7], "A": [6, 7], "non": [6, 7], "unavail": 6, "must": [6, 7], "loadabl": 6, "plug": [6, 7], "Ins": 6, "compon": 6, "vst3plugin": 6, "get_plugin_names_for_fil": 6, "filenam": [6, 7], "return": [6, 7], "name": [6, 7], "given": [6, 7], "scan": 6, "importerror": 6, "rais": [6, 7], "insid": 6, "method": [6, 7], "determin": 6, "present": 6, "what": 6, "properti": [6, 7], "report": 6, "self": 6, "pedalboard_n": 6, "input_arrai": 6, "numpi": [6, 7], "ndarrai": [6, 7], "sample_r": [6, 7], "buffer_s": [6, 7], "8192": 6, "true": [6, 7], "float32": [6, 7], "32": [6, 7], "bit": [6, 7], "point": [6, 7], "arrai": [6, 7], "were": 6, "expect": [6, 7], "To": [6, 7], "remain": [6, 7], "anoth": 6, "datatyp": [6, 7], "convert": [6, 7], "argument": [6, 7], "control": 6, "higher": 6, "flag": 6, "befor": [6, 7], "begin": [6, 7], "previou": 6, "store": [6, 7], "g": 6, "line": [6, 7], "lfo": 6, "etc": [6, 7], "valu": [6, 7], "unchang": 6, "show_editor": 6, "_audiounitplugin": 6, "ui": 6, "nativ": [6, 7], "until": [1, 6, 7], "close": [1, 6, 7], "keyboardinterrupt": [6, 7], "bit_depth": [6, 7], "reduc": 6, "depth": [6, 7], "lo": 6, "fi": 6, "vertic": 6, "resolut": 6, "uniqu": 6, "repres": 6, "horizont": 6, "per": [6, 7], "quantiz": 6, "integ": [6, 7], "decim": 6, "onto": 6, "dtype": [6, 7], "zero": 6, "plugincontain": 6, "arg0": [6, 7], "insert": 6, "index": 6, "arg": [], "kwarg": [], "overload": [], "float64": 7, "rate_hz": 6, "centre_delay_m": 6, "feedback": 6, "frequenc": 6, "respons": 6, "centr": 6, "get": 6, "classic": 6, "m": 6, "low": 6, "feeback": 6, "volum": 6, "flanger": 6, "lower": 6, "lot": 6, "vibrato": 6, "oscil": 6, "hertz": 6, "hz": [6, 7], "hard": [6, 7], "threshold": 6, "decibel": 6, "algorithm": [6, 7], "introduc": [6, 7], "nois": 6, "gsmcompressor": 6, "impulse_response_filenam": 6, "suitabl": 6, "thing": 6, "speaker": [1, 6, 7], "simul": 6, "dry": 6, "drive_db": 6, "linear": [6, 7], "tanh": 6, "hyperbol": 6, "tangent": 6, "waveshap": 6, "harmon": 6, "pleas": 6, "produc": 6, "roughli": 6, "equival": 6, "def": 6, "x": 6, "db_to_gain": 6, "windowedsinc": [6, 7], "4": 6, "degrad": 6, "gsm": 6, "full": 6, "emul": 6, "2g": 6, "cellular": 6, "phone": 6, "connect": 6, "fix": 6, "8khz": 6, "codec": [6, 7], "specifi": [6, 7], "decreas": [6, 7], "amplifi": 6, "attenu": 6, "think": 6, "highshelffilt": 6, "cutoff_frequency_hz": 6, "440": 6, "q": 6, "7071067690849304": 6, "shelf": 6, "variabl": [6, 7], "abov": 6, "cutoff": 6, "boost": 6, "first": 6, "order": 6, "roll": 6, "6db": 6, "octav": 6, "3db": 6, "frac": 6, "sqrt": 6, "express": 6, "factor": 6, "further": [6, 7], "iirfilt": 6, "abstract": 6, "variou": 6, "kind": 6, "infinit": 6, "impuls": 6, "iir": 6, "lowshelffilt": 6, "peakfilt": 6, "invert": 6, "flip": 6, "polar": 6, "audibl": 6, "its": [6, 7], "take": 6, "mathemat": 6, "ident": [6, 7], "cancel": 6, "origin": [6, 7], "lpf12": 6, "200": 6, "reson": 6, "drive": 6, "multi": [6, 7], "base": [6, 7], "moog": 6, "synthes": 6, "ladder": 6, "invent": 6, "dr": 6, "bob": 6, "1968": 6, "below": [6, 7], "side": [6, 7], "peak": 6, "type": [6, 7], "architectur": 6, "db": 6, "bpf12": 6, "lpf24": 6, "24": 6, "hpf24": 6, "bpf24": 6, "simpl": 6, "standard": 6, "featur": 6, "two": 6, "clipper": 6, "707x": 6, "vbr_qualiti": 6, "encod": [6, 7], "current": [6, 7], "vbr": 6, "better": 6, "32khz": 6, "48khz": 6, "unsupport": [6, 7], "except": [6, 7], "thrown": 6, "noiseg": 6, "gate": 6, "attack": 6, "expand": 6, "notch": 6, "centre_frequency_hz": 6, "1300": 6, "stage": 6, "sweep": 6, "magnitud": 6, "affect": 6, "durat": [6, 7], "chri": 6, "cannam": 6, "wonder": 6, "stretch": 6, "intend": 6, "direct": [6, 7], "target_sample_r": [6, 7], "8000": 6, "downsampl": 6, "upsampl": 6, "alias": 6, "indic": [6, 7], "zeroorderhold": 6, "lowest": 6, "fastest": [6, 7], "slightli": 6, "less": 6, "noisi": 6, "simplest": 6, "catmullrom": 6, "moder": 6, "good": 6, "fast": 6, "lagrang": 6, "highest": 6, "slowest": [6, 7], "still": 6, "mere": 6, "damp": 6, "33": 6, "dry_level": 6, "width": 6, "freeze_mod": 6, "stereo": [6, 7], "tune": 6, "freeverb": 6, "http": [1, 3, 6], "ccrma": 6, "stanford": 6, "edu": 6, "jo": 6, "pasp": 6, "html": [1, 3, 6], "_": [1, 3, 6], "differ": [6, 7], "build": 6, "load_preset": 6, "_vst3plugin": 6, "preset_file_path": 6, "preset": 6, "vstpreset": 6, "externalplugin": 6, "dictionari": 6, "initi": 6, "after": 6, "match": [6, 7], "normal": 6, "string": [6, 7], "identifi": 6, "These": 6, "throw": [6, 7], "found": 6, "runtimeerror": [6, 7], "v0": 7, "file_lik": 7, "binaryio": 7, "liter": 7, "16": 7, "readabl": 7, "writeabl": 7, "default": 7, "unlik": 7, "typic": 7, "trail": 7, "b": 7, "redund": 7, "exist": 7, "seekabl": 7, "stringio": 7, "my_fil": 7, "first_ten_second": 7, "ogg_buff": 7, "bytesio": 7, "get_audio_buff": 7, "22_050": 7, "white_nois": 7, "np": 7, "rand": 7, "wav_buff": 7, "getvalu": 7, "someth": 7, "160": 7, "kilobit": 7, "re": 7, "four": 7, "tell": [1, 7], "1024": 7, "readableaudiofil": 7, "cross_platform_formats_onli": [], "wrap": 7, "vorbi": 7, "3g2": 7, "3gp": 7, "adt": 7, "aif": 7, "aifc": 7, "amr": 7, "bwf": 7, "caf": 7, "ec3": 7, "latm": 7, "loa": 7, "m4a": 7, "m4b": 7, "m4r": 7, "mov": 7, "mp1": 7, "mp2": 7, "mp4": 7, "mpa": 7, "mpeg": 7, "qt": 7, "sd2": 7, "snd": 7, "w64": 7, "xhe": 7, "get_supported_read_format": 7, "extens": 7, "pars": [], "consist": [], "constructor": 7, "certain": 7, "probabl": 7, "want": 7, "too": 7, "d": [1, 7], "num_fram": 7, "channel": 7, "posit": 7, "decept": 7, "hour": 7, "long": 7, "hand": 7, "megabyt": 7, "decompress": 7, "nearli": 7, "gigabyt": 7, "rather": [1, 7], "onc": 7, "debug": 7, "problem": 7, "dimension": 7, "length": 7, "alwai": [6, 7], "minimum": 7, "0f": 7, "maximum": 7, "read_raw": 7, "int8": 7, "int16": 7, "int32": 7, "resampledreadableaudiofil": 7, "constant": 7, "seek": 7, "locat": 7, "futur": 7, "pointer": 7, "iff": 7, "longer": 7, "usabl": 7, "otherwis": 7, "divid": 7, "file_dtyp": 7, "regardless": 7, "441": 7, "audio_fil": 7, "resampling_qu": 7, "22050": 7, "fraction": 7, "hood": 7, "streamresampl": 7, "obtain": 7, "entir": [6, 7], "benefit": 7, "target": 7, "As": 7, "version": 7, "respect": 7, "push": 7, "accur": [6, 7], "optim": 7, "22": 7, "050": 7, "source_sample_r": 7, "seri": [6, 7], "flush": 7, "input_lat": 7, "suppli": 7, "writeableaudiofil": 7, "get_supported_write_format": 7, "filename_or_file_lik": 7, "assum": 7, "level": 7, "numer": 7, "128": 7, "256": 7, "advanc": 7, "v2": 7, "best": 7, "happen": 7, "reliabl": 7, "forc": 7, "occur": 7, "typeerror": 7, "far": 7, "increment": 7, "kbp": 7, "v9": 7, "aupreset": [], "preset_st": [], "audiounit": [], "bytestr": [], "watch": 1, "video": 1, "document": [1, 6, 7], "feat": 1, "youtub": 1, "empti": [1, 6], "inform": 1, "refer": 1, "member": [], "peter": 1, "sobot": 1, "europython": 1, "contribut": 3, "audioprocessorparamet": 6, "parameter_nam": 6, "search_step": 6, "1000": 6, "_audioprocessorparamet": [], "address": [], "look": [], "map": [], "enum": [], "attribut": [6, 7], "hint": [], "num_step": [], "allowed_valu": [], "is_discret": [], "properli": [], "assign": [], "label": 6, "alia": 6, "kwd": [], "helper": [], "end": [6, 7], "implicit": 6, "my_plugin": 6, "my": 6, "cool": 6, "delay_time_m": 6, "foobar": 6, "400": 6, "tri": 6, "guess": 6, "valid": 6, "instanti": 6, "had": 6, "raw_valu": 6, "bound": [6, 7], "fail": 6, "en": [], "wikipedia": [], "org": [], "wiki": [], "audio_unit": [], "virtual_studio_technologi": [], "guitar_pedalboard": [], "act": 6, "come": [6, 7], "__call__": 6, "my_pedalboard": 6, "output_audio": 6, "input_audio": 6, "invok": 6, "__enter__": 7, "manag": 7, "exit": 7, "__exit__": 7, "arg1": 7, "arg2": 7, "stop": [1, 7], "py": [], "concept": 6, "musician": 6, "pedal": 6, "togeth": 6, "complet": 6, "main": 6, "treat": 6, "input_audio_sampler": 6, "composit": 6, "decod": 7, "handl": 7, "behind": 7, "scene": 7, "my_filenam": 7, "necessari": 7, "accomplish": 7, "find": 7, "yourself": 7, "cover": 7, "441_000": 7, "On": 1, "audiostream": [1, 3, 7], "manipul": 1, "input_device_nam": [1, 7], "apoge": 1, "jam": 1, "output_device_nam": [1, 7], "macbook": 1, "pro": 1, "now": 1, "press": 1, "enter": [1, 7], "actual": 7, "those": 7, "512": 7, "allow_feedback": 7, "devic": 7, "microphon": 7, "headphon": 7, "delet": 7, "del": 7, "synchron": 7, "ctrl": 7, "concern": 7, "never": 7, "left": 7, "dangl": 7, "background": 7, "nasti": 7, "reachabl": 7, "scope": 7, "continu": 7, "plai": 7, "forev": 7, "won": 7, "easier": 7, "cleanup": 7, "immedi": 7, "send": 7, "power": 3, "ai": 3, "dj": 3}, "objects": {"": [[6, 0, 0, "-", "pedalboard"]], "pedalboard": [[6, 1, 1, "", "AudioProcessorParameter"], [6, 1, 1, "", "AudioUnitPlugin"], [6, 1, 1, "", "Bitcrush"], [6, 1, 1, "", "Chain"], [6, 1, 1, "", "Chorus"], [6, 1, 1, "", "Clipping"], [6, 1, 1, "", "Compressor"], [6, 1, 1, "", "Convolution"], [6, 1, 1, "", "Delay"], [6, 1, 1, "", "Distortion"], [6, 1, 1, "", "ExternalPlugin"], [6, 1, 1, "", "GSMFullRateCompressor"], [6, 1, 1, "", "Gain"], [6, 1, 1, "", "HighShelfFilter"], [6, 1, 1, "", "HighpassFilter"], [6, 1, 1, "", "IIRFilter"], [6, 1, 1, "", "Invert"], [6, 1, 1, "", "LadderFilter"], [6, 1, 1, "", "Limiter"], [6, 1, 1, "", "LowShelfFilter"], [6, 1, 1, "", "LowpassFilter"], [6, 1, 1, "", "MP3Compressor"], [6, 1, 1, "", "Mix"], [6, 1, 1, "", "NoiseGate"], [6, 1, 1, "", "PeakFilter"], [6, 1, 1, "", "Pedalboard"], [6, 1, 1, "", "Phaser"], [6, 1, 1, "", "PitchShift"], [6, 1, 1, "", "Plugin"], [6, 1, 1, "", "PluginContainer"], [6, 1, 1, "", "Resample"], [6, 1, 1, "", "Reverb"], [6, 1, 1, "", "VST3Plugin"], [7, 0, 0, "-", "io"], [6, 5, 1, "", "load_plugin"]], "pedalboard.AudioProcessorParameter": [[6, 2, 1, "", "label"], [6, 2, 1, "", "units"]], "pedalboard.AudioUnitPlugin": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "get_plugin_names_for_file"], [6, 2, 1, "", "name"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"], [6, 3, 1, "", "show_editor"]], "pedalboard.Bitcrush": [[6, 3, 1, "", "__call__"], [6, 2, 1, "", "bit_depth"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Chain": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "append"], [6, 3, 1, "", "insert"], [6, 3, 1, "", "process"], [6, 3, 1, "", "remove"], [6, 3, 1, "", "reset"]], "pedalboard.Chorus": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 2, 1, "", "rate_hz"], [6, 3, 1, "", "reset"]], "pedalboard.Clipping": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Compressor": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Convolution": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Delay": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Distortion": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.ExternalPlugin": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.GSMFullRateCompressor": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Gain": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.HighShelfFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.HighpassFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.IIRFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Invert": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.LadderFilter": [[6, 1, 1, "", "Mode"], [6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.LadderFilter.Mode": [[6, 4, 1, "", "BPF12"], [6, 4, 1, "", "BPF24"], [6, 4, 1, "", "HPF12"], [6, 4, 1, "", "HPF24"], [6, 4, 1, "", "LPF12"], [6, 4, 1, "", "LPF24"]], "pedalboard.Limiter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.LowShelfFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.LowpassFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.MP3Compressor": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Mix": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "append"], [6, 3, 1, "", "insert"], [6, 3, 1, "", "process"], [6, 3, 1, "", "remove"], [6, 3, 1, "", "reset"]], "pedalboard.NoiseGate": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.PeakFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Pedalboard": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "append"], [6, 3, 1, "", "insert"], [6, 3, 1, "", "process"], [6, 3, 1, "", "remove"], [6, 3, 1, "", "reset"]], "pedalboard.Phaser": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.PitchShift": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Plugin": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.PluginContainer": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "append"], [6, 3, 1, "", "insert"], [6, 3, 1, "", "process"], [6, 3, 1, "", "remove"], [6, 3, 1, "", "reset"]], "pedalboard.Resample": [[6, 1, 1, "", "Quality"], [6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 2, 1, "", "quality"], [6, 3, 1, "", "reset"], [6, 2, 1, "", "target_sample_rate"]], "pedalboard.Resample.Quality": [[6, 4, 1, "", "CatmullRom"], [6, 4, 1, "", "Lagrange"], [6, 4, 1, "", "Linear"], [6, 4, 1, "", "WindowedSinc"], [6, 4, 1, "", "ZeroOrderHold"]], "pedalboard.Reverb": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.VST3Plugin": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "get_plugin_names_for_file"], [6, 3, 1, "", "load_preset"], [6, 2, 1, "", "name"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"], [6, 3, 1, "", "show_editor"]], "pedalboard.io": [[7, 1, 1, "", "AudioFile"], [7, 1, 1, "", "AudioStream"], [7, 1, 1, "", "ReadableAudioFile"], [7, 1, 1, "", "ResampledReadableAudioFile"], [7, 1, 1, "", "StreamResampler"], [7, 1, 1, "", "WriteableAudioFile"]], "pedalboard.io.AudioStream": [[7, 3, 1, "", "__enter__"], [7, 3, 1, "", "__exit__"], [7, 2, 1, "", "plugins"], [7, 3, 1, "", "run"], [7, 2, 1, "", "running"]], "pedalboard.io.ReadableAudioFile": [[7, 3, 1, "", "__enter__"], [7, 3, 1, "", "__exit__"], [7, 3, 1, "", "close"], [7, 2, 1, "", "closed"], [7, 2, 1, "", "duration"], [7, 2, 1, "", "file_dtype"], [7, 2, 1, "", "frames"], [7, 2, 1, "", "name"], [7, 2, 1, "", "num_channels"], [7, 3, 1, "", "read"], [7, 3, 1, "", "read_raw"], [7, 3, 1, "", "resampled_to"], [7, 2, 1, "", "samplerate"], [7, 3, 1, "", "seek"], [7, 3, 1, "", "seekable"], [7, 3, 1, "", "tell"]], "pedalboard.io.ResampledReadableAudioFile": [[7, 3, 1, "", "__enter__"], [7, 3, 1, "", "__exit__"], [7, 3, 1, "", "close"], [7, 2, 1, "", "closed"], [7, 2, 1, "", "duration"], [7, 2, 1, "", "file_dtype"], [7, 2, 1, "", "frames"], [7, 2, 1, "", "name"], [7, 2, 1, "", "num_channels"], [7, 3, 1, "", "read"], [7, 2, 1, "", "resampling_quality"], [7, 2, 1, "", "samplerate"], [7, 3, 1, "", "seek"], [7, 3, 1, "", "seekable"], [7, 3, 1, "", "tell"]], "pedalboard.io.StreamResampler": [[7, 2, 1, "", "input_latency"], [7, 2, 1, "", "num_channels"], [7, 3, 1, "", "process"], [7, 2, 1, "", "quality"], [7, 3, 1, "", "reset"], [7, 2, 1, "", "source_sample_rate"], [7, 2, 1, "", "target_sample_rate"]], "pedalboard.io.WriteableAudioFile": [[7, 3, 1, "", "close"], [7, 2, 1, "", "closed"], [7, 2, 1, "", "file_dtype"], [7, 3, 1, "", "flush"], [7, 2, 1, "", "frames"], [7, 2, 1, "", "num_channels"], [7, 2, 1, "", "quality"], [7, 2, 1, "", "samplerate"], [7, 3, 1, "", "write"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:property", "3": "py:method", "4": "py:attribute", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "property", "Python property"], "3": ["py", "method", "Python method"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "function", "Python function"]}, "titleterms": {"plugin": [0, 1, 2, 4], "compat": [0, 3], "exampl": 1, "quick": 1, "start": 1, "make": 1, "guitar": 1, "style": 1, "pedalboard": [1, 2, 4, 6, 7], "us": [1, 2], "vst3": 1, "audio": [1, 2], "unit": 1, "creat": 1, "parallel": 1, "effect": [1, 2], "chain": 1, "frequent": 2, "ask": 2, "question": 2, "can": 2, "live": [1, 2], "real": 2, "time": 2, "doe": 2, "support": 2, "chang": 2, "": 2, "paramet": 2, "over": 2, "vst": 2, "instrument": 2, "instead": 2, "accept": 2, "midi": 2, "featur": 3, "instal": 3, "refer": 3, "document": 3, "intern": 4, "ad": 4, "new": 4, "built": 4, "design": 4, "consider": 4, "licens": 5, "The": [6, 7], "api": [6, 7], "io": 7, "put": [], "compressor": [], "front": [], "run": 1, "all": [], "simultan": [], "mix": [], "contribut": 1}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 57}, "alltitles": {"Plugin Compatibility": [[0, "plugin-compatibility"]], "Examples": [[1, "examples"]], "Quick start": [[1, "quick-start"]], "Making a guitar-style pedalboard": [[1, "making-a-guitar-style-pedalboard"]], "Using VST3\u00ae or Audio Unit plugins": [[1, "using-vst3-or-audio-unit-plugins"]], "Creating parallel effects chains": [[1, "creating-parallel-effects-chains"]], "Running Pedalboard on Live Audio": [[1, "running-pedalboard-on-live-audio"]], "Contributing": [[1, "contributing"]], "Frequently Asked Questions": [[2, "frequently-asked-questions"]], "Can Pedalboard be used with live (real-time) audio?": [[2, "can-pedalboard-be-used-with-live-real-time-audio"]], "Does Pedalboard support changing a plugin\u2019s parameters over time?": [[2, "does-pedalboard-support-changing-a-plugin-s-parameters-over-time"]], "Can Pedalboard be used with VST instruments, instead of effects?": [[2, "can-pedalboard-be-used-with-vst-instruments-instead-of-effects"]], "Can Pedalboard plugins accept MIDI?": [[2, "can-pedalboard-plugins-accept-midi"]], "Features": [[3, "features"]], "Installation": [[3, "installation"]], "Compatibility": [[3, "compatibility"]], "Reference": [[3, "reference"]], "Documentation": [[3, "documentation"]], "Pedalboard Internals": [[4, "pedalboard-internals"]], "Adding new built-in Pedalboard plugins": [[4, "adding-new-built-in-pedalboard-plugins"]], "Design considerations": [[4, "design-considerations"]], "License": [[5, "license"]], "The pedalboard API": [[6, "the-pedalboard-api"]], "The pedalboard.io API": [[7, "the-pedalboard-io-api"]]}, "indexentries": {"audioprocessorparameter (class in pedalboard)": [[6, "pedalboard.AudioProcessorParameter"]], "audiounitplugin (class in pedalboard)": [[6, "pedalboard.AudioUnitPlugin"]], "bpf12 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.BPF12"]], "bpf24 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.BPF24"]], "bitcrush (class in pedalboard)": [[6, "pedalboard.Bitcrush"]], "catmullrom (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.CatmullRom"]], "chain (class in pedalboard)": [[6, "pedalboard.Chain"]], "chorus (class in pedalboard)": [[6, "pedalboard.Chorus"]], "clipping (class in pedalboard)": [[6, "pedalboard.Clipping"]], "compressor (class in pedalboard)": [[6, "pedalboard.Compressor"]], "convolution (class in pedalboard)": [[6, "pedalboard.Convolution"]], "delay (class in pedalboard)": [[6, "pedalboard.Delay"]], "distortion (class in pedalboard)": [[6, "pedalboard.Distortion"]], "externalplugin (class in pedalboard)": [[6, "pedalboard.ExternalPlugin"]], "gsmfullratecompressor (class in pedalboard)": [[6, "pedalboard.GSMFullRateCompressor"]], "gain (class in pedalboard)": [[6, "pedalboard.Gain"]], "hpf12 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.HPF12"]], "hpf24 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.HPF24"]], "highshelffilter (class in pedalboard)": [[6, "pedalboard.HighShelfFilter"]], "highpassfilter (class in pedalboard)": [[6, "pedalboard.HighpassFilter"]], "iirfilter (class in pedalboard)": [[6, "pedalboard.IIRFilter"]], "invert (class in pedalboard)": [[6, "pedalboard.Invert"]], "lpf12 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.LPF12"]], "lpf24 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.LPF24"]], "ladderfilter (class in pedalboard)": [[6, "pedalboard.LadderFilter"]], "ladderfilter.mode (class in pedalboard)": [[6, "pedalboard.LadderFilter.Mode"]], "lagrange (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.Lagrange"]], "limiter (class in pedalboard)": [[6, "pedalboard.Limiter"]], "linear (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.Linear"]], "lowshelffilter (class in pedalboard)": [[6, "pedalboard.LowShelfFilter"]], "lowpassfilter (class in pedalboard)": [[6, "pedalboard.LowpassFilter"]], "mp3compressor (class in pedalboard)": [[6, "pedalboard.MP3Compressor"]], "mix (class in pedalboard)": [[6, "pedalboard.Mix"]], "noisegate (class in pedalboard)": [[6, "pedalboard.NoiseGate"]], "peakfilter (class in pedalboard)": [[6, "pedalboard.PeakFilter"]], "pedalboard (class in pedalboard)": [[6, "pedalboard.Pedalboard"]], "phaser (class in pedalboard)": [[6, "pedalboard.Phaser"]], "pitchshift (class in pedalboard)": [[6, "pedalboard.PitchShift"]], "plugin (class in pedalboard)": [[6, "pedalboard.Plugin"]], "plugincontainer (class in pedalboard)": [[6, "pedalboard.PluginContainer"]], "resample (class in pedalboard)": [[6, "pedalboard.Resample"]], "resample.quality (class in pedalboard)": [[6, "pedalboard.Resample.Quality"]], "reverb (class in pedalboard)": [[6, "pedalboard.Reverb"]], "vst3plugin (class in pedalboard)": [[6, "pedalboard.VST3Plugin"]], "windowedsinc (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.WindowedSinc"]], "zeroorderhold (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.ZeroOrderHold"]], "__call__() (pedalboard.audiounitplugin method)": [[6, "pedalboard.AudioUnitPlugin.__call__"]], "__call__() (pedalboard.bitcrush method)": [[6, "pedalboard.Bitcrush.__call__"]], "__call__() (pedalboard.chain method)": [[6, "pedalboard.Chain.__call__"]], "__call__() (pedalboard.chorus method)": [[6, "pedalboard.Chorus.__call__"]], "__call__() (pedalboard.clipping method)": [[6, "pedalboard.Clipping.__call__"]], "__call__() (pedalboard.compressor method)": [[6, "pedalboard.Compressor.__call__"]], "__call__() (pedalboard.convolution method)": [[6, "pedalboard.Convolution.__call__"]], "__call__() (pedalboard.delay method)": [[6, "pedalboard.Delay.__call__"]], "__call__() (pedalboard.distortion method)": [[6, "pedalboard.Distortion.__call__"]], "__call__() (pedalboard.externalplugin method)": [[6, "pedalboard.ExternalPlugin.__call__"]], "__call__() (pedalboard.gsmfullratecompressor method)": [[6, "pedalboard.GSMFullRateCompressor.__call__"]], "__call__() (pedalboard.gain method)": [[6, "pedalboard.Gain.__call__"]], "__call__() (pedalboard.highshelffilter method)": [[6, "pedalboard.HighShelfFilter.__call__"]], "__call__() (pedalboard.highpassfilter method)": [[6, "pedalboard.HighpassFilter.__call__"]], "__call__() (pedalboard.iirfilter method)": [[6, "pedalboard.IIRFilter.__call__"]], "__call__() (pedalboard.invert method)": [[6, "pedalboard.Invert.__call__"]], "__call__() (pedalboard.ladderfilter method)": [[6, "pedalboard.LadderFilter.__call__"]], "__call__() (pedalboard.limiter method)": [[6, "pedalboard.Limiter.__call__"]], "__call__() (pedalboard.lowshelffilter method)": [[6, "pedalboard.LowShelfFilter.__call__"]], "__call__() (pedalboard.lowpassfilter method)": [[6, "pedalboard.LowpassFilter.__call__"]], "__call__() (pedalboard.mp3compressor method)": [[6, "pedalboard.MP3Compressor.__call__"]], "__call__() (pedalboard.mix method)": [[6, "pedalboard.Mix.__call__"]], "__call__() (pedalboard.noisegate method)": [[6, "pedalboard.NoiseGate.__call__"]], "__call__() (pedalboard.peakfilter method)": [[6, "pedalboard.PeakFilter.__call__"]], "__call__() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.__call__"]], "__call__() (pedalboard.phaser method)": [[6, "pedalboard.Phaser.__call__"]], "__call__() (pedalboard.pitchshift method)": [[6, "pedalboard.PitchShift.__call__"]], "__call__() (pedalboard.plugin method)": [[6, "pedalboard.Plugin.__call__"]], "__call__() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.__call__"]], "__call__() (pedalboard.resample method)": [[6, "pedalboard.Resample.__call__"]], "__call__() (pedalboard.reverb method)": [[6, "pedalboard.Reverb.__call__"]], "__call__() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.__call__"]], "append() (pedalboard.chain method)": [[6, "pedalboard.Chain.append"]], "append() (pedalboard.mix method)": [[6, "pedalboard.Mix.append"]], "append() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.append"]], "append() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.append"]], "bit_depth (pedalboard.bitcrush property)": [[6, "pedalboard.Bitcrush.bit_depth"]], "get_plugin_names_for_file() (pedalboard.audiounitplugin static method)": [[6, "pedalboard.AudioUnitPlugin.get_plugin_names_for_file"]], "get_plugin_names_for_file() (pedalboard.vst3plugin static method)": [[6, "pedalboard.VST3Plugin.get_plugin_names_for_file"]], "insert() (pedalboard.chain method)": [[6, "pedalboard.Chain.insert"]], "insert() (pedalboard.mix method)": [[6, "pedalboard.Mix.insert"]], "insert() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.insert"]], "insert() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.insert"]], "label (pedalboard.audioprocessorparameter property)": [[6, "pedalboard.AudioProcessorParameter.label"]], "load_plugin() (in module pedalboard)": [[6, "pedalboard.load_plugin"]], "load_preset() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.load_preset"]], "module": [[6, "module-pedalboard"], [7, "module-pedalboard.io"]], "name (pedalboard.audiounitplugin property)": [[6, "pedalboard.AudioUnitPlugin.name"]], "name (pedalboard.vst3plugin property)": [[6, "pedalboard.VST3Plugin.name"]], "pedalboard": [[6, "module-pedalboard"]], "process() (pedalboard.audiounitplugin method)": [[6, "pedalboard.AudioUnitPlugin.process"]], "process() (pedalboard.bitcrush method)": [[6, "pedalboard.Bitcrush.process"]], "process() (pedalboard.chain method)": [[6, "pedalboard.Chain.process"]], "process() (pedalboard.chorus method)": [[6, "pedalboard.Chorus.process"]], "process() (pedalboard.clipping method)": [[6, "pedalboard.Clipping.process"]], "process() (pedalboard.compressor method)": [[6, "pedalboard.Compressor.process"]], "process() (pedalboard.convolution method)": [[6, "pedalboard.Convolution.process"]], "process() (pedalboard.delay method)": [[6, "pedalboard.Delay.process"]], "process() (pedalboard.distortion method)": [[6, "pedalboard.Distortion.process"]], "process() (pedalboard.externalplugin method)": [[6, "pedalboard.ExternalPlugin.process"]], "process() (pedalboard.gsmfullratecompressor method)": [[6, "pedalboard.GSMFullRateCompressor.process"]], "process() (pedalboard.gain method)": [[6, "pedalboard.Gain.process"]], "process() (pedalboard.highshelffilter method)": [[6, "pedalboard.HighShelfFilter.process"]], "process() (pedalboard.highpassfilter method)": [[6, "pedalboard.HighpassFilter.process"]], "process() (pedalboard.iirfilter method)": [[6, "pedalboard.IIRFilter.process"]], "process() (pedalboard.invert method)": [[6, "pedalboard.Invert.process"]], "process() (pedalboard.ladderfilter method)": [[6, "pedalboard.LadderFilter.process"]], "process() (pedalboard.limiter method)": [[6, "pedalboard.Limiter.process"]], "process() (pedalboard.lowshelffilter method)": [[6, "pedalboard.LowShelfFilter.process"]], "process() (pedalboard.lowpassfilter method)": [[6, "pedalboard.LowpassFilter.process"]], "process() (pedalboard.mp3compressor method)": [[6, "pedalboard.MP3Compressor.process"]], "process() (pedalboard.mix method)": [[6, "pedalboard.Mix.process"]], "process() (pedalboard.noisegate method)": [[6, "pedalboard.NoiseGate.process"]], "process() (pedalboard.peakfilter method)": [[6, "pedalboard.PeakFilter.process"]], "process() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.process"]], "process() (pedalboard.phaser method)": [[6, "pedalboard.Phaser.process"]], "process() (pedalboard.pitchshift method)": [[6, "pedalboard.PitchShift.process"]], "process() (pedalboard.plugin method)": [[6, "pedalboard.Plugin.process"]], "process() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.process"]], "process() (pedalboard.resample method)": [[6, "pedalboard.Resample.process"]], "process() (pedalboard.reverb method)": [[6, "pedalboard.Reverb.process"]], "process() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.process"]], "quality (pedalboard.resample property)": [[6, "pedalboard.Resample.quality"]], "rate_hz (pedalboard.chorus property)": [[6, "pedalboard.Chorus.rate_hz"]], "remove() (pedalboard.chain method)": [[6, "pedalboard.Chain.remove"]], "remove() (pedalboard.mix method)": [[6, "pedalboard.Mix.remove"]], "remove() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.remove"]], "remove() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.remove"]], "reset() (pedalboard.audiounitplugin method)": [[6, "pedalboard.AudioUnitPlugin.reset"]], "reset() (pedalboard.bitcrush method)": [[6, "pedalboard.Bitcrush.reset"]], "reset() (pedalboard.chain method)": [[6, "pedalboard.Chain.reset"]], "reset() (pedalboard.chorus method)": [[6, "pedalboard.Chorus.reset"]], "reset() (pedalboard.clipping method)": [[6, "pedalboard.Clipping.reset"]], "reset() (pedalboard.compressor method)": [[6, "pedalboard.Compressor.reset"]], "reset() (pedalboard.convolution method)": [[6, "pedalboard.Convolution.reset"]], "reset() (pedalboard.delay method)": [[6, "pedalboard.Delay.reset"]], "reset() (pedalboard.distortion method)": [[6, "pedalboard.Distortion.reset"]], "reset() (pedalboard.externalplugin method)": [[6, "pedalboard.ExternalPlugin.reset"]], "reset() (pedalboard.gsmfullratecompressor method)": [[6, "pedalboard.GSMFullRateCompressor.reset"]], "reset() (pedalboard.gain method)": [[6, "pedalboard.Gain.reset"]], "reset() (pedalboard.highshelffilter method)": [[6, "pedalboard.HighShelfFilter.reset"]], "reset() (pedalboard.highpassfilter method)": [[6, "pedalboard.HighpassFilter.reset"]], "reset() (pedalboard.iirfilter method)": [[6, "pedalboard.IIRFilter.reset"]], "reset() (pedalboard.invert method)": [[6, "pedalboard.Invert.reset"]], "reset() (pedalboard.ladderfilter method)": [[6, "pedalboard.LadderFilter.reset"]], "reset() (pedalboard.limiter method)": [[6, "pedalboard.Limiter.reset"]], "reset() (pedalboard.lowshelffilter method)": [[6, "pedalboard.LowShelfFilter.reset"]], "reset() (pedalboard.lowpassfilter method)": [[6, "pedalboard.LowpassFilter.reset"]], "reset() (pedalboard.mp3compressor method)": [[6, "pedalboard.MP3Compressor.reset"]], "reset() (pedalboard.mix method)": [[6, "pedalboard.Mix.reset"]], "reset() (pedalboard.noisegate method)": [[6, "pedalboard.NoiseGate.reset"]], "reset() (pedalboard.peakfilter method)": [[6, "pedalboard.PeakFilter.reset"]], "reset() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.reset"]], "reset() (pedalboard.phaser method)": [[6, "pedalboard.Phaser.reset"]], "reset() (pedalboard.pitchshift method)": [[6, "pedalboard.PitchShift.reset"]], "reset() (pedalboard.plugin method)": [[6, "pedalboard.Plugin.reset"]], "reset() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.reset"]], "reset() (pedalboard.resample method)": [[6, "pedalboard.Resample.reset"]], "reset() (pedalboard.reverb method)": [[6, "pedalboard.Reverb.reset"]], "reset() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.reset"]], "show_editor() (pedalboard.audiounitplugin method)": [[6, "pedalboard.AudioUnitPlugin.show_editor"]], "show_editor() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.show_editor"]], "target_sample_rate (pedalboard.resample property)": [[6, "pedalboard.Resample.target_sample_rate"]], "units (pedalboard.audioprocessorparameter property)": [[6, "pedalboard.AudioProcessorParameter.units"]], "audiofile (class in pedalboard.io)": [[7, "pedalboard.io.AudioFile"]], "audiostream (class in pedalboard.io)": [[7, "pedalboard.io.AudioStream"]], "readableaudiofile (class in pedalboard.io)": [[7, "pedalboard.io.ReadableAudioFile"]], "resampledreadableaudiofile (class in pedalboard.io)": [[7, "pedalboard.io.ResampledReadableAudioFile"]], "streamresampler (class in pedalboard.io)": [[7, "pedalboard.io.StreamResampler"]], "writeableaudiofile (class in pedalboard.io)": [[7, "pedalboard.io.WriteableAudioFile"]], "__enter__() (pedalboard.io.audiostream method)": [[7, "pedalboard.io.AudioStream.__enter__"]], "__enter__() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.__enter__"]], "__enter__() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.__enter__"]], "__exit__() (pedalboard.io.audiostream method)": [[7, "pedalboard.io.AudioStream.__exit__"]], "__exit__() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.__exit__"]], "__exit__() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.__exit__"]], "close() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.close"]], "close() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.close"]], "close() (pedalboard.io.writeableaudiofile method)": [[7, "pedalboard.io.WriteableAudioFile.close"]], "closed (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.closed"]], "closed (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.closed"]], "closed (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.closed"]], "duration (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.duration"]], "duration (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.duration"]], "file_dtype (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.file_dtype"]], "file_dtype (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.file_dtype"]], "file_dtype (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.file_dtype"]], "flush() (pedalboard.io.writeableaudiofile method)": [[7, "pedalboard.io.WriteableAudioFile.flush"]], "frames (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.frames"]], "frames (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.frames"]], "frames (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.frames"]], "input_latency (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.input_latency"]], "name (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.name"]], "name (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.name"]], "num_channels (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.num_channels"]], "num_channels (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.num_channels"]], "num_channels (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.num_channels"]], "num_channels (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.num_channels"]], "pedalboard.io": [[7, "module-pedalboard.io"]], "plugins (pedalboard.io.audiostream property)": [[7, "pedalboard.io.AudioStream.plugins"]], "process() (pedalboard.io.streamresampler method)": [[7, "pedalboard.io.StreamResampler.process"]], "quality (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.quality"]], "quality (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.quality"]], "read() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.read"]], "read() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.read"]], "read_raw() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.read_raw"]], "resampled_to() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.resampled_to"]], "resampling_quality (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.resampling_quality"]], "reset() (pedalboard.io.streamresampler method)": [[7, "pedalboard.io.StreamResampler.reset"]], "run() (pedalboard.io.audiostream method)": [[7, "pedalboard.io.AudioStream.run"]], "running (pedalboard.io.audiostream property)": [[7, "pedalboard.io.AudioStream.running"]], "samplerate (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.samplerate"]], "samplerate (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.samplerate"]], "samplerate (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.samplerate"]], "seek() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.seek"]], "seek() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.seek"]], "seekable() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.seekable"]], "seekable() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.seekable"]], "source_sample_rate (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.source_sample_rate"]], "target_sample_rate (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.target_sample_rate"]], "tell() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.tell"]], "tell() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.tell"]], "write() (pedalboard.io.writeableaudiofile method)": [[7, "pedalboard.io.WriteableAudioFile.write"]]}})\ No newline at end of file+Search.setIndex({"docnames": ["compatibility", "examples", "faq", "index", "internals", "license", "reference/pedalboard", "reference/pedalboard.io"], "filenames": ["compatibility.rst", "examples.rst", "faq.rst", "index.rst", "internals.rst", "license.rst", "reference/pedalboard.rst", "reference/pedalboard.io.rst"], "titles": ["Plugin Compatibility", "Examples", "Frequently Asked Questions", "Features", "Pedalboard Internals", "License", "The <code class=\"docutils literal notranslate\"><span class=\"pre\">pedalboard</span></code> API", "The <code class=\"docutils literal notranslate\"><span class=\"pre\">pedalboard.io</span></code> API"], "terms": {"pedalboard": [0, 3, 5], "allow": [0, 1, 2, 3, 6, 7], "load": [0, 1, 3, 4, 6], "vst3": [0, 3, 4, 5, 6], "audio": [0, 3, 4, 5, 6, 7], "unit": [0, 2, 3, 4, 6], "which": [0, 2, 5, 6, 7], "could": [0, 2, 6, 7], "contain": [0, 1, 2, 6, 7], "ani": [0, 2, 4, 6, 7], "code": [0, 2, 4, 5, 7], "most": [0, 2, 3, 4, 6, 7], "have": [0, 2, 4, 6, 7], "been": [0, 7], "test": [0, 3, 4], "work": [0, 1, 3, 6, 7], "just": [0, 1, 2, 4, 6, 7], "fine": [0, 2], "some": [0, 1, 4, 7], "mai": [0, 4, 6, 7], "worst": [0, 7], "even": [0, 3, 7], "crash": [0, 7], "python": [0, 1, 2, 3, 4, 6, 7], "interpret": [0, 2, 3, 7], "without": [0, 2, 3, 6, 7], "warn": 0, "abil": 0, "catch": 0, "error": 0, "ar": [0, 1, 2, 3, 4, 5, 6, 7], "well": [0, 3, 4, 6, 7], "behav": [0, 1], "conform": 0, "set": [0, 1, 2, 6, 7], "convent": 0, "how": [0, 1, 6], "suppos": 0, "mani": [0, 3, 6, 7], "do": [0, 1, 7], "specif": [0, 6], "attempt": [0, 7], "detect": [0, 6], "common": [0, 3], "program": [0, 1, 2], "can": [0, 1, 3, 4, 6, 7], "around": [0, 4, 6], "issu": [0, 2, 4], "includ": [0, 1, 2, 3, 4, 5], "automat": [0, 3, 6, 7], "don": [0, 1, 7], "t": [0, 1, 2, 7], "clear": [0, 6], "intern": [0, 3, 6, 7], "state": [0, 6, 7], "when": [0, 2, 3, 4, 6, 7], "ask": [0, 3], "so": [0, 1, 2, 6, 7], "misbehav": 0, "notic": 0, "If": [0, 1, 3, 6, 7], "i": [0, 1, 2, 3, 4, 5, 6, 7], "being": [0, 7], "render": [0, 7], "incorrectli": 0, "leak": [0, 7], "from": [0, 1, 2, 3, 5, 6, 7], "one": [0, 1, 3, 6, 7], "process": [0, 1, 2, 3, 4, 5, 6, 7], "call": [0, 6, 7], "next": 0, "an": [0, 1, 2, 4, 6, 7], "undesir": 0, "fashion": [0, 2], "try": [0, 6, 7], "pass": [0, 2, 6, 7], "silenc": 0, "between": [0, 2, 6, 7], "ensur": [0, 2, 4, 7], "reverb": [0, 1, 2, 3, 6, 7], "tail": [0, 2, 6], "other": [0, 1, 3, 6, 7], "ha": [0, 1, 6, 7], "time": [0, 1, 3, 6, 7], "fade": 0, "reload": 0, "everi": [0, 4, 7], "load_plugin": [0, 1, 3, 4, 6], "import": [1, 2, 4, 6, 7], "choru": [1, 3, 6], "io": [1, 2, 3, 6], "audiofil": [1, 2, 7], "read": [1, 2, 3, 6, 7], "whole": 1, "file": [1, 2, 3, 4, 6, 7], "wav": [1, 2, 3, 7], "f": [1, 7], "frame": [1, 2, 7], "sampler": [1, 2, 7], "object": [1, 2, 6, 7], "multipl": [1, 2, 3, 6, 7], "board": [1, 2], "room_siz": [1, 6], "0": [1, 2, 6, 7], "25": [1, 6], "run": [3, 6, 7], "through": [1, 2, 6, 7], "thi": [1, 2, 5, 6, 7], "write": [1, 2, 3, 6, 7], "back": [1, 6, 7], "output": [1, 2, 6, 7], "w": [1, 2, 7], "shape": [1, 2, 7], "It": [1, 3], "smaller": [1, 2, 7], "resampl": [1, 3, 6, 7], "our": [1, 2], "desir": 1, "sampl": [1, 2, 6, 7], "rate": [1, 2, 6, 7], "44100": [1, 7], "input": [1, 2, 6, 7], "resampled_to": [1, 7], "pretti": 1, "interest": 1, "sound": [1, 6], "compressor": [1, 2, 3, 6], "threshold_db": [1, 6], "50": [1, 6], "ratio": [1, 6], "gain": [1, 3, 6], "gain_db": [1, 6], "30": [1, 7], "ladderfilt": [1, 3, 6], "mode": [1, 6, 7], "hpf12": [1, 6], "cutoff_hz": [1, 6], "900": 1, "phaser": [1, 3, 6], "convolut": [1, 3, 6], "guitar_amp": 1, "1": [1, 2, 3, 6, 7], "like": [1, 3, 6, 7], "list": [1, 6, 7], "you": [1, 3, 7], "add": [1, 2, 3, 4, 6, 7], "append": [1, 6, 7], "10": [1, 3, 6, 7], "limit": [1, 3, 6], "chang": [1, 3, 6, 7], "paramet": [1, 3, 6, 7], "easili": 1, "40": 1, "known": 1, "path": [1, 6, 7], "disk": [1, 7], "vst": [1, 3, 5], "roughrider3": 1, "print": [1, 6, 7], "kei": [1, 6], "dict_kei": 1, "sc_hpf_hz": 1, "input_lvl_db": 1, "sensitivity_db": 1, "attack_m": [1, 6], "release_m": [1, 6], "makeup_db": 1, "mix": [1, 6], "output_lvl_db": 1, "sc_activ": 1, "full_bandwidth": 1, "bypass": 1, "15": 1, "r": [1, 7], "put": 1, "same": [1, 4, 6, 7], "instanc": [1, 4, 6, 7], "delai": [1, 2, 3, 6], "pitch": [1, 3, 6], "shift": [1, 6], "themselv": [1, 6], "nest": [1, 6], "them": [1, 6], "much": [1, 6], "distort": [1, 3, 6], "pitchshift": [1, 3, 5, 6], "passthrough": 1, "delay_and_pitch_shift": 1, "delay_second": [1, 6], "semiton": [1, 6], "7": [1, 3, 6, 7], "3": [1, 3, 6], "delay_longer_and_more_pitch_shift": 1, "5": [1, 6], "12": [1, 6], "6": [1, 3, 5, 6, 7], "front": 1, "all": [1, 2, 3, 4, 6, 7], "simultan": 1, "final": 1, "For": [1, 6, 7], "more": [1, 3, 4, 6, 7], "see": [1, 2, 6, 7], "folder": 1, "repositori": [1, 4], "demo": 1, "colab": 1, "notebook": 1, "interact": [1, 7], "web": 1, "hug": 1, "face": 1, "space": 1, "gradio": 1, "via": [1, 3, 6, 7], "ak391": 1, "technic": 2, "ye": 2, "pull": [2, 5], "request": 2, "98": 2, "experiment": [2, 3], "interfac": [1, 2, 4, 6, 7], "written": [2, 4, 7], "c": [2, 4, 7], "stefanobazzi": 2, "guitarboard": 2, "project": [2, 5], "exampl": [2, 3, 4, 6, 7], "sounddevic": 2, "librari": [2, 3, 4, 5, 6, 7], "howev": [2, 6], "coupl": 2, "big": 2, "caveat": 2, "talk": 2, "about": [1, 2, 7], "context": [2, 7], "languag": 2, "garbag": 2, "collect": 2, "mean": 2, "your": [1, 2, 7], "randomli": 2, "paus": 2, "regular": [1, 2, 6, 7], "interv": 2, "clean": 2, "up": [1, 2, 3, 6], "unus": [2, 7], "In": [2, 7], "result": [2, 7], "random": [2, 7], "pop": 2, "click": 2, "drop": 2, "out": [1, 2, 3, 6, 7], "veri": 2, "difficult": 2, "prevent": [2, 7], "global": [2, 3, 7], "lock": [2, 3, 7], "also": [2, 3, 4, 6, 7], "potenti": [2, 7], "unbound": [2, 7], "switch": 2, "thread": [2, 3, 4, 7], "oper": [2, 6, 7], "system": [2, 6, 7], "separ": 2, "high": [2, 6, 7], "prioriti": 2, "block": [2, 6, 7], "caus": [2, 6, 7], "stutter": 2, "access": [2, 6, 7], "mutat": 2, "note": [1, 2, 6, 7], "applic": [2, 4], "stream": [1, 2, 3, 6, 7], "larg": [2, 7], "buffer": [2, 6, 7], "size": [2, 4, 6, 7], "second": [1, 2, 6, 7], "soft": 2, "requir": [2, 3, 4, 6, 7], "case": [2, 3, 4, 6, 7], "network": 2, "data": [2, 3, 7], "offlin": 2, "chunk": [1, 2, 6, 7], "while": [1, 2, 6, 7], "built": [2, 3], "function": [2, 4, 6, 7], "possibl": [2, 3, 7], "vari": 2, "manual": [2, 3], "tqdm": 2, "step": 2, "would": [2, 4, 6, 7], "give": [2, 6], "smoother": 2, "transit": 2, "expens": [2, 6, 7], "speed": [2, 3, 4, 6, 7], "step_size_in_sampl": 2, "100": [2, 6, 7], "_n_": 2, "af": 2, "open": [1, 2, 4, 7], "we": 2, "directli": [2, 6, 7], "save": 2, "memori": [2, 3, 6, 7], "num_channel": [1, 2, 7], "o": [1, 2, 3, 6, 7], "creat": [2, 3, 6, 7], "progress": 2, "bar": 2, "show": [2, 4, 6], "total": [2, 7], "pbar": 2, "rang": [2, 3, 6], "wet": [2, 6], "equal": [2, 3, 6, 7], "percentag": [2, 6], "track": 2, "e": [2, 6, 7], "make": [2, 3], "ramp": 2, "percentage_through_track": 2, "wet_level": [2, 6, 7], "updat": 2, "number": [2, 3, 5, 6, 7], "receiv": [2, 6, 7], "reset": [1, 2, 6, 7], "fals": [1, 2, 6, 7], "aren": 2, "cut": [2, 6], "off": [2, 6], "With": 2, "techniqu": [2, 6], "autom": 2, "usual": [2, 6, 7], "somewher": 2, "000": [2, 7], "2m": 2, "22m": 2, "44": [2, 6, 7], "1khz": [2, 6], "small": 2, "enough": [2, 7], "avoid": [2, 7], "hear": 2, "artifact": [2, 6], "slow": [2, 6], "down": 2, "dramat": 2, "Not": [2, 4, 6, 7], "yet": 2, "The": [1, 2, 4, 5], "underli": [2, 6, 7], "framework": 2, "juce": [2, 4, 5], "au": [2, 7], "itself": [2, 4, 6], "modifi": 2, "either": [2, 7], "although": [2, 6, 7], "ad": [1, 3, 6, 7], "effect": [3, 4, 6, 7], "support": [1, 3, 4, 6, 7], "popular": 3, "format": [3, 6, 7], "box": 3, "us": [3, 4, 5, 6, 7], "third": [3, 6], "parti": [3, 6], "plugin": [3, 5, 6, 7], "wa": [3, 6, 7], "spotifi": [1, 3, 5], "": [3, 4, 6, 7], "intellig": 3, "lab": 3, "enabl": 3, "studio": 3, "qualiti": [3, 6, 7], "within": [3, 4, 6], "tensorflow": 3, "augment": 3, "improv": 3, "machin": [3, 4], "learn": [3, 4], "model": [3, 6], "help": 3, "content": [3, 7], "creation": 3, "digit": [3, 4, 6], "workstat": 3, "util": [3, 6], "aiff": [3, 7], "flac": [3, 7], "mp3": [3, 6, 7], "ogg": [3, 7], "platform": [3, 4, 6, 7], "depend": [3, 4, 6, 7], "addit": [3, 4, 6, 7], "aac": [3, 7], "ac3": [3, 7], "wma": [3, 7], "fly": [3, 7], "usag": [3, 6], "basic": [3, 6, 7], "transform": 3, "guitar": [3, 6], "style": 3, "clip": [3, 6], "loud": [3, 6], "dynam": [3, 6], "filter": [3, 6], "highpassfilt": [3, 6], "lowpassfilt": [3, 6], "spatial": 3, "lossi": [3, 6], "compress": [3, 6, 7], "gsmfullratecompressor": [3, 5, 6], "mp3compressor": [3, 5, 6], "reduct": [3, 6], "bitcrush": [3, 6], "maco": [1, 3, 4, 6, 7], "window": [1, 3, 4, 6, 7], "linux": [3, 4, 6, 7], "strong": 3, "safeti": [3, 7], "guarante": [3, 7], "releas": [3, 6, 7], "gil": 3, "cpu": 3, "core": [3, 5], "No": [3, 6], "need": [3, 4, 7], "multiprocess": 3, "onli": [3, 6, 7], "300x": 3, "faster": 3, "than": [3, 4, 6, 7], "pysox": 3, "singl": [3, 6], "2": [3, 6, 7], "5x": 3, "soxbind": 3, "icorv": 3, "4x": 3, "librosa": 3, "tf": 3, "pipelin": 3, "avail": [3, 4, 6, 7], "pypi": 3, "wheel": [3, 4], "pip": 3, "That": 3, "new": [3, 7], "follow": [3, 4, 5, 6, 7], "md": 3, "robust": 3, "guid": 3, "thoroughli": 3, "8": [3, 6], "9": 3, "11": 3, "heavili": 3, "product": 3, "github": [1, 3], "manylinux": 3, "x86_64": 3, "intel": 3, "amd": 3, "aarch64": 3, "arm": 3, "appl": [3, 6], "silicon": 3, "rel": 3, "modern": 3, "glibc": 3, "27": 3, "both": [3, 6], "wide": [3, 6], "amd64": 3, "x86": 3, "64": [3, 6], "api": [3, 4], "quick": 3, "start": [3, 7], "parallel": [3, 6], "chain": [3, 6, 7], "frequent": 3, "question": 3, "live": [3, 7], "real": [1, 3, 6, 7], "doe": [3, 4, 6, 7], "over": [3, 6], "instrument": 3, "instead": [1, 3, 6, 7], "accept": [3, 6, 7], "midi": 3, "design": [3, 6], "consider": 3, "licens": [3, 4], "repo": 3, "wrapper": [4, 6], "sourc": [4, 7], "cross": [4, 6], "develop": 4, "pybind11": 4, "bind": 4, "goal": [4, 7], "expos": [4, 6], "signal": [4, 6], "idiomat": 4, "wai": [4, 7], "provid": [4, 6, 7], "raw": [4, 6, 7], "perform": [4, 7], "dsp": 4, "hide": 4, "complex": 4, "programm": 4, "intuit": 4, "varieti": 4, "reason": 4, "wider": 4, "compat": [4, 5, 6], "notabl": 4, "rare": [4, 6], "fewer": [4, 6], "simpler": 4, "remov": [4, 6], "copi": 4, "associ": 4, "resourc": [4, 7], "option": [4, 6, 7], "might": 4, "meant": 4, "music": 4, "appropri": [4, 6], "vice": 4, "versa": 4, "stabil": 4, "environ": 4, "where": 4, "implement": [4, 6, 7], "logic": 4, "portabl": 4, "safe": [4, 7], "constraint": 4, "should": [4, 6, 7], "consid": [4, 6, 7], "gplv3": [4, 5], "static": [4, 5, 6], "link": 4, "vendor": 4, "git": 4, "submodul": 4, "binari": [4, 7], "distribut": 4, "Will": [4, 7], "increas": [4, 6, 7], "amount": [4, 6, 7], "compil": [4, 5], "runtim": 4, "cannot": [4, 6], "user": 4, "instal": [4, 6, 7], "softwar": 4, "complic": 4, "simplic": 4, "packag": [4, 6, 7], "copyright": 5, "2021": 5, "2022": [1, 5], "ab": 5, "under": [5, 7], "gnu": 5, "gener": [5, 6], "public": 5, "v3": 5, "carri": 5, "dual": 5, "commerci": 5, "sdk": 5, "bundl": [5, 6], "own": [5, 6], "steinberg": [5, 6], "media": 5, "technologi": 5, "gmbh": [5, 6], "rubber": [5, 6], "band": [5, 6], "gplv2": 5, "newer": 5, "libmp3lam": 5, "lame": [5, 6, 7], "lgplv2": 5, "upgrad": 5, "inclus": 5, "permit": 5, "libgsm": 5, "isc": 5, "regist": 5, "trademark": 5, "modul": [6, 7], "class": [6, 7], "subclass": 6, "each": [6, 7], "appli": 6, "audiounitplugin": 6, "path_to_plugin_fil": 6, "str": [6, 7], "parameter_valu": 6, "dict": 6, "union": [6, 7], "int": [1, 6, 7], "float": [6, 7], "bool": [6, 7], "plugin_nam": 6, "none": [6, 7], "A": [6, 7], "non": [6, 7], "unavail": 6, "must": [6, 7], "loadabl": 6, "plug": [6, 7], "Ins": 6, "compon": 6, "vst3plugin": 6, "get_plugin_names_for_fil": 6, "filenam": [6, 7], "return": [6, 7], "name": [6, 7], "given": [6, 7], "scan": [6, 7], "importerror": 6, "rais": [6, 7], "insid": 6, "method": [6, 7], "determin": [6, 7], "present": [6, 7], "what": 6, "properti": [6, 7], "report": 6, "self": 6, "pedalboard_n": 6, "input_arrai": 6, "numpi": [6, 7], "ndarrai": [6, 7], "sample_r": [6, 7], "buffer_s": [6, 7], "8192": 6, "true": [6, 7], "float32": [6, 7], "32": [6, 7], "bit": [6, 7], "point": [6, 7], "arrai": [6, 7], "were": 6, "expect": [6, 7], "To": [6, 7], "remain": [6, 7], "anoth": 6, "datatyp": [6, 7], "convert": [6, 7], "argument": [6, 7], "control": 6, "higher": 6, "flag": 6, "befor": [6, 7], "begin": [6, 7], "previou": 6, "store": [6, 7], "g": 6, "line": [6, 7], "lfo": 6, "etc": [6, 7], "valu": [6, 7], "unchang": 6, "show_editor": 6, "_audiounitplugin": 6, "ui": 6, "nativ": [6, 7], "until": [1, 6, 7], "close": [1, 6, 7], "keyboardinterrupt": [6, 7], "bit_depth": [6, 7], "reduc": 6, "depth": [6, 7], "lo": 6, "fi": 6, "vertic": 6, "resolut": 6, "uniqu": 6, "repres": 6, "horizont": 6, "per": [6, 7], "quantiz": 6, "integ": [6, 7], "decim": 6, "onto": 6, "dtype": [6, 7], "zero": 6, "plugincontain": 6, "arg0": [6, 7], "insert": 6, "index": 6, "arg": [], "kwarg": [], "overload": [], "float64": 7, "rate_hz": 6, "centre_delay_m": 6, "feedback": 6, "frequenc": 6, "respons": 6, "centr": 6, "get": 6, "classic": 6, "m": 6, "low": 6, "feeback": 6, "volum": 6, "flanger": 6, "lower": 6, "lot": 6, "vibrato": 6, "oscil": 6, "hertz": 6, "hz": [6, 7], "hard": [6, 7], "threshold": 6, "decibel": 6, "algorithm": [6, 7], "introduc": [6, 7], "nois": 6, "gsmcompressor": 6, "impulse_response_filenam": 6, "suitabl": 6, "thing": 6, "speaker": [1, 6, 7], "simul": 6, "dry": 6, "drive_db": 6, "linear": [6, 7], "tanh": 6, "hyperbol": 6, "tangent": 6, "waveshap": 6, "harmon": 6, "pleas": 6, "produc": 6, "roughli": 6, "equival": 6, "def": 6, "x": 6, "db_to_gain": 6, "windowedsinc": [6, 7], "4": 6, "degrad": 6, "gsm": 6, "full": 6, "emul": 6, "2g": 6, "cellular": 6, "phone": 6, "connect": 6, "fix": 6, "8khz": 6, "codec": [6, 7], "specifi": [6, 7], "decreas": [6, 7], "amplifi": 6, "attenu": 6, "think": 6, "highshelffilt": 6, "cutoff_frequency_hz": 6, "440": 6, "q": 6, "7071067690849304": 6, "shelf": 6, "variabl": [6, 7], "abov": 6, "cutoff": 6, "boost": 6, "first": [6, 7], "order": 6, "roll": 6, "6db": 6, "octav": 6, "3db": 6, "frac": 6, "sqrt": 6, "express": 6, "factor": 6, "further": [6, 7], "iirfilt": 6, "abstract": 6, "variou": 6, "kind": 6, "infinit": 6, "impuls": 6, "iir": 6, "lowshelffilt": 6, "peakfilt": 6, "invert": 6, "flip": 6, "polar": 6, "audibl": 6, "its": [6, 7], "take": 6, "mathemat": 6, "ident": [6, 7], "cancel": 6, "origin": [6, 7], "lpf12": 6, "200": 6, "reson": 6, "drive": 6, "multi": [6, 7], "base": [6, 7], "moog": 6, "synthes": 6, "ladder": 6, "invent": 6, "dr": 6, "bob": 6, "1968": 6, "below": [6, 7], "side": [6, 7], "peak": 6, "type": [6, 7], "architectur": 6, "db": 6, "bpf12": 6, "lpf24": 6, "24": 6, "hpf24": 6, "bpf24": 6, "simpl": 6, "standard": 6, "featur": 6, "two": 6, "clipper": 6, "707x": 6, "vbr_qualiti": 6, "encod": [6, 7], "current": [6, 7], "vbr": 6, "better": 6, "32khz": 6, "48khz": 6, "unsupport": [6, 7], "except": [6, 7], "thrown": 6, "noiseg": 6, "gate": 6, "attack": 6, "expand": 6, "notch": 6, "centre_frequency_hz": 6, "1300": 6, "stage": 6, "sweep": 6, "magnitud": [6, 7], "affect": 6, "durat": [6, 7], "chri": 6, "cannam": 6, "wonder": 6, "stretch": 6, "intend": 6, "direct": [6, 7], "target_sample_r": [6, 7], "8000": 6, "downsampl": 6, "upsampl": 6, "alias": 6, "indic": [6, 7], "zeroorderhold": 6, "lowest": 6, "fastest": [6, 7], "slightli": 6, "less": 6, "noisi": 6, "simplest": 6, "catmullrom": 6, "moder": 6, "good": 6, "fast": 6, "lagrang": 6, "highest": 6, "slowest": [6, 7], "still": 6, "mere": 6, "damp": 6, "33": 6, "dry_level": 6, "width": 6, "freeze_mod": 6, "stereo": [6, 7], "tune": 6, "freeverb": 6, "http": [1, 3, 6], "ccrma": 6, "stanford": 6, "edu": 6, "jo": 6, "pasp": 6, "html": [1, 3, 6], "_": [1, 3, 6], "differ": [6, 7], "build": 6, "load_preset": 6, "_vst3plugin": 6, "preset_file_path": 6, "preset": 6, "vstpreset": 6, "externalplugin": 6, "dictionari": 6, "initi": [6, 7], "after": [6, 7], "match": [6, 7], "normal": 6, "string": [6, 7], "identifi": 6, "These": 6, "throw": [6, 7], "found": [6, 7], "runtimeerror": [6, 7], "v0": 7, "file_lik": 7, "binaryio": 7, "liter": 7, "16": 7, "readabl": 7, "writeabl": 7, "default": 7, "unlik": 7, "typic": 7, "trail": 7, "b": 7, "redund": 7, "exist": 7, "seekabl": 7, "stringio": 7, "my_fil": 7, "first_ten_second": 7, "ogg_buff": 7, "bytesio": 7, "get_audio_buff": 7, "22_050": 7, "white_nois": 7, "np": 7, "rand": 7, "wav_buff": 7, "getvalu": 7, "someth": 7, "160": 7, "kilobit": 7, "re": 7, "four": 7, "tell": [1, 7], "1024": 7, "readableaudiofil": 7, "cross_platform_formats_onli": [], "wrap": 7, "vorbi": 7, "3g2": 7, "3gp": 7, "adt": 7, "aif": 7, "aifc": 7, "amr": 7, "bwf": 7, "caf": 7, "ec3": 7, "latm": 7, "loa": 7, "m4a": 7, "m4b": 7, "m4r": 7, "mov": 7, "mp1": 7, "mp2": 7, "mp4": 7, "mpa": 7, "mpeg": 7, "qt": 7, "sd2": 7, "snd": 7, "w64": 7, "xhe": 7, "get_supported_read_format": 7, "extens": 7, "pars": 7, "consist": [], "constructor": 7, "certain": 7, "probabl": 7, "want": 7, "too": 7, "d": [1, 7], "num_fram": 7, "channel": 7, "posit": 7, "decept": 7, "hour": 7, "long": 7, "hand": 7, "megabyt": 7, "decompress": 7, "nearli": 7, "gigabyt": 7, "rather": [1, 7], "onc": 7, "debug": 7, "problem": 7, "dimension": 7, "length": 7, "alwai": [6, 7], "minimum": 7, "0f": 7, "maximum": 7, "read_raw": 7, "int8": 7, "int16": 7, "int32": 7, "resampledreadableaudiofil": 7, "constant": 7, "seek": 7, "locat": 7, "futur": 7, "pointer": 7, "iff": 7, "longer": 7, "usabl": 7, "otherwis": 7, "divid": 7, "file_dtyp": 7, "regardless": 7, "441": 7, "audio_fil": 7, "resampling_qu": 7, "22050": 7, "fraction": 7, "hood": 7, "streamresampl": 7, "obtain": 7, "entir": [6, 7], "benefit": 7, "target": 7, "As": 7, "version": 7, "respect": 7, "push": 7, "accur": [6, 7], "optim": 7, "22": 7, "050": 7, "source_sample_r": 7, "seri": [6, 7], "flush": 7, "input_lat": 7, "suppli": 7, "writeableaudiofil": 7, "get_supported_write_format": 7, "filename_or_file_lik": 7, "assum": 7, "level": 7, "numer": 7, "128": 7, "256": 7, "advanc": 7, "v2": 7, "best": 7, "happen": 7, "reliabl": 7, "forc": 7, "occur": 7, "typeerror": 7, "far": 7, "increment": 7, "kbp": 7, "v9": 7, "aupreset": [], "preset_st": [], "audiounit": [], "bytestr": [], "watch": 1, "video": 1, "document": [1, 6, 7], "feat": 1, "youtub": 1, "empti": [1, 6], "inform": [1, 7], "refer": 1, "member": [], "peter": 1, "sobot": 1, "europython": 1, "contribut": 3, "audioprocessorparamet": 6, "parameter_nam": 6, "search_step": 6, "1000": 6, "_audioprocessorparamet": [], "address": [], "look": [], "map": [], "enum": [], "attribut": [6, 7], "hint": [], "num_step": [], "allowed_valu": [], "is_discret": [], "properli": [], "assign": [], "label": 6, "alia": 6, "kwd": [], "helper": [], "end": [6, 7], "implicit": 6, "my_plugin": 6, "my": 6, "cool": 6, "delay_time_m": 6, "foobar": 6, "400": 6, "tri": 6, "guess": 6, "valid": 6, "instanti": 6, "had": 6, "raw_valu": 6, "bound": [6, 7], "fail": 6, "en": [], "wikipedia": [], "org": [], "wiki": [], "audio_unit": [], "virtual_studio_technologi": [], "guitar_pedalboard": [], "act": 6, "come": [6, 7], "__call__": 6, "my_pedalboard": 6, "output_audio": 6, "input_audio": 6, "invok": 6, "__enter__": 7, "manag": 7, "exit": 7, "__exit__": 7, "arg1": 7, "arg2": 7, "stop": [1, 7], "py": [], "concept": 6, "musician": 6, "pedal": 6, "togeth": 6, "complet": [6, 7], "main": 6, "treat": 6, "input_audio_sampler": 6, "composit": 6, "decod": 7, "handl": 7, "behind": 7, "scene": 7, "my_filenam": 7, "necessari": 7, "accomplish": 7, "find": 7, "yourself": 7, "cover": 7, "441_000": 7, "On": 1, "audiostream": [1, 3, 7], "manipul": 1, "input_device_nam": [1, 7], "apoge": 1, "jam": 1, "output_device_nam": [1, 7], "macbook": 1, "pro": 1, "now": [1, 7], "press": 1, "enter": [1, 7], "actual": 7, "those": 7, "512": 7, "allow_feedback": 7, "devic": 7, "microphon": 7, "headphon": 7, "delet": 7, "del": 7, "synchron": 7, "ctrl": 7, "concern": 7, "never": 7, "left": 7, "dangl": 7, "background": 7, "nasti": 7, "reachabl": 7, "scope": 7, "continu": 7, "plai": 7, "forev": 7, "won": 7, "easier": 7, "cleanup": 7, "immedi": 7, "send": 7, "power": 3, "ai": 3, "dj": 3, "overestim": 7, "duration_is_accur": 7, "behaviour": 7, "later": 7, "prior": 7, "silent": [], "bitrat": 7, "estim": 7, "exact": 7, "due": 7, "fact": 7, "header": 7, "finish": 7, "correct": 7, "assert": 7, "60": 7, "num_sampl": 7, "fill": 7, "situat": 7, "detail": 7, "discrep": 7, "xing": 7, "info": 7, "_over_estim": [], "lack": 7, "ever": 7}, "objects": {"": [[6, 0, 0, "-", "pedalboard"]], "pedalboard": [[6, 1, 1, "", "AudioProcessorParameter"], [6, 1, 1, "", "AudioUnitPlugin"], [6, 1, 1, "", "Bitcrush"], [6, 1, 1, "", "Chain"], [6, 1, 1, "", "Chorus"], [6, 1, 1, "", "Clipping"], [6, 1, 1, "", "Compressor"], [6, 1, 1, "", "Convolution"], [6, 1, 1, "", "Delay"], [6, 1, 1, "", "Distortion"], [6, 1, 1, "", "ExternalPlugin"], [6, 1, 1, "", "GSMFullRateCompressor"], [6, 1, 1, "", "Gain"], [6, 1, 1, "", "HighShelfFilter"], [6, 1, 1, "", "HighpassFilter"], [6, 1, 1, "", "IIRFilter"], [6, 1, 1, "", "Invert"], [6, 1, 1, "", "LadderFilter"], [6, 1, 1, "", "Limiter"], [6, 1, 1, "", "LowShelfFilter"], [6, 1, 1, "", "LowpassFilter"], [6, 1, 1, "", "MP3Compressor"], [6, 1, 1, "", "Mix"], [6, 1, 1, "", "NoiseGate"], [6, 1, 1, "", "PeakFilter"], [6, 1, 1, "", "Pedalboard"], [6, 1, 1, "", "Phaser"], [6, 1, 1, "", "PitchShift"], [6, 1, 1, "", "Plugin"], [6, 1, 1, "", "PluginContainer"], [6, 1, 1, "", "Resample"], [6, 1, 1, "", "Reverb"], [6, 1, 1, "", "VST3Plugin"], [7, 0, 0, "-", "io"], [6, 5, 1, "", "load_plugin"]], "pedalboard.AudioProcessorParameter": [[6, 2, 1, "", "label"], [6, 2, 1, "", "units"]], "pedalboard.AudioUnitPlugin": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "get_plugin_names_for_file"], [6, 2, 1, "", "name"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"], [6, 3, 1, "", "show_editor"]], "pedalboard.Bitcrush": [[6, 3, 1, "", "__call__"], [6, 2, 1, "", "bit_depth"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Chain": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "append"], [6, 3, 1, "", "insert"], [6, 3, 1, "", "process"], [6, 3, 1, "", "remove"], [6, 3, 1, "", "reset"]], "pedalboard.Chorus": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 2, 1, "", "rate_hz"], [6, 3, 1, "", "reset"]], "pedalboard.Clipping": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Compressor": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Convolution": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Delay": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Distortion": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.ExternalPlugin": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.GSMFullRateCompressor": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Gain": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.HighShelfFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.HighpassFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.IIRFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Invert": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.LadderFilter": [[6, 1, 1, "", "Mode"], [6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.LadderFilter.Mode": [[6, 4, 1, "", "BPF12"], [6, 4, 1, "", "BPF24"], [6, 4, 1, "", "HPF12"], [6, 4, 1, "", "HPF24"], [6, 4, 1, "", "LPF12"], [6, 4, 1, "", "LPF24"]], "pedalboard.Limiter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.LowShelfFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.LowpassFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.MP3Compressor": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Mix": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "append"], [6, 3, 1, "", "insert"], [6, 3, 1, "", "process"], [6, 3, 1, "", "remove"], [6, 3, 1, "", "reset"]], "pedalboard.NoiseGate": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.PeakFilter": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Pedalboard": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "append"], [6, 3, 1, "", "insert"], [6, 3, 1, "", "process"], [6, 3, 1, "", "remove"], [6, 3, 1, "", "reset"]], "pedalboard.Phaser": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.PitchShift": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.Plugin": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.PluginContainer": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "append"], [6, 3, 1, "", "insert"], [6, 3, 1, "", "process"], [6, 3, 1, "", "remove"], [6, 3, 1, "", "reset"]], "pedalboard.Resample": [[6, 1, 1, "", "Quality"], [6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 2, 1, "", "quality"], [6, 3, 1, "", "reset"], [6, 2, 1, "", "target_sample_rate"]], "pedalboard.Resample.Quality": [[6, 4, 1, "", "CatmullRom"], [6, 4, 1, "", "Lagrange"], [6, 4, 1, "", "Linear"], [6, 4, 1, "", "WindowedSinc"], [6, 4, 1, "", "ZeroOrderHold"]], "pedalboard.Reverb": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"]], "pedalboard.VST3Plugin": [[6, 3, 1, "", "__call__"], [6, 3, 1, "", "get_plugin_names_for_file"], [6, 3, 1, "", "load_preset"], [6, 2, 1, "", "name"], [6, 3, 1, "", "process"], [6, 3, 1, "", "reset"], [6, 3, 1, "", "show_editor"]], "pedalboard.io": [[7, 1, 1, "", "AudioFile"], [7, 1, 1, "", "AudioStream"], [7, 1, 1, "", "ReadableAudioFile"], [7, 1, 1, "", "ResampledReadableAudioFile"], [7, 1, 1, "", "StreamResampler"], [7, 1, 1, "", "WriteableAudioFile"]], "pedalboard.io.AudioStream": [[7, 3, 1, "", "__enter__"], [7, 3, 1, "", "__exit__"], [7, 2, 1, "", "plugins"], [7, 3, 1, "", "run"], [7, 2, 1, "", "running"]], "pedalboard.io.ReadableAudioFile": [[7, 3, 1, "", "__enter__"], [7, 3, 1, "", "__exit__"], [7, 3, 1, "", "close"], [7, 2, 1, "", "closed"], [7, 2, 1, "", "duration"], [7, 2, 1, "", "duration_is_accurate"], [7, 2, 1, "", "file_dtype"], [7, 2, 1, "", "frames"], [7, 2, 1, "", "name"], [7, 2, 1, "", "num_channels"], [7, 3, 1, "", "read"], [7, 3, 1, "", "read_raw"], [7, 3, 1, "", "resampled_to"], [7, 2, 1, "", "samplerate"], [7, 3, 1, "", "seek"], [7, 3, 1, "", "seekable"], [7, 3, 1, "", "tell"]], "pedalboard.io.ResampledReadableAudioFile": [[7, 3, 1, "", "__enter__"], [7, 3, 1, "", "__exit__"], [7, 3, 1, "", "close"], [7, 2, 1, "", "closed"], [7, 2, 1, "", "duration"], [7, 2, 1, "", "duration_is_accurate"], [7, 2, 1, "", "file_dtype"], [7, 2, 1, "", "frames"], [7, 2, 1, "", "name"], [7, 2, 1, "", "num_channels"], [7, 3, 1, "", "read"], [7, 2, 1, "", "resampling_quality"], [7, 2, 1, "", "samplerate"], [7, 3, 1, "", "seek"], [7, 3, 1, "", "seekable"], [7, 3, 1, "", "tell"]], "pedalboard.io.StreamResampler": [[7, 2, 1, "", "input_latency"], [7, 2, 1, "", "num_channels"], [7, 3, 1, "", "process"], [7, 2, 1, "", "quality"], [7, 3, 1, "", "reset"], [7, 2, 1, "", "source_sample_rate"], [7, 2, 1, "", "target_sample_rate"]], "pedalboard.io.WriteableAudioFile": [[7, 3, 1, "", "close"], [7, 2, 1, "", "closed"], [7, 2, 1, "", "file_dtype"], [7, 3, 1, "", "flush"], [7, 2, 1, "", "frames"], [7, 2, 1, "", "num_channels"], [7, 2, 1, "", "quality"], [7, 2, 1, "", "samplerate"], [7, 3, 1, "", "write"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:property", "3": "py:method", "4": "py:attribute", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "property", "Python property"], "3": ["py", "method", "Python method"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "function", "Python function"]}, "titleterms": {"plugin": [0, 1, 2, 4], "compat": [0, 3], "exampl": 1, "quick": 1, "start": 1, "make": 1, "guitar": 1, "style": 1, "pedalboard": [1, 2, 4, 6, 7], "us": [1, 2], "vst3": 1, "audio": [1, 2], "unit": 1, "creat": 1, "parallel": 1, "effect": [1, 2], "chain": 1, "frequent": 2, "ask": 2, "question": 2, "can": 2, "live": [1, 2], "real": 2, "time": 2, "doe": 2, "support": 2, "chang": 2, "": 2, "paramet": 2, "over": 2, "vst": 2, "instrument": 2, "instead": 2, "accept": 2, "midi": 2, "featur": 3, "instal": 3, "refer": 3, "document": 3, "intern": 4, "ad": 4, "new": 4, "built": 4, "design": 4, "consider": 4, "licens": 5, "The": [6, 7], "api": [6, 7], "io": 7, "put": [], "compressor": [], "front": [], "run": 1, "all": [], "simultan": [], "mix": [], "contribut": 1}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 57}, "alltitles": {"Plugin Compatibility": [[0, "plugin-compatibility"]], "Examples": [[1, "examples"]], "Quick start": [[1, "quick-start"]], "Making a guitar-style pedalboard": [[1, "making-a-guitar-style-pedalboard"]], "Using VST3\u00ae or Audio Unit plugins": [[1, "using-vst3-or-audio-unit-plugins"]], "Creating parallel effects chains": [[1, "creating-parallel-effects-chains"]], "Running Pedalboard on Live Audio": [[1, "running-pedalboard-on-live-audio"]], "Contributing": [[1, "contributing"]], "Frequently Asked Questions": [[2, "frequently-asked-questions"]], "Can Pedalboard be used with live (real-time) audio?": [[2, "can-pedalboard-be-used-with-live-real-time-audio"]], "Does Pedalboard support changing a plugin\u2019s parameters over time?": [[2, "does-pedalboard-support-changing-a-plugin-s-parameters-over-time"]], "Can Pedalboard be used with VST instruments, instead of effects?": [[2, "can-pedalboard-be-used-with-vst-instruments-instead-of-effects"]], "Can Pedalboard plugins accept MIDI?": [[2, "can-pedalboard-plugins-accept-midi"]], "Features": [[3, "features"]], "Installation": [[3, "installation"]], "Compatibility": [[3, "compatibility"]], "Reference": [[3, "reference"]], "Documentation": [[3, "documentation"]], "Pedalboard Internals": [[4, "pedalboard-internals"]], "Adding new built-in Pedalboard plugins": [[4, "adding-new-built-in-pedalboard-plugins"]], "Design considerations": [[4, "design-considerations"]], "License": [[5, "license"]], "The pedalboard API": [[6, "the-pedalboard-api"]], "The pedalboard.io API": [[7, "the-pedalboard-io-api"]]}, "indexentries": {"audioprocessorparameter (class in pedalboard)": [[6, "pedalboard.AudioProcessorParameter"]], "audiounitplugin (class in pedalboard)": [[6, "pedalboard.AudioUnitPlugin"]], "bpf12 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.BPF12"]], "bpf24 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.BPF24"]], "bitcrush (class in pedalboard)": [[6, "pedalboard.Bitcrush"]], "catmullrom (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.CatmullRom"]], "chain (class in pedalboard)": [[6, "pedalboard.Chain"]], "chorus (class in pedalboard)": [[6, "pedalboard.Chorus"]], "clipping (class in pedalboard)": [[6, "pedalboard.Clipping"]], "compressor (class in pedalboard)": [[6, "pedalboard.Compressor"]], "convolution (class in pedalboard)": [[6, "pedalboard.Convolution"]], "delay (class in pedalboard)": [[6, "pedalboard.Delay"]], "distortion (class in pedalboard)": [[6, "pedalboard.Distortion"]], "externalplugin (class in pedalboard)": [[6, "pedalboard.ExternalPlugin"]], "gsmfullratecompressor (class in pedalboard)": [[6, "pedalboard.GSMFullRateCompressor"]], "gain (class in pedalboard)": [[6, "pedalboard.Gain"]], "hpf12 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.HPF12"]], "hpf24 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.HPF24"]], "highshelffilter (class in pedalboard)": [[6, "pedalboard.HighShelfFilter"]], "highpassfilter (class in pedalboard)": [[6, "pedalboard.HighpassFilter"]], "iirfilter (class in pedalboard)": [[6, "pedalboard.IIRFilter"]], "invert (class in pedalboard)": [[6, "pedalboard.Invert"]], "lpf12 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.LPF12"]], "lpf24 (pedalboard.ladderfilter.mode attribute)": [[6, "pedalboard.LadderFilter.Mode.LPF24"]], "ladderfilter (class in pedalboard)": [[6, "pedalboard.LadderFilter"]], "ladderfilter.mode (class in pedalboard)": [[6, "pedalboard.LadderFilter.Mode"]], "lagrange (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.Lagrange"]], "limiter (class in pedalboard)": [[6, "pedalboard.Limiter"]], "linear (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.Linear"]], "lowshelffilter (class in pedalboard)": [[6, "pedalboard.LowShelfFilter"]], "lowpassfilter (class in pedalboard)": [[6, "pedalboard.LowpassFilter"]], "mp3compressor (class in pedalboard)": [[6, "pedalboard.MP3Compressor"]], "mix (class in pedalboard)": [[6, "pedalboard.Mix"]], "noisegate (class in pedalboard)": [[6, "pedalboard.NoiseGate"]], "peakfilter (class in pedalboard)": [[6, "pedalboard.PeakFilter"]], "pedalboard (class in pedalboard)": [[6, "pedalboard.Pedalboard"]], "phaser (class in pedalboard)": [[6, "pedalboard.Phaser"]], "pitchshift (class in pedalboard)": [[6, "pedalboard.PitchShift"]], "plugin (class in pedalboard)": [[6, "pedalboard.Plugin"]], "plugincontainer (class in pedalboard)": [[6, "pedalboard.PluginContainer"]], "resample (class in pedalboard)": [[6, "pedalboard.Resample"]], "resample.quality (class in pedalboard)": [[6, "pedalboard.Resample.Quality"]], "reverb (class in pedalboard)": [[6, "pedalboard.Reverb"]], "vst3plugin (class in pedalboard)": [[6, "pedalboard.VST3Plugin"]], "windowedsinc (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.WindowedSinc"]], "zeroorderhold (pedalboard.resample.quality attribute)": [[6, "pedalboard.Resample.Quality.ZeroOrderHold"]], "__call__() (pedalboard.audiounitplugin method)": [[6, "pedalboard.AudioUnitPlugin.__call__"]], "__call__() (pedalboard.bitcrush method)": [[6, "pedalboard.Bitcrush.__call__"]], "__call__() (pedalboard.chain method)": [[6, "pedalboard.Chain.__call__"]], "__call__() (pedalboard.chorus method)": [[6, "pedalboard.Chorus.__call__"]], "__call__() (pedalboard.clipping method)": [[6, "pedalboard.Clipping.__call__"]], "__call__() (pedalboard.compressor method)": [[6, "pedalboard.Compressor.__call__"]], "__call__() (pedalboard.convolution method)": [[6, "pedalboard.Convolution.__call__"]], "__call__() (pedalboard.delay method)": [[6, "pedalboard.Delay.__call__"]], "__call__() (pedalboard.distortion method)": [[6, "pedalboard.Distortion.__call__"]], "__call__() (pedalboard.externalplugin method)": [[6, "pedalboard.ExternalPlugin.__call__"]], "__call__() (pedalboard.gsmfullratecompressor method)": [[6, "pedalboard.GSMFullRateCompressor.__call__"]], "__call__() (pedalboard.gain method)": [[6, "pedalboard.Gain.__call__"]], "__call__() (pedalboard.highshelffilter method)": [[6, "pedalboard.HighShelfFilter.__call__"]], "__call__() (pedalboard.highpassfilter method)": [[6, "pedalboard.HighpassFilter.__call__"]], "__call__() (pedalboard.iirfilter method)": [[6, "pedalboard.IIRFilter.__call__"]], "__call__() (pedalboard.invert method)": [[6, "pedalboard.Invert.__call__"]], "__call__() (pedalboard.ladderfilter method)": [[6, "pedalboard.LadderFilter.__call__"]], "__call__() (pedalboard.limiter method)": [[6, "pedalboard.Limiter.__call__"]], "__call__() (pedalboard.lowshelffilter method)": [[6, "pedalboard.LowShelfFilter.__call__"]], "__call__() (pedalboard.lowpassfilter method)": [[6, "pedalboard.LowpassFilter.__call__"]], "__call__() (pedalboard.mp3compressor method)": [[6, "pedalboard.MP3Compressor.__call__"]], "__call__() (pedalboard.mix method)": [[6, "pedalboard.Mix.__call__"]], "__call__() (pedalboard.noisegate method)": [[6, "pedalboard.NoiseGate.__call__"]], "__call__() (pedalboard.peakfilter method)": [[6, "pedalboard.PeakFilter.__call__"]], "__call__() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.__call__"]], "__call__() (pedalboard.phaser method)": [[6, "pedalboard.Phaser.__call__"]], "__call__() (pedalboard.pitchshift method)": [[6, "pedalboard.PitchShift.__call__"]], "__call__() (pedalboard.plugin method)": [[6, "pedalboard.Plugin.__call__"]], "__call__() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.__call__"]], "__call__() (pedalboard.resample method)": [[6, "pedalboard.Resample.__call__"]], "__call__() (pedalboard.reverb method)": [[6, "pedalboard.Reverb.__call__"]], "__call__() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.__call__"]], "append() (pedalboard.chain method)": [[6, "pedalboard.Chain.append"]], "append() (pedalboard.mix method)": [[6, "pedalboard.Mix.append"]], "append() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.append"]], "append() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.append"]], "bit_depth (pedalboard.bitcrush property)": [[6, "pedalboard.Bitcrush.bit_depth"]], "get_plugin_names_for_file() (pedalboard.audiounitplugin static method)": [[6, "pedalboard.AudioUnitPlugin.get_plugin_names_for_file"]], "get_plugin_names_for_file() (pedalboard.vst3plugin static method)": [[6, "pedalboard.VST3Plugin.get_plugin_names_for_file"]], "insert() (pedalboard.chain method)": [[6, "pedalboard.Chain.insert"]], "insert() (pedalboard.mix method)": [[6, "pedalboard.Mix.insert"]], "insert() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.insert"]], "insert() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.insert"]], "label (pedalboard.audioprocessorparameter property)": [[6, "pedalboard.AudioProcessorParameter.label"]], "load_plugin() (in module pedalboard)": [[6, "pedalboard.load_plugin"]], "load_preset() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.load_preset"]], "module": [[6, "module-pedalboard"], [7, "module-pedalboard.io"]], "name (pedalboard.audiounitplugin property)": [[6, "pedalboard.AudioUnitPlugin.name"]], "name (pedalboard.vst3plugin property)": [[6, "pedalboard.VST3Plugin.name"]], "pedalboard": [[6, "module-pedalboard"]], "process() (pedalboard.audiounitplugin method)": [[6, "pedalboard.AudioUnitPlugin.process"]], "process() (pedalboard.bitcrush method)": [[6, "pedalboard.Bitcrush.process"]], "process() (pedalboard.chain method)": [[6, "pedalboard.Chain.process"]], "process() (pedalboard.chorus method)": [[6, "pedalboard.Chorus.process"]], "process() (pedalboard.clipping method)": [[6, "pedalboard.Clipping.process"]], "process() (pedalboard.compressor method)": [[6, "pedalboard.Compressor.process"]], "process() (pedalboard.convolution method)": [[6, "pedalboard.Convolution.process"]], "process() (pedalboard.delay method)": [[6, "pedalboard.Delay.process"]], "process() (pedalboard.distortion method)": [[6, "pedalboard.Distortion.process"]], "process() (pedalboard.externalplugin method)": [[6, "pedalboard.ExternalPlugin.process"]], "process() (pedalboard.gsmfullratecompressor method)": [[6, "pedalboard.GSMFullRateCompressor.process"]], "process() (pedalboard.gain method)": [[6, "pedalboard.Gain.process"]], "process() (pedalboard.highshelffilter method)": [[6, "pedalboard.HighShelfFilter.process"]], "process() (pedalboard.highpassfilter method)": [[6, "pedalboard.HighpassFilter.process"]], "process() (pedalboard.iirfilter method)": [[6, "pedalboard.IIRFilter.process"]], "process() (pedalboard.invert method)": [[6, "pedalboard.Invert.process"]], "process() (pedalboard.ladderfilter method)": [[6, "pedalboard.LadderFilter.process"]], "process() (pedalboard.limiter method)": [[6, "pedalboard.Limiter.process"]], "process() (pedalboard.lowshelffilter method)": [[6, "pedalboard.LowShelfFilter.process"]], "process() (pedalboard.lowpassfilter method)": [[6, "pedalboard.LowpassFilter.process"]], "process() (pedalboard.mp3compressor method)": [[6, "pedalboard.MP3Compressor.process"]], "process() (pedalboard.mix method)": [[6, "pedalboard.Mix.process"]], "process() (pedalboard.noisegate method)": [[6, "pedalboard.NoiseGate.process"]], "process() (pedalboard.peakfilter method)": [[6, "pedalboard.PeakFilter.process"]], "process() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.process"]], "process() (pedalboard.phaser method)": [[6, "pedalboard.Phaser.process"]], "process() (pedalboard.pitchshift method)": [[6, "pedalboard.PitchShift.process"]], "process() (pedalboard.plugin method)": [[6, "pedalboard.Plugin.process"]], "process() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.process"]], "process() (pedalboard.resample method)": [[6, "pedalboard.Resample.process"]], "process() (pedalboard.reverb method)": [[6, "pedalboard.Reverb.process"]], "process() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.process"]], "quality (pedalboard.resample property)": [[6, "pedalboard.Resample.quality"]], "rate_hz (pedalboard.chorus property)": [[6, "pedalboard.Chorus.rate_hz"]], "remove() (pedalboard.chain method)": [[6, "pedalboard.Chain.remove"]], "remove() (pedalboard.mix method)": [[6, "pedalboard.Mix.remove"]], "remove() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.remove"]], "remove() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.remove"]], "reset() (pedalboard.audiounitplugin method)": [[6, "pedalboard.AudioUnitPlugin.reset"]], "reset() (pedalboard.bitcrush method)": [[6, "pedalboard.Bitcrush.reset"]], "reset() (pedalboard.chain method)": [[6, "pedalboard.Chain.reset"]], "reset() (pedalboard.chorus method)": [[6, "pedalboard.Chorus.reset"]], "reset() (pedalboard.clipping method)": [[6, "pedalboard.Clipping.reset"]], "reset() (pedalboard.compressor method)": [[6, "pedalboard.Compressor.reset"]], "reset() (pedalboard.convolution method)": [[6, "pedalboard.Convolution.reset"]], "reset() (pedalboard.delay method)": [[6, "pedalboard.Delay.reset"]], "reset() (pedalboard.distortion method)": [[6, "pedalboard.Distortion.reset"]], "reset() (pedalboard.externalplugin method)": [[6, "pedalboard.ExternalPlugin.reset"]], "reset() (pedalboard.gsmfullratecompressor method)": [[6, "pedalboard.GSMFullRateCompressor.reset"]], "reset() (pedalboard.gain method)": [[6, "pedalboard.Gain.reset"]], "reset() (pedalboard.highshelffilter method)": [[6, "pedalboard.HighShelfFilter.reset"]], "reset() (pedalboard.highpassfilter method)": [[6, "pedalboard.HighpassFilter.reset"]], "reset() (pedalboard.iirfilter method)": [[6, "pedalboard.IIRFilter.reset"]], "reset() (pedalboard.invert method)": [[6, "pedalboard.Invert.reset"]], "reset() (pedalboard.ladderfilter method)": [[6, "pedalboard.LadderFilter.reset"]], "reset() (pedalboard.limiter method)": [[6, "pedalboard.Limiter.reset"]], "reset() (pedalboard.lowshelffilter method)": [[6, "pedalboard.LowShelfFilter.reset"]], "reset() (pedalboard.lowpassfilter method)": [[6, "pedalboard.LowpassFilter.reset"]], "reset() (pedalboard.mp3compressor method)": [[6, "pedalboard.MP3Compressor.reset"]], "reset() (pedalboard.mix method)": [[6, "pedalboard.Mix.reset"]], "reset() (pedalboard.noisegate method)": [[6, "pedalboard.NoiseGate.reset"]], "reset() (pedalboard.peakfilter method)": [[6, "pedalboard.PeakFilter.reset"]], "reset() (pedalboard.pedalboard method)": [[6, "pedalboard.Pedalboard.reset"]], "reset() (pedalboard.phaser method)": [[6, "pedalboard.Phaser.reset"]], "reset() (pedalboard.pitchshift method)": [[6, "pedalboard.PitchShift.reset"]], "reset() (pedalboard.plugin method)": [[6, "pedalboard.Plugin.reset"]], "reset() (pedalboard.plugincontainer method)": [[6, "pedalboard.PluginContainer.reset"]], "reset() (pedalboard.resample method)": [[6, "pedalboard.Resample.reset"]], "reset() (pedalboard.reverb method)": [[6, "pedalboard.Reverb.reset"]], "reset() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.reset"]], "show_editor() (pedalboard.audiounitplugin method)": [[6, "pedalboard.AudioUnitPlugin.show_editor"]], "show_editor() (pedalboard.vst3plugin method)": [[6, "pedalboard.VST3Plugin.show_editor"]], "target_sample_rate (pedalboard.resample property)": [[6, "pedalboard.Resample.target_sample_rate"]], "units (pedalboard.audioprocessorparameter property)": [[6, "pedalboard.AudioProcessorParameter.units"]], "audiofile (class in pedalboard.io)": [[7, "pedalboard.io.AudioFile"]], "audiostream (class in pedalboard.io)": [[7, "pedalboard.io.AudioStream"]], "readableaudiofile (class in pedalboard.io)": [[7, "pedalboard.io.ReadableAudioFile"]], "resampledreadableaudiofile (class in pedalboard.io)": [[7, "pedalboard.io.ResampledReadableAudioFile"]], "streamresampler (class in pedalboard.io)": [[7, "pedalboard.io.StreamResampler"]], "writeableaudiofile (class in pedalboard.io)": [[7, "pedalboard.io.WriteableAudioFile"]], "__enter__() (pedalboard.io.audiostream method)": [[7, "pedalboard.io.AudioStream.__enter__"]], "__enter__() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.__enter__"]], "__enter__() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.__enter__"]], "__exit__() (pedalboard.io.audiostream method)": [[7, "pedalboard.io.AudioStream.__exit__"]], "__exit__() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.__exit__"]], "__exit__() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.__exit__"]], "close() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.close"]], "close() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.close"]], "close() (pedalboard.io.writeableaudiofile method)": [[7, "pedalboard.io.WriteableAudioFile.close"]], "closed (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.closed"]], "closed (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.closed"]], "closed (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.closed"]], "duration (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.duration"]], "duration (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.duration"]], "duration_is_accurate (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.duration_is_accurate"]], "duration_is_accurate (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.duration_is_accurate"]], "file_dtype (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.file_dtype"]], "file_dtype (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.file_dtype"]], "file_dtype (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.file_dtype"]], "flush() (pedalboard.io.writeableaudiofile method)": [[7, "pedalboard.io.WriteableAudioFile.flush"]], "frames (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.frames"]], "frames (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.frames"]], "frames (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.frames"]], "input_latency (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.input_latency"]], "name (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.name"]], "name (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.name"]], "num_channels (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.num_channels"]], "num_channels (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.num_channels"]], "num_channels (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.num_channels"]], "num_channels (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.num_channels"]], "pedalboard.io": [[7, "module-pedalboard.io"]], "plugins (pedalboard.io.audiostream property)": [[7, "pedalboard.io.AudioStream.plugins"]], "process() (pedalboard.io.streamresampler method)": [[7, "pedalboard.io.StreamResampler.process"]], "quality (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.quality"]], "quality (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.quality"]], "read() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.read"]], "read() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.read"]], "read_raw() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.read_raw"]], "resampled_to() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.resampled_to"]], "resampling_quality (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.resampling_quality"]], "reset() (pedalboard.io.streamresampler method)": [[7, "pedalboard.io.StreamResampler.reset"]], "run() (pedalboard.io.audiostream method)": [[7, "pedalboard.io.AudioStream.run"]], "running (pedalboard.io.audiostream property)": [[7, "pedalboard.io.AudioStream.running"]], "samplerate (pedalboard.io.readableaudiofile property)": [[7, "pedalboard.io.ReadableAudioFile.samplerate"]], "samplerate (pedalboard.io.resampledreadableaudiofile property)": [[7, "pedalboard.io.ResampledReadableAudioFile.samplerate"]], "samplerate (pedalboard.io.writeableaudiofile property)": [[7, "pedalboard.io.WriteableAudioFile.samplerate"]], "seek() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.seek"]], "seek() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.seek"]], "seekable() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.seekable"]], "seekable() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.seekable"]], "source_sample_rate (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.source_sample_rate"]], "target_sample_rate (pedalboard.io.streamresampler property)": [[7, "pedalboard.io.StreamResampler.target_sample_rate"]], "tell() (pedalboard.io.readableaudiofile method)": [[7, "pedalboard.io.ReadableAudioFile.tell"]], "tell() (pedalboard.io.resampledreadableaudiofile method)": [[7, "pedalboard.io.ResampledReadableAudioFile.tell"]], "write() (pedalboard.io.writeableaudiofile method)": [[7, "pedalboard.io.WriteableAudioFile.write"]]}})\ No newline at end of filediff --git a/pedalboard/io/ReadableAudioFile.h b/pedalboard/io/ReadableAudioFile.hindex 2ecd148..9f92ba8 100644--- a/pedalboard/io/ReadableAudioFile.h+++ b/pedalboard/io/ReadableAudioFile.h@@ -25,6 +25,7 @@#include "../BufferUtils.h"#include "../JuceHeader.h"+#include "../juce_overrides/juce_PatchedMP3AudioFormat.h"#include "AudioFile.h"#include "PythonInputStream.h"@@ -111,16 +112,16 @@ public:return reader->sampleRate;}- long getLengthInSamples() const {+ long long getLengthInSamples() const {if (!reader)throw std::runtime_error("I/O operation on a closed file.");- return reader->lengthInSamples;+ return reader->lengthInSamples + (lengthCorrection ? *lengthCorrection : 0);}double getDuration() const {if (!reader)throw std::runtime_error("I/O operation on a closed file.");- return reader->lengthInSamples / reader->sampleRate;+ return getLengthInSamples() / reader->sampleRate;}long getNumChannels() const {@@ -183,10 +184,14 @@ public:// Allocate a buffer to return of up to numSamples:long long numChannels = reader->numChannels;numSamples =- std::min(numSamples, reader->lengthInSamples - currentPosition);+ std::min(numSamples, (reader->lengthInSamples ++ (lengthCorrection ? *lengthCorrection : 0)) -+ currentPosition);py::array_t<float> buffer =py::array_t<float>({(long long)numChannels, (long long)numSamples});+ long long numSamplesToKeep = numSamples;+py::buffer_info outputInfo = buffer.request();{@@ -208,9 +213,27 @@ public:currentPosition, numSamples);PythonException::raise();- if (!readResult) {- throwReadError(currentPosition, numSamples);+ juce::int64 samplesRead = numSamples;+ if (juce::AudioFormatReaderWithPosition *positionAware =+ dynamic_cast<juce::AudioFormatReaderWithPosition *>(+ reader.get())) {+ samplesRead = positionAware->getCurrentPosition() - currentPosition;}++ bool hitEndOfFile =+ (samplesRead + currentPosition) == reader->lengthInSamples;++ // We read some data, but not as much as we asked for!+ // This will only happen for lossy, header-optional formats+ // like MP3.+ if (samplesRead < numSamples || hitEndOfFile) {+ lengthCorrection =+ (samplesRead + currentPosition) - reader->lengthInSamples;+ } else if (!readResult) {+ throwReadError(currentPosition, numSamples, samplesRead);+ }++ numSamplesToKeep = samplesRead;} else {// If the audio is stored in an integral format, read it as integers// and do the floating-point conversion ourselves to work around@@ -256,7 +279,12 @@ public:}}- currentPosition += numSamples;+ currentPosition += numSamplesToKeep;++ if (numSamplesToKeep < numSamples) {+ buffer.resize({(long long)numChannels, (long long)numSamplesToKeep});+ }+return buffer;}@@ -300,7 +328,9 @@ public:// Allocate a buffer to return of up to numSamples:long long numChannels = reader->numChannels;numSamples =- std::min(numSamples, reader->lengthInSamples - currentPosition);+ std::min(numSamples, (reader->lengthInSamples ++ (lengthCorrection ? *lengthCorrection : 0)) -+ currentPosition);py::array_t<SampleType> buffer = py::array_t<SampleType>({(long long)numChannels, (long long)numSamples});@@ -378,10 +408,13 @@ public:const juce::ScopedLock scopedLock(objectLock);if (!reader)throw std::runtime_error("I/O operation on a closed file.");- if (targetPosition > reader->lengthInSamples)- throw std::domain_error("Cannot seek beyond end of file (" +- std::to_string(reader->lengthInSamples) +- " frames).");+ if (targetPosition >+ (reader->lengthInSamples + (lengthCorrection ? *lengthCorrection : 0)))+ throw std::domain_error(+ "Cannot seek beyond end of file (" ++ std::to_string(reader->lengthInSamples ++ (lengthCorrection ? *lengthCorrection : 0)) ++ " frames).");if (targetPosition < 0)throw std::domain_error("Cannot seek before start of file.");currentPosition = targetPosition;@@ -412,6 +445,25 @@ public:return !isClosed();}+ bool durationIsAccurate() const {+ const juce::ScopedLock scopedLock(objectLock);++ if (juce::AudioFormatReaderWithPosition *approximateLengthReader =+ dynamic_cast<juce::AudioFormatReaderWithPosition *>(reader.get())) {+ if (approximateLengthReader->lengthIsApproximate()) {+ // Note: lengthCorrection is an std::optional,+ // so this is checking if it's set; not if it's zero:+ if (!lengthCorrection) {+ // The reader returns an approximate length, and we haven't+ // hit the end of the file yet:+ return false;+ }+ }+ }++ return true;+ }+std::optional<std::string> getFilename() const { return filename; }PythonInputStream *getPythonInputStream() const {@@ -435,7 +487,8 @@ public:}private:- void throwReadError(long long currentPosition, long long numSamples) {+ void throwReadError(long long currentPosition, long long numSamples,+ long long samplesRead = -1) {std::ostringstream ss;ss.imbue(std::locale(""));@@ -451,8 +504,12 @@ private:<< " Tried to read " << numSamples<< " frames of audio from frame offset " << currentPosition;+ if (samplesRead != -1) {+ ss << " but only decoded " << samplesRead << " frames";+ }+if (PythonInputStream *stream = getPythonInputStream()) {- ss << " but encountered invalid data near byte " << stream->getPosition();+ ss << " and encountered invalid data near byte " << stream->getPosition();}ss << ".";@@ -477,6 +534,14 @@ private:juce::CriticalSection objectLock;int currentPosition = 0;++ // Certain files (notably CBR MP3 files) can report the wrong number of+ // frames until the entire file is scanned. This field stores the delta+ // between the actual number of frames and the reported number of frames.+ // If more frames are present in the file than expected, `lengthCorrection`+ // will be greater than 0; if fewer are present, `lengthCorrection` will+ // be less than 0.+ std::optional<long long> lengthCorrection = {};};inline py::class_<ReadableAudioFile, AudioFile,@@ -556,30 +621,45 @@ inline void init_readable_audio_file(std::make_unique<PythonInputStream>(filelike));},py::arg("cls"), py::arg("file_like"))- .def(- "read", &ReadableAudioFile::read, py::arg("num_frames") = 0,- "Read the given number of frames (samples in each channel) from this "- "audio file at its current position.\n\n``num_frames`` is a required "- "argument, as audio files can be deceptively large. (Consider that "- "an hour-long ``.ogg`` file may be only a handful of megabytes on "- "disk, but may decompress to nearly a gigabyte in memory.) Audio "- "files should be read in chunks, rather than all at once, to avoid "- "hard-to-debug memory problems and out-of-memory crashes.\n\nAudio "- "samples are returned as a multi-dimensional :class:`numpy.array` "- "with the shape ``(channels, samples)``; i.e.: a stereo audio file "- "will have shape ``(2, <length>)``. Returned data is always in the "- "``float32`` datatype.\n\nFor most (but not all) audio files, the "- "minimum possible sample value will be ``-1.0f`` and the maximum "- "sample value will be ``+1.0f``.")- .def(- "read_raw", &ReadableAudioFile::readRaw, py::arg("num_frames") = 0,- "Read the given number of frames (samples in each channel) from this "- "audio file at the current position.\n\nAudio samples are returned "- "as a multi-dimensional :class:`numpy.array` with the shape "- "``(channels, samples)``; i.e.: a stereo audio file "- "will have shape ``(2, <length>)``. Returned data is in the raw "- "format stored by the underlying file (one of ``int8``, ``int16``, "- "``int32``, or ``float32``).")+ .def("read", &ReadableAudioFile::read, py::arg("num_frames") = 0, R"(+Read the given number of frames (samples in each channel) from this audio file at its current position.++``num_frames`` is a required argument, as audio files can be deceptively large. (Consider that+an hour-long ``.ogg`` file may be only a handful of megabytes on disk, but may decompress to+nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+hard-to-debug memory problems and out-of-memory crashes.++Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape+``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``.+Returned data is always in the ``float32`` datatype.++If the file does not contain enough audio data to fill ``num_frames``, the returned+:class:`numpy.array` will contain as many frames as could be read from the file. (See+:py:attr:`frames` and :py:attr:`duration_is_accurate` for more information about situations+in which this may be true.)++For most (but not all) audio files, the minimum possible sample value will be ``-1.0f`` and the+maximum sample value will be ``+1.0f``.+)")+ .def("read_raw", &ReadableAudioFile::readRaw, py::arg("num_frames") = 0,+ R"(+Read the given number of frames (samples in each channel) from this audio file at its current position.++``num_frames`` is a required argument, as audio files can be deceptively large. (Consider that+an hour-long ``.ogg`` file may be only a handful of megabytes on disk, but may decompress to+nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+hard-to-debug memory problems and out-of-memory crashes.++Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape+``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``.+Returned data is in the raw format stored by the underlying file (one of ``int8``, ``int16``,+``int32``, or ``float32``) and may have any magnitude.++If the file does not contain enough audio data to fill ``num_frames``, the returned+:class:`numpy.array` will contain as many frames as could be read from the file. (See+:py:attr:`frames` and :py:attr:`duration_is_accurate` for more information about situations+in which this may be true.)+)").def("seekable", &ReadableAudioFile::isSeekable,"Returns True if this file is currently open and calls to seek() ""will work.")@@ -635,15 +715,78 @@ inline void init_readable_audio_file("(per channel) per second (Hz).").def_property_readonly("num_channels", &ReadableAudioFile::getNumChannels,"The number of channels in this file.")- .def_property_readonly(- "frames", &ReadableAudioFile::getLengthInSamples,- "The total number of frames (samples per "- "channel) in this file.\n\nFor example, if this "- "file contains 10 seconds of stereo audio at sample "- "rate of 44,100 Hz, ``frames`` will return ``441,000``.")+ .def_property_readonly("duration_is_accurate",+ &ReadableAudioFile::durationIsAccurate,+ R"(+Returns :py:const:`True` if this file's :py:attr:`frames` and+:py:attr:`duration` attributes are accurate, or :py:const:`False` if the+:py:attr:`frames` and :py:attr:`duration` attributes are estimates based+on the file's size and bitrate.++If :py:attr:`duration_is_accurate` is :py:const:`False`, this value will+change to :py:const:`True` once the file is read to completion. Once+:py:const:`True`, this value will not change back to :py:const:`False`+for the same :py:class:`AudioFile` object (even after calls to :meth:`seek`).++.. note::+ :py:attr:`duration_is_accurate` can only ever be :py:const:`False`+ when reading certain MP3 files. For files in other formats than MP3,+ :py:attr:`duration_is_accurate` will always be equal to :py:const:`True`.++*Introduced in v0.7.2.*+)")+ .def_property_readonly("frames", &ReadableAudioFile::getLengthInSamples,+ R"(+The total number of frames (samples per channel) in this file.++For example, if this file contains 10 seconds of stereo audio at sample rate+of 44,100 Hz, ``frames`` will return ``441,000``.++.. warning::+ When reading certain MP3 files that have been encoded in constant bitrate mode,+ the :py:attr:`frames` and :py:attr:`duration` properties may initially be estimates+ and **may change as the file is read**. The :py:attr:`duration_is_accurate`+ property indicates if the values of :py:attr:`frames` and :py:attr:`duration`+ are estimates or exact values.++ This discrepancy is due to the fact that MP3 files are not required to have+ headers that indicate the duration of the file. If an MP3 file is opened and a+ ``Xing`` or ``Info`` header frame is not found, the initial value of the+ :py:attr:`frames` and :py:attr:`duration` attributes are estimates based on the file's+ bitrate and size. This may result in an overestimate of the file's duration+ if there is additional data present in the file after the audio stream is finished.++ If the exact number of frames in the file is required, read the entire file+ first before accessing the :py:attr:`frames` or :py:attr:`duration` properties.+ This operation forces each frame to be parsed and guarantees that+ :py:attr:`frames` and :py:attr:`duration` are correct, at the expense of+ scanning the entire file::++ with AudioFile("my_file.mp3") as f:+ while f.tell() < f.frames:+ f.read(f.samplerate * 60)++ # f.frames is now guaranteed to be accurate, as the entire file has been read:+ assert f.duration_is_accurate == True++ f.seek(0)+ num_channels, num_samples = f.read(f.frames).shape+ assert num_samples == f.frames++ This behaviour is present in v0.7.2 and later; prior versions would+ raise an exception when trying to read the ends of MP3 files that contained+ trailing non-audio data and lacked ``Xing`` or ``Info`` headers.+)").def_property_readonly("duration", &ReadableAudioFile::getDuration,- "The duration of this file in seconds (``frames`` "- "divided by ``samplerate``).")+ R"(+The duration of this file in seconds (``frames`` divided by ``samplerate``).++.. warning::+ :py:attr:`duration` may be an overestimate for certain MP3 files.+ Use :py:attr:`duration_is_accurate` property to determine if+ :py:attr:`duration` is accurate. (See the documentation for the+ :py:attr:`frames` attribute for more details.)+)").def_property_readonly("file_dtype", &ReadableAudioFile::getFileDatatype,"The data type (``\"int16\"``, ``\"float32\"``, etc) stored "diff --git a/pedalboard/io/ResampledReadableAudioFile.h b/pedalboard/io/ResampledReadableAudioFile.hindex 6c0075b..b0b620a 100644--- a/pedalboard/io/ResampledReadableAudioFile.h+++ b/pedalboard/io/ResampledReadableAudioFile.h@@ -61,6 +61,8 @@ public:long getNumChannels() const { return audioFile->getNumChannels(); }+ bool durationIsAccurate() const { return audioFile->durationIsAccurate(); }+std::string getFileFormat() const { return audioFile->getFileFormat(); }std::string getFileDatatype() const { return audioFile->getFileDatatype(); }@@ -298,21 +300,28 @@ inline void init_resampled_readable_audio_file(py::arg("cls"), py::arg("audio_file"), py::arg("target_sample_rate"),py::arg("resampling_quality") = ResamplingQuality::WindowedSinc).def("read", &ResampledReadableAudioFile::read, py::arg("num_frames") = 0,- "Read the given number of frames (samples in each channel, at the "- "target sample rate) from this audio file at its current position, "- "automatically resampling on-the-fly to "- "``target_sample_rate``.\n\n``num_frames`` is a required argument, "- "as audio files can be deceptively large. (Consider that an "- "hour-long ``.ogg`` file may be only a handful of megabytes on "- "disk, but may decompress to nearly a gigabyte in memory.) Audio "- "files should be read in chunks, rather than all at once, to avoid "- "hard-to-debug memory problems and out-of-memory crashes.\n\nAudio "- "samples are returned as a multi-dimensional :class:`numpy.array` "- "with the shape ``(channels, samples)``; i.e.: a stereo audio file "- "will have shape ``(2, <length>)``. Returned data is always in the "- "``float32`` datatype.\n\nFor most (but not all) audio files, the "- "minimum possible sample value will be ``-1.0f`` and the maximum "- "sample value will be ``+1.0f``.")+ R"(+Read the given number of frames (samples in each channel, at the target sample rate)+from this audio file at its current position, automatically resampling on-the-fly to+``target_sample_rate``.++``num_frames`` is a required argument, as audio files can be deceptively large. (Consider that+an hour-long ``.ogg`` file may be only a handful of megabytes on disk, but may decompress to+nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+hard-to-debug memory problems and out-of-memory crashes.++Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape+``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``.+Returned data is always in the ``float32`` datatype.++If the file does not contain enough audio data to fill ``num_frames``, the returned+:class:`numpy.array` will contain as many frames as could be read from the file. (See+:py:attr:`frames` and :py:attr:`duration_is_accurate` for more information about situations+in which this may be true.)++For most (but not all) audio files, the minimum possible sample value will be ``-1.0f`` and the+maximum sample value will be ``+1.0f``.+)").def("seekable", &ResampledReadableAudioFile::isSeekable,"Returns True if this file is currently open and calls to seek() ""will work.")@@ -382,6 +391,26 @@ inline void init_resampled_readable_audio_file(.def_property_readonly("num_channels",&ResampledReadableAudioFile::getNumChannels,"The number of channels in this file.")+ .def_property_readonly("duration_is_accurate",+ &ResampledReadableAudioFile::durationIsAccurate,+ R"(+Returns :py:const:`True` if this file's :py:attr:`frames` and+:py:attr:`duration` attributes are accurate, or :py:const:`False` if the+:py:attr:`frames` and :py:attr:`duration` attributes are estimates based+on the file's size and bitrate.++:py:attr:`duration_is_accurate` will change from :py:const:`False` to+:py:const:`True` as the file is read to completion. Once :py:const:`True`,+this value will not change back to :py:const:`False` for the same+:py:class:`AudioFile` object (even after calls to :meth:`seek`).++.. note::+ :py:attr:`duration_is_accurate` can only ever be :py:const:`False`+ when reading certain MP3 files. For files in other formats than MP3,+ :py:attr:`duration_is_accurate` will always be equal to :py:const:`True`.++*Introduced in v0.7.2.*+)").def_property_readonly("frames", &ResampledReadableAudioFile::getLengthInSamples,"The total number of frames (samples per "@@ -390,11 +419,21 @@ inline void init_resampled_readable_audio_file("rate of 44,100 Hz, and ``target_sample_rate`` is 22,050 Hz, ""``frames`` will return ``22,050``.\n\nNote that different ""``resampling_quality`` values used for resampling may cause "- "``frames`` to differ by ± 1 from its expected value.")- .def_property_readonly("duration",- &ResampledReadableAudioFile::getDuration,- "The duration of this file in seconds (``frames`` "- "divided by ``samplerate``).")+ "``frames`` to differ by ± 1 from its expected value.\n\n.. "+ "warning::\n When reading certain MP3 files, the "+ ":py:attr:`frames` and :py:attr:`duration` properties may "+ "initially be estimates and **may change as the file is read**. "+ "See the documentation for :py:attr:`.ReadableAudioFile.frames` "+ "for more details.")+ .def_property_readonly(+ "duration", &ResampledReadableAudioFile::getDuration,+ "The duration of this file in seconds (``frames`` "+ "divided by ``samplerate``).\n\n.. "+ "warning::\n When reading certain MP3 files, the "+ ":py:attr:`frames` and :py:attr:`duration` properties may "+ "initially be estimates and **may change as the file is read**. "+ "See the documentation for :py:attr:`.ReadableAudioFile.frames` "+ "for more details.").def_property_readonly("file_dtype", &ResampledReadableAudioFile::getFileDatatype,"The data type (``\"int16\"``, ``\"float32\"``, etc) stored "diff --git a/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cpp b/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cppindex c161711..c1a270b 100644--- a/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cpp+++ b/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cpp@@ -3281,11 +3281,11 @@ private:static const char *const mp3FormatName = "MP3 file";//==============================================================================-class PatchedMP3Reader : public AudioFormatReader {+class PatchedMP3Reader : public AudioFormatReaderWithPosition {public:PatchedMP3Reader(InputStream *const in)- : AudioFormatReader(in, mp3FormatName), stream(*in), currentPosition(0),- decodedStart(0), decodedEnd(0) {+ : AudioFormatReaderWithPosition(in, mp3FormatName), stream(*in),+ currentPosition(0), decodedStart(0), decodedEnd(0) {skipID3();const int64 streamPos = stream.stream.getPosition();@@ -3366,6 +3366,14 @@ public:return true;}+ int64 getCurrentPosition() const override { return currentPosition; }++ bool lengthIsApproximate() const override {+ // stream.numFrames will only be set if we have a VBR header,+ // which identifies the exact number of samples expected in the stream:+ return stream.numFrames <= 0;+ }+private:PatchedMP3Stream stream;int64 currentPosition;diff --git a/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.h b/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.hindex 92f12ea..c1713e3 100644--- a/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.h+++ b/pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.h@@ -1,3 +1,4 @@+#pragma once#include "../JuceHeader.h"/*==============================================================================@@ -69,4 +70,13 @@ public:using AudioFormat::createWriterFor;};+class AudioFormatReaderWithPosition : public AudioFormatReader {+public:+ AudioFormatReaderWithPosition(InputStream *sourceStream,+ const String &formatName)+ : AudioFormatReader(sourceStream, formatName) {}+ virtual int64 getCurrentPosition() const = 0;+ virtual bool lengthIsApproximate() const { return false; };+};+} // namespace jucediff --git a/pedalboard_native/io/__init__.pyi b/pedalboard_native/io/__init__.pyiindex c30c61c..27508fa 100644--- a/pedalboard_native/io/__init__.pyi+++ b/pedalboard_native/io/__init__.pyi@@ -316,17 +316,41 @@ class ReadableAudioFile(AudioFile):"""Read the given number of frames (samples in each channel) from this audio file at its current position.- ``num_frames`` is a required argument, as audio files can be deceptively large. (Consider that an hour-long ``.ogg`` file may be only a handful of megabytes on disk, but may decompress to nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid hard-to-debug memory problems and out-of-memory crashes.+ ``num_frames`` is a required argument, as audio files can be deceptively large. (Consider that+ an hour-long ``.ogg`` file may be only a handful of megabytes on disk, but may decompress to+ nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+ hard-to-debug memory problems and out-of-memory crashes.- Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape ``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``. Returned data is always in the ``float32`` datatype.+ Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape+ ``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``.+ Returned data is always in the ``float32`` datatype.- For most (but not all) audio files, the minimum possible sample value will be ``-1.0f`` and the maximum sample value will be ``+1.0f``.+ If the file does not contain enough audio data to fill ``num_frames``, the returned+ :class:`numpy.array` will contain as many frames as could be read from the file. (See+ :py:attr:`frames` and :py:attr:`duration_is_accurate` for more information about situations+ in which this may be true.)++ For most (but not all) audio files, the minimum possible sample value will be ``-1.0f`` and the+ maximum sample value will be ``+1.0f``."""def read_raw(self, num_frames: int = 0) -> numpy.ndarray:"""- Read the given number of frames (samples in each channel) from this audio file at the current position.+ Read the given number of frames (samples in each channel) from this audio file at its current position.++ ``num_frames`` is a required argument, as audio files can be deceptively large. (Consider that+ an hour-long ``.ogg`` file may be only a handful of megabytes on disk, but may decompress to+ nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+ hard-to-debug memory problems and out-of-memory crashes.++ Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape+ ``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``.+ Returned data is in the raw format stored by the underlying file (one of ``int8``, ``int16``,+ ``int32``, or ``float32``) and may have any magnitude.- Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape ``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``. Returned data is in the raw format stored by the underlying file (one of ``int8``, ``int16``, ``int32``, or ``float32``).+ If the file does not contain enough audio data to fill ``num_frames``, the returned+ :class:`numpy.array` will contain as many frames as could be read from the file. (See+ :py:attr:`frames` and :py:attr:`duration_is_accurate` for more information about situations+ in which this may be true.)"""def resampled_to(self,@@ -362,6 +386,34 @@ class ReadableAudioFile(AudioFile):"""The duration of this file in seconds (``frames`` divided by ``samplerate``).+ .. warning::+ :py:attr:`duration` may be an overestimate for certain MP3 files.+ Use :py:attr:`duration_is_accurate` property to determine if+ :py:attr:`duration` is accurate. (See the documentation for the+ :py:attr:`frames` attribute for more details.)+++ """+ @property+ def duration_is_accurate(self) -> bool:+ """+ Returns :py:const:`True` if this file's :py:attr:`frames` and+ :py:attr:`duration` attributes are accurate, or :py:const:`False` if the+ :py:attr:`frames` and :py:attr:`duration` attributes are estimates based+ on the file's size and bitrate.++ If :py:attr:`duration_is_accurate` is :py:const:`False`, this value will+ change to :py:const:`True` once the file is read to completion. Once+ :py:const:`True`, this value will not change back to :py:const:`False`+ for the same :py:class:`AudioFile` object (even after calls to :meth:`seek`).++ .. note::+ :py:attr:`duration_is_accurate` can only ever be :py:const:`False`+ when reading certain MP3 files. For files in other formats than MP3,+ :py:attr:`duration_is_accurate` will always be equal to :py:const:`True`.++ *Introduced in v0.7.2.*+"""@property@@ -378,7 +430,43 @@ class ReadableAudioFile(AudioFile):"""The total number of frames (samples per channel) in this file.- For example, if this file contains 10 seconds of stereo audio at sample rate of 44,100 Hz, ``frames`` will return ``441,000``.+ For example, if this file contains 10 seconds of stereo audio at sample rate+ of 44,100 Hz, ``frames`` will return ``441,000``.++ .. warning::+ When reading certain MP3 files that have been encoded in constant bitrate mode,+ the :py:attr:`frames` and :py:attr:`duration` properties may initially be estimates+ and **may change as the file is read**. The :py:attr:`duration_is_accurate`+ property indicates if the values of :py:attr:`frames` and :py:attr:`duration`+ are estimates or exact values.++ This discrepancy is due to the fact that MP3 files are not required to have+ headers that indicate the duration of the file. If an MP3 file is opened and a+ ``Xing`` or ``Info`` header frame is not found, the initial value of the+ :py:attr:`frames` and :py:attr:`duration` attributes are estimates based on the file's+ bitrate and size. This may result in an overestimate of the file's duration+ if there is additional data present in the file after the audio stream is finished.++ If the exact number of frames in the file is required, read the entire file+ first before accessing the :py:attr:`frames` or :py:attr:`duration` properties.+ This operation forces each frame to be parsed and guarantees that+ :py:attr:`frames` and :py:attr:`duration` are correct, at the expense of+ scanning the entire file::++ with AudioFile("my_file.mp3") as f:+ while f.tell() < f.frames:+ f.read(f.samplerate * 60)++ # f.frames is now guaranteed to be accurate, as the entire file has been read:+ assert f.duration_is_accurate == True++ f.seek(0)+ num_channels, num_samples = f.read(f.frames).shape+ assert num_samples == f.frames++ This behaviour is present in v0.7.2 and later; prior versions would+ raise an exception when trying to read the ends of MP3 files that contained+ trailing non-audio data and lacked ``Xing`` or ``Info`` headers."""@@ -465,13 +553,26 @@ class ResampledReadableAudioFile(AudioFile):"""def read(self, num_frames: int = 0) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.float32]]:"""- Read the given number of frames (samples in each channel, at the target sample rate) from this audio file at its current position, automatically resampling on-the-fly to ``target_sample_rate``.+ Read the given number of frames (samples in each channel, at the target sample rate)+ from this audio file at its current position, automatically resampling on-the-fly to+ ``target_sample_rate``.- ``num_frames`` is a required argument, as audio files can be deceptively large. (Consider that an hour-long ``.ogg`` file may be only a handful of megabytes on disk, but may decompress to nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid hard-to-debug memory problems and out-of-memory crashes.+ ``num_frames`` is a required argument, as audio files can be deceptively large. (Consider that+ an hour-long ``.ogg`` file may be only a handful of megabytes on disk, but may decompress to+ nearly a gigabyte in memory.) Audio files should be read in chunks, rather than all at once, to avoid+ hard-to-debug memory problems and out-of-memory crashes.- Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape ``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``. Returned data is always in the ``float32`` datatype.+ Audio samples are returned as a multi-dimensional :class:`numpy.array` with the shape+ ``(channels, samples)``; i.e.: a stereo audio file will have shape ``(2, <length>)``.+ Returned data is always in the ``float32`` datatype.- For most (but not all) audio files, the minimum possible sample value will be ``-1.0f`` and the maximum sample value will be ``+1.0f``.+ If the file does not contain enough audio data to fill ``num_frames``, the returned+ :class:`numpy.array` will contain as many frames as could be read from the file. (See+ :py:attr:`frames` and :py:attr:`duration_is_accurate` for more information about situations+ in which this may be true.)++ For most (but not all) audio files, the minimum possible sample value will be ``-1.0f`` and the+ maximum sample value will be ``+1.0f``."""def seek(self, position: int) -> None:"""@@ -499,6 +600,31 @@ class ResampledReadableAudioFile(AudioFile):"""The duration of this file in seconds (``frames`` divided by ``samplerate``).+ .. warning::+ When reading certain MP3 files, the :py:attr:`frames` and :py:attr:`duration` properties may initially be estimates and **may change as the file is read**. See the documentation for :py:attr:`.ReadableAudioFile.frames` for more details.+++ """+ @property+ def duration_is_accurate(self) -> bool:+ """+ Returns :py:const:`True` if this file's :py:attr:`frames` and+ :py:attr:`duration` attributes are accurate, or :py:const:`False` if the+ :py:attr:`frames` and :py:attr:`duration` attributes are estimates based+ on the file's size and bitrate.++ :py:attr:`duration_is_accurate` will change from :py:const:`False` to+ :py:const:`True` as the file is read to completion. Once :py:const:`True`,+ this value will not change back to :py:const:`False` for the same+ :py:class:`AudioFile` object (even after calls to :meth:`seek`).++ .. note::+ :py:attr:`duration_is_accurate` can only ever be :py:const:`False`+ when reading certain MP3 files. For files in other formats than MP3,+ :py:attr:`duration_is_accurate` will always be equal to :py:const:`True`.++ *Introduced in v0.7.2.*+"""@property@@ -519,6 +645,9 @@ class ResampledReadableAudioFile(AudioFile):Note that different ``resampling_quality`` values used for resampling may cause ``frames`` to differ by ± 1 from its expected value.+ .. warning::+ When reading certain MP3 files, the :py:attr:`frames` and :py:attr:`duration` properties may initially be estimates and **may change as the file is read**. See the documentation for :py:attr:`.ReadableAudioFile.frames` for more details.+"""@propertydiff --git a/tests/test_io.py b/tests/test_io.pyindex db5d4d6..ff8ec5e 100644--- a/tests/test_io.py+++ b/tests/test_io.py@@ -150,6 +150,8 @@ def test_basic_read(audio_filename: str, samplerate: float):af = pedalboard.io.AudioFile(audio_filename)assert af.samplerate == samplerateassert af.num_channels == 1+ if not audio_filename.endswith(".mp3"):+ assert af.duration_is_accurateif any(ext in audio_filename for ext in EXPECT_LENGTH_TO_BE_EXACT):assert af.frames == int(samplerate * EXPECTED_DURATION_SECONDS)else:@@ -178,6 +180,7 @@ def test_basic_read(audio_filename: str, samplerate: float):af.seek(0)actual = af.read(af.frames)+ assert af.duration_is_accurateexpected = generate_sine_at(af.samplerate, num_channels=af.num_channels, num_seconds=af.duration)@@ -978,24 +981,115 @@ def test_real_mp3_parsing_with_lyrics3():use a patched version of JUCE's MP3 parser to allow reading MP3 files that contain Lyrics3data."""- with pedalboard.io.AudioFile(- os.path.join(os.path.dirname(__file__), "audio", "correct", "bad_audio_file_lyrics3.mp3")- ) as f:+ filename = os.path.join(+ os.path.dirname(__file__), "audio", "correct", "bad_audio_file_lyrics3.mp3"+ )+ with pedalboard.io.AudioFile(filename) as f:assert f.frames >= 0assert f.read(f.frames).shape[1] == f.frames[email protected]("quality", list(range(9)))[email protected]("samplerate", [44100, 32000])[email protected]("chunk_size", [1, 2, 16])[email protected]("target_samplerate", [44100, 32000, 22050, 1234.56])+def test_mp3_duration_estimate(samplerate: float, target_samplerate: float, chunk_size: int):+ buf = io.BytesIO()+ buf.name = "output.mp3"++ num_frames = int(samplerate * 2)+ with pedalboard.io.AudioFile(buf, "w", samplerate, 2, quality=320) as f:+ f.write(np.random.rand(2, num_frames))++ # Write some random crap past the end of the file to break length estimation:+ buf.write(np.random.rand(12345).tobytes())+ # Skip the VBR header that LAME automatically writes to force length estimation:+ buf.seek(1044)++ with pedalboard.io.AudioFile(buf) as f:+ assert not f.duration_is_accurate+ assert f.samplerate == samplerate+ original_frame_estimate = f.frames+ audio = f.read(f.frames)+ assert f.duration_is_accurate+ assert f.frames >= num_frames+ assert f.frames < original_frame_estimate+ assert audio.shape[0] == f.num_channels+ assert audio.shape[1] == f.frames+ assert audio.shape[1] >= num_frames+ assert audio.shape[1] < original_frame_estimate++ # Seek back to the start+ f.seek(0)+ # Now that we've read the whole file and+ # seeked back, our duration should be accurate:+ assert f.duration_is_accurate+ # Number of frames read should match reported value:+ assert f.frames == audio.shape[1]++ # Try reading again, but in chunks this time:+ buf.seek(1044)+ with pedalboard.io.AudioFile(buf) as f:+ # Ensure that if we just keep reading, we get exactly `f.frames` frames:+ total_frames_read = 0+ while True:+ frames_read = f.read(chunk_size).shape[1]+ total_frames_read += frames_read+ if not frames_read:+ break+ assert total_frames_read == audio.shape[1]+ assert total_frames_read == f.frames++ # Try reading again, but checking against f.frames this time:+ buf.seek(1044)+ with pedalboard.io.AudioFile(buf) as f:+ total_frames_read = 0+ while f.tell() < f.frames:+ frames_read = f.read(chunk_size).shape[1]+ total_frames_read += frames_read+ if not frames_read:+ break+ assert total_frames_read == audio.shape[1]+ assert total_frames_read == f.frames++ assert f.frames <= original_frame_estimate++ # Ensure that the ResampledReadableAudioFile interface works as expected too:+ buf.seek(1044)+ with pedalboard.io.AudioFile(buf).resampled_to(+ target_samplerate, quality=pedalboard.Resample.Quality.Linear+ ) as f:+ original_frame_estimate = f.frames+ total_frames_read = 0+ while f.tell() < f.frames:+ frames_read = f.read(chunk_size).shape[1]+ total_frames_read += frames_read+ if not frames_read:+ break+ assert f.duration_is_accurate+ assert abs(total_frames_read - int(audio.shape[1] * (target_samplerate / samplerate))) <= 1+ assert total_frames_read == f.frames+ assert f.frames <= original_frame_estimate++@pytest.mark.parametrize("chunk_duration", [16, 1024, 2048, 1024 * 1024])[email protected]("granularity", [1, 16, 17, 1024, 1025, 44100])[email protected]("extension", [".wav", ".aiff", ".flac"])-def test_seek_accuracy(quality: int, chunk_duration: int, granularity: int, extension: str):+ "granularity,max_num_frames",+ [(1, 2305), (16, 2048), (17, 2048), (1024, 44100), (1025, 44100), (44100, 44100)],+)+ "extension,quality", [(".wav", None), (".aiff", None)] + [(".flac", q) for q in [0, 5, 8]]+)+def test_seek_accuracy(+ quality: Optional[int],+ chunk_duration: int,+ granularity: int,+ max_num_frames: int,+ extension: str,+):stream = io.BytesIO()stream.name = "foo" + extensionsr = 44100- input_audio = np.random.rand(sr * 2).astype(np.float32)- if extension != ".flac":- quality = None+ input_audio = np.random.rand(sr).astype(np.float32)with pedalboard.io.AudioFile(stream, "w", sr, quality=quality) as f:f.write(input_audio)stream.seek(0)@@ -1004,19 +1098,20 @@ def test_seek_accuracy(quality: int, chunk_duration: int, granularity: int, extenum_frames = f.framesnp.testing.assert_allclose(f.read(f.frames)[0, : len(input_audio)], input_audio, atol=0.1)- for offset in range(0, num_frames, granularity):+ for offset in range(0, min(max_num_frames, num_frames), granularity):stream.seek(0)with pedalboard.io.ReadableAudioFile(stream) as f:- f.seek(offset)- np.testing.assert_allclose(- f.read(chunk_duration)[0, : len(input_audio) - offset],- input_audio[offset : offset + chunk_duration],- atol=0.1,- err_msg=(- f"{extension} file contents no longer matched after seeking to offset:"- f" {offset:,}"- ),- )+ for _ in range(2):+ f.seek(offset)+ np.testing.assert_allclose(+ f.read(chunk_duration)[0, : len(input_audio) - offset],+ input_audio[offset : offset + chunk_duration],+ atol=0.1,+ err_msg=(+ f"{extension} file contents no longer matched after seeking to offset:"+ f" {offset:,}"+ ),+ )@pytest.mark.parametrize("seek_seconds", [0, 0.1, 0.5, 1, 10])@@ -1050,6 +1145,7 @@ def test_22050Hz_mono_mp3(audio_filename: str, samplerate: float):assert af.duration < 30.5assert af.samplerate == sampleratedata_read_all_at_once = af.read(af.frames)+ assert af.duration_is_accuratechunk_size = MP3_FRAME_LENGTH_SAMPLESchunks = []@@ -1090,6 +1186,7 @@ def test_mp3_at_all_samplerates(quality: str, samplerate: float, num_channels: i# Allow for up to two MP3 frames of padding:assert af.frames <= (signal.shape[-1] + MP3_FRAME_LENGTH_SAMPLES * 2)assert af.frames >= signal.shape[-1]+ assert af.duration_is_accurate# MP3 is lossy, so we can't expect the waveforms to be comparable;# but at least make sure that the first half of the signal is loud# and the second half is silent: