Skip to content

Commit

Permalink
Update MP3Compressor docs to show all supported sample rates. (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
psobot authored Jul 17, 2024
1 parent 0af5107 commit ae541a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/reference/pedalboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,7 @@ <h1>The <code class="docutils literal notranslate"><span class="pre">pedalboard<
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pedalboard.</span></span><span class="sig-name descname"><span class="pre">MP3Compressor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vbr_quality</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</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">2.0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#pedalboard.MP3Compressor" title="Permalink to this definition">#</a></dt>
<dd><p>An MP3 compressor plugin that runs the LAME MP3 encoder in real-time to add compression artifacts to the audio stream.</p>
<p>Currently only supports variable bit-rate mode (VBR) and accepts a floating-point VBR quality value (between 0.0 and 10.0; lower is better).</p>
<p>Note that the MP3 format only supports 32kHz, 44.1kHz, and 48kHz audio; if an unsupported sample rate is provided, an exception will be thrown at processing time.</p>
<p>Note that the MP3 format only supports 8kHz, 11025Hz, 12kHz, 16kHz, 22050Hz, 24kHz, 32kHz, 44.1kHz, and 48kHz audio; if an unsupported sample rate is provided, an exception will be thrown at processing time.</p>
<dl class="py method">
<dt class="sig sig-object py" id="pedalboard.MP3Compressor.__call__">
<span class="sig-name descname"><span class="pre">__call__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input_array</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sample_rate</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">buffer_size</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">8192</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reset</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</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">True</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</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.MP3Compressor.__call__" title="Permalink to this definition">#</a></dt>
Expand Down
6 changes: 3 additions & 3 deletions pedalboard/plugins/MP3Compressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ inline void init_mp3_compressor(py::module &m) {
"add compression artifacts to the audio stream.\n\nCurrently only "
"supports variable bit-rate mode (VBR) and accepts a floating-point VBR "
"quality value (between 0.0 and 10.0; lower is better).\n\nNote that the "
"MP3 format only supports 32kHz, 44.1kHz, and 48kHz audio; if an "
"unsupported sample rate is provided, an exception will be thrown at "
"processing time.")
"MP3 format only supports 8kHz, 11025Hz, 12kHz, 16kHz, 22050Hz, 24kHz, "
"32kHz, 44.1kHz, and 48kHz audio; if an unsupported sample rate is "
"provided, an exception will be thrown at processing time.")
.def(py::init([](float vbr_quality) {
auto plugin = std::make_unique<MP3Compressor>();
plugin->setVBRQuality(vbr_quality);
Expand Down
2 changes: 1 addition & 1 deletion pedalboard_native/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ class MP3Compressor(Plugin):
Currently only supports variable bit-rate mode (VBR) and accepts a floating-point VBR quality value (between 0.0 and 10.0; lower is better).
Note that the MP3 format only supports 32kHz, 44.1kHz, and 48kHz audio; if an unsupported sample rate is provided, an exception will be thrown at processing time.
Note that the MP3 format only supports 8kHz, 11025Hz, 12kHz, 16kHz, 22050Hz, 24kHz, 32kHz, 44.1kHz, and 48kHz audio; if an unsupported sample rate is provided, an exception will be thrown at processing time.
"""

def __init__(self, vbr_quality: float = 2.0) -> None: ...
Expand Down

0 comments on commit ae541a5

Please sign in to comment.