BeatKeeper icon indicating copy to clipboard operation
BeatKeeper copied to clipboard

audio syncing

Open mgood7123 opened this issue 3 years ago • 2 comments

I can't get the audio to be 100% in sync with the text, as (unfortunately) the audio itself plays out in sync in comparison to a professional metronome such as PFSeq but I can't get it to sync up with the UI, especially at high/low bpm's :(

mgood7123 avatar Nov 18 '20 05:11 mgood7123

Hi @mgood7123, a handler does not guarantee when it will process the message. For this reason in the current implementation the text won't perfectly sync with the sound and the outcome will vary depending outside factors such as if a garbage collection is happening etc. I guess an approach to achieve this would be to create a "video" stream that carries both the visual representation of the metronome and the audio sound.

In other words instead of just generating sound use the same principle and generate sound and "image".

I am not sure how other implementations of metronomes are handling this. Maybe there is another good solution which I cannot think at the moment.

Feel free to submit a PR if you implement this.

MasterEx avatar Nov 22 '20 12:11 MasterEx

This seems relevant: https://developer.android.com/reference/android/media/MediaSync

MasterEx avatar Nov 22 '20 12:11 MasterEx