Issue
I'm working on a metronome app in Ionic React and am trying to follow this GitHub example: https://github.com/francoischalifour/react-metronome. However, when I try to run the metronome currently nothing is happening, although it seems to be going into the start() function in metronome.js and returning this error in the console in Google Chrome:
Uncaught TypeError: Cannot set property 'onmessage' of undefined.
I am new to using the Web Workers API, so I think something may be going wrong there. This is how I am calling the metronome from a file called Home.tsx:
<Metronome tempo={69} beatsPerMeasure = {4}
render={({
tempo,
beatsPerMeasure,
playing,
beat,
onPlay,
onTempoChange,
}) => (
<IonButton onClick = {onPlay}>Start Metronome</IonButton>
Please let me know if you can provide any help or if you would like to see any other sections of the code. I have copied metronome.js and metronome.worker.js directly from the GitHub. Thank you!
Solution
Okay finaly got it to work, check here please, and let me know
Also you may check other option for metronome, up and running here I agree there an issue with code, you may check these two quick demos Demo 1 (Credit 2 toLuka Baramishvili), Demo 2 (Credit 2 Alan Lavender)
Answered By - Feras
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.