sound_stream
sound_stream copied to clipboard
Calculate delta-time from audio clock rather than using the `time` crate.
I am not quite sure if simply replacing precise_time_ns() with stream.get_stream_time() would be sufficient, there may be more refactoring needed, but that would be a good starting point, I suppose...
I might try a basic test where precise_time_ns() would be printed along with stream.get_stream_time() and find out what difference there in their values.
So precise_time_ns() as f64 / self.stream.get_stream_time() results in some jittery numbers, but don't take my word on that yet, I need to do more tests.
Perhaps use clock_ticks? https://github.com/tomaka/clock_ticks