-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pedalboard.io.AudioStream support for Linux (#368)
* pedalboard.io: Add Linux support for AudioStream class Problem AudioStream is currently not supported on Linux due to macro definitions in the build script that disable AudioStream functionalities Solution Add the JUCE_MODULE_AVAILABLE_juce_audio_devices macro to ALL_CPPFLAGS, add link flag with the alsa-lib JUCE dependency for interacting with sound devices in Linux, fix audioDeviceIOCallback to support the live audio playback feature Result AudioStream is now supported on Linux as well as Windows and MacOS * Fix reverb example to use len instead of .frames for SoundFile class * Add example for audio monitoring with Pedalboard effects * Fix formatting * Add alsa-lib package in wheel builder for static linking * Add libasound2-dev dependency for the pre-build on ubuntu-20.04 * Add libasound2-dev dependency to Linux actions * Comment out "delete existing cache" step. * Include Linux in AudioStream tests, remove create_stream_fails_on_linux test * Update test_audio_stream.py * Update test_audio_stream.py * Update test_audio_stream.py * Add step to remove libasound before running tests. * Update all.yml * Add empty string handling in AudioStream constructor * Add snd-dummy kernel module for testing AudioStream on linux * Remove uninstallation of libasound * Handle None audio devices. * Is the default device name empty? * Return None for an audio device name if the device name is the empty string. --------- Co-authored-by: Peter Sobot <[email protected]> Co-authored-by: Peter Sobot <[email protected]>
- Loading branch information
1 parent
372741b
commit 0ba5f9e
Showing
8 changed files
with
95 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pedalboard import Pedalboard, Compressor, Gain, Reverb | ||
from pedalboard.io import AudioStream | ||
|
||
# Open up an audio stream: | ||
stream = AudioStream( | ||
input_device_name=AudioStream.input_device_names[0], | ||
output_device_name=AudioStream.output_device_names[0], | ||
num_input_channels=2, | ||
num_output_channels=2, | ||
allow_feedback=True, | ||
buffer_size=128, | ||
sample_rate=44100, | ||
) | ||
|
||
stream.plugins = Pedalboard([ | ||
Reverb(wet_level=0.2), | ||
Gain(1.0), | ||
Compressor(), | ||
]) | ||
|
||
stream.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters