render audio in background?
-
Is it possible to set a function to push buffers through modules silently in the background?
Lets say I have an audio buffer, can I let it through different effects, nodes silently in the background, and then store the processed buffer and write to an audio file?
-
@ulrik I haven't tried pushing audio to a separate thread, my understanding is pretty limited but it should, hypothetically, be possible.
The BackgroundTask API is certainly what you would want to use for this. I may be working on this exact topic in a few weeks so let me know if you make any progress with it!
-
@ulrik There are multiple ways to achieve this, the most fun one is this here:
- a scriptnode network with a split container that provides a "silent processing chain" by adding a clear node at the start and the end
- two audio file slots, the first is connected to a file player and a file analyzer.
- the second is connected to a recorder node
- the file analyser sends the length of the loaded file of the first slot to the length parameter of the recorder note and starts the playback and recording
- you can add whatever DSP processing you want between the file player and the recorder.
- once the file player is done, the recorder will save the incoming audio into a new buffer
- we can then register the content callback of the second slot to flush the recording. pick and save a file, clear out the first audio file slot.
HiseSnippet 2001.3oc4Y0saaibEdnrGmXkra1TrK1a45qjaSIjbb7lfEoV9GoV05eTkz5cw1KLFSNxZfI4vRNxxZCBvdQun.8pdYtoMOB8191r8MHuAsmYFRQRIYYKA6Esn1.wjyYNy7Mme9NmgoYH2lFEwCQFE6LLfhLdLt8PeQu85QX9nF6iL9X7gjHAMzTOztCCHQQTGjgwR+Z4.FqtLR8yG1dWhKw2llNDBcBmYSOf4wDoi1r5ui45Vm3P6v7xL6Mq1vl6uG2k2GvyR3xn.h8EjyoGQjSq.F8aHQ8PF+b7K1341a57kNarwKd0V1jsnupKoa2JO2YyM25kupxyeEYyWtEs7KPFqTygI3gsEDAMBVzc4NCa2iOvWuAmvhXm4RkuTA0F1Y8vn85wbcZlXbhPHikalZpVRap9T7gLG1nwSMYehRfYpFYMZFElEjpLGPxHCjVVComhaaGxBDoRj34Q3F9fGrKA7MYghdtnB+9kv6wgY3Kr7HWPqGBuLRiRaUt7yLg+Y8upXQv+DILujDZFEX9ZSUnh04TwN8cX71Du.W5nstzZ502r92VYswTF7v1TXAhBFocclKszXahfDBhmx7pHmmVpUDUDi98HttmAgLk5122Vv39kr6Q7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