Set gain and pitch on generators before connecting them.

This commit is contained in:
Nolan Darilek 2022-09-04 12:01:32 -05:00
parent aa60e1d70f
commit 9b7fb16ee5

View File

@ -271,6 +271,11 @@ fn add_generator(
let generator = syz::BufferGenerator::new(&context) let generator = syz::BufferGenerator::new(&context)
.expect("Failed to create generator"); .expect("Failed to create generator");
generator.buffer().set(&**b).expect("Unable to set buffer"); generator.buffer().set(&**b).expect("Unable to set buffer");
generator.gain().set(sound.gain).expect("Failed to set gain");
generator
.pitch_bend()
.set(sound.pitch)
.expect("Failed to set pitch");
handle handle
.add_generator(&generator) .add_generator(&generator)
.expect("Unable to add generator"); .expect("Unable to add generator");