Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing two advanced players doesn't work #33

Open
robclouth opened this issue Jun 28, 2022 · 5 comments
Open

Syncing two advanced players doesn't work #33

robclouth opened this issue Jun 28, 2022 · 5 comments

Comments

@robclouth
Copy link

Sorry this still isn't resolved and there are no examples or other issues for me to refer to for help.

There are two players A and B. Both are playing, I know this because I can hear them. Both are playing the same track. The BPM and firstBeatMs are accurate, I know this because the phase of each player individually is reported correctly and is correctly synced to the bar. Both have:

player.outputSamplerate = 44100;
player.timeStretching = false;
player.formantCorrection = 0.5;
player.fixDoubleOrHalfBPM = true;
player.syncMode = this.Superpowered.AdvancedAudioPlayer.SyncMode_TempoAndBeat;
player.originalBPM = trackTempo;
player.firstBeatMs = trackFirstBeatMs;
player.syncToBpm = 120;
player.syncToQuantum = 4;
I'm trying to sync B to A.
Currently I'm calling playerB.syncToPhase = playerA.getPhase(); every call of processAudio but it's not changing the phase of playerB. I've confirmed this by sending the phases back from the audio engine to the UI and showing the phase difference. It should be 0 but it's a random amount that depends on when I start playback of player B.

What are the exact steps I need to take?

Thank you

@gaborszanto
Copy link
Member

You need some "event" when the two players can synchronize, such as calling playSynchronized (despite of they're playing already).

@robclouth
Copy link
Author

So calling playSynchronized on B when A is already playing?
B won't play if I start it with playSynchronized(). It only starts with play()

@gaborszanto
Copy link
Member

you can call playSynchronized later

@robclouth
Copy link
Author

Later when? It's not doing anything when I call playSynchronized(). It doesn't play.

@robclouth
Copy link
Author

@gaborszanto I've tried literally everything, I think it must be a bug. I'm completely blocked with this project until you give me more information. Any hints would be hugely helpful. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants