-
Notifications
You must be signed in to change notification settings - Fork 312
Add pedalboard.io.AudioFile. #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@psobot nice PR!
|
|
Thanks @faroit!
Not extensively, but a quick test (reading a WAV file backwards, sample-by-sample, by seeking to each sample first) seems to show Pedalboard is more than 6x faster than PySoundFile when seeking. (Pedalboard was able to seek at 224,671 seeks/sec, while SoundFile seeked at 34,691 seeks/sec.)
|
|
this is great! |
This PR adds:
pedalboard.io, a new submodule containing audio input/output classespedalboard.io.AudioFile, a base class for interfacing with audio filespedalboard.io.ReadableAudioFile, a concrete class for reading audio filespedalboard.io.WriteableAudioFile, a concrete class for writing audio filesQuestions that may arise from this change:
pymad,pyogg, etc), require DLLs to be installed (PySoundFile), or sometimes shell out to FFMPEG (audioread,librosa). Pedalboard (by virtue of JUCE) has the ability to provide high-performance audio reading and writing functionality out-of-the-box without much code, removing the need for third-party dependencies. In tests, this code is up to 20x faster thanlibrosa.loadin certain cases (without resampling).AudioFormatReaderandAudioFormatWriterinterfaces, which only support reading and writing a certain set of audio formats out-of-the-box. Notably, Pedalboard already includeslibmp3lame, which could be used to create a customAudioFormatWritersubclass to allow for MP3 file writing out-of-the-box.