web-audio-javascript-webassembly-SDK-interactive-audio
web-audio-javascript-webassembly-SDK-interactive-audio copied to clipboard
Syncing two advanced players doesn't work
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
You need some "event" when the two players can synchronize, such as calling playSynchronized (despite of they're playing already).
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()
you can call playSynchronized later
Later when? It's not doing anything when I call playSynchronized(). It doesn't play.
@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.