Skip to content

πŸŽ› πŸ”Š A Python library for audio.

Apply shared_ptr changes to new plugins.

Peter Sobota8ad1f379f70
diff --git a/pedalboard/plugin_templates/Resample.h b/pedalboard/plugin_templates/Resample.h
index 4de9894..96ce5f4 100644
--- a/pedalboard/plugin_templates/Resample.h
+++ b/pedalboard/plugin_templates/Resample.h
@@ -433,11 +433,13 @@ private:
};
inline void init_resample(py::module &m) {
- py::class_<Resample<Passthrough<float>, float>, Plugin> resample(
- m, "Resample",
- "A plugin that downsamples the input audio to the given sample rate, "
- "then upsamples it back to the original sample rate. Various quality "
- "settings will produce audible distortion and aliasing effects.");
+ py::class_<Resample<Passthrough<float>, float>, Plugin,
+ std::shared_ptr<Resample<Passthrough<float>, float>>>
+ resample(
+ m, "Resample",
+ "A plugin that downsamples the input audio to the given sample rate, "
+ "then upsamples it back to the original sample rate. Various quality "
+ "settings will produce audible distortion and aliasing effects.");
py::enum_<ResamplingQuality>(resample, "Quality")
.value("ZeroOrderHold", ResamplingQuality::ZeroOrderHold,
@@ -509,7 +511,9 @@ inline void init_resample(py::module &m) {
* signal.
*/
inline void init_resample_with_latency(py::module &m) {
- py::class_<Resample<AddLatency, float>, Plugin>(m, "ResampleWithLatency")
+ py::class_<Resample<AddLatency, float>, Plugin,
+ std::shared_ptr<Resample<AddLatency, float>>>(
+ m, "ResampleWithLatency")
.def(py::init([](float targetSampleRate, int internalLatency,
ResamplingQuality quality) {
auto plugin = std::make_unique<Resample<AddLatency, float>>();
diff --git a/pedalboard/plugins/GSMFullRateCompressor.h b/pedalboard/plugins/GSMFullRateCompressor.h
index 2c43c0f..5bf54b8 100644
--- a/pedalboard/plugins/GSMFullRateCompressor.h
+++ b/pedalboard/plugins/GSMFullRateCompressor.h
@@ -146,7 +146,8 @@ using GSMFullRateCompressor = ForceMono<Resample<
float, GSMFullRateCompressorInternal::GSM_SAMPLE_RATE>>;
inline void init_gsm_full_rate_compressor(py::module &m) {
- py::class_<GSMFullRateCompressor, Plugin>(
+ py::class_<GSMFullRateCompressor, Plugin,
+ std::shared_ptr<GSMFullRateCompressor>>(
m, "GSMFullRateCompressor",
"Apply an GSM Full Rate compressor to emulate the sound of a GSM Full "
"Rate (\"2G\") cellular "