I\'m building a metronome in React Native. After playing a click, I set a setTimeout
for the next click. The timing however, is awful.
I did the followi
I've investigated almost any React Native solution for playing audio and various approaches of using javascript setTimeout()/setInterval(), but none of them were satisfactory in terms of time stability and accuracy.
Probably the only way to go at the moment is to glue some native module like this: https://developer.apple.com/library/content/samplecode/HelloMetronome/Introduction/Intro.html to js side, as described in RN Docs: https://facebook.github.io/react-native/docs/native-modules-ios.html, which gives a pretty decent result, but unfortunately, it's iOS only, of course.