Replies: 1 comment
-
Could you try something like this? Note the section about dynamically changing import dawdreamer as daw
import numpy as np
from scipy.io import wavfile
import librosa
SAMPLE_RATE = 44100
BUFFER_SIZE = 512
def load_audio_file(file_path, duration=None):
sig, rate = librosa.load(file_path, duration=duration, mono=False, sr=SAMPLE_RATE)
assert(rate == SAMPLE_RATE)
return sig
# Make an engine. We'll only need one.
engine = daw.RenderEngine(SAMPLE_RATE, BUFFER_SIZE)
engine.set_bpm(120.) # default is 120.
filepaths = ["file1.wav", "file2.wav", "file3.wav"]
playback = engine.make_playback_processor("playback", np.zeros((2, 1)))
plugin = engine.make_plugin_processor("plugin", "C:/path/to/effect_plugin.dll")
graph = [
(playback, []),
(plugin, ["playback"]),
]
engine.load_graph(graph)
for i, filepath in enumerate(filepaths):
data = load_audio_file(filepath)
duration = data.shape[1]/SAMPLE_RATE
duration += 5 # add a little extra time
playback.set_data(data)
engine.render(duration)
audio = engine.get_audio() # Returns numpy.ndarray shaped (2, NUM_SAMPLES)
wavfile.write(f'output_{i}.wav', SAMPLE_RATE, audio.transpose()) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There are several wav files of various lengths. I want to apply vst to all of these files. Is there a good way?
Beta Was this translation helpful? Give feedback.
All reactions