MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / new_stream

Method new_stream

examples/custom_nodes/src/nodes/rms.rs:271–277  ·  view source on GitHub ↗

Called when a new stream has been created. Because the new stream may have a different sample rate from the old one, make sure to update any calculations that depend on the sample rate. This gets called outside of the audio thread, so it is safe to allocate and deallocate here.

(&mut self, stream_info: &StreamInfo, _context: &mut ProcStreamCtx)

Source from the content-addressed store, hash-verified

269 // This gets called outside of the audio thread, so it is safe to allocate and
270 // deallocate here.
271 fn new_stream(&mut self, stream_info: &StreamInfo, _context: &mut ProcStreamCtx) {
272 self.window_frames =
273 (self.params.window_size_secs * stream_info.sample_rate.get() as f32).round() as usize;
274
275 self.squares = 0.0;
276 self.num_squared_values = 0;
277 }
278}

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected