desktop recording sorta works
This commit is contained in:
+4
-6
@@ -82,11 +82,8 @@ impl AudioSystem {
|
||||
// Create MediaStreams to playback decoded audio
|
||||
// The audio context is used to reproduce audio.
|
||||
let webctx = configure_audio_context();
|
||||
let processor = AudioProcessorSender::default();
|
||||
Ok(AudioSystem {
|
||||
webctx,
|
||||
processors: processor,
|
||||
})
|
||||
let processors = AudioProcessorSender::default();
|
||||
Ok(AudioSystem { webctx, processors })
|
||||
}
|
||||
|
||||
pub fn set_processor(&self, processor: AudioProcessor) {
|
||||
@@ -210,7 +207,8 @@ fn process_audio(frame: &JsValue, processor: &mut AudioProcessor) {
|
||||
return;
|
||||
};
|
||||
let input = samples.to_vec();
|
||||
let output = processor.process(&input);
|
||||
let mut output = Vec::with_capacity(input.len());
|
||||
processor.process(&input, &mut output);
|
||||
samples.copy_from(&output);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user