Background Music Syncing

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Background Music Syncing

OjosLindos
2019-10-21 23:20:46

Can anyone help me with audio in a multiplayer app I'm developing in Unity with Photon? I want to have background music which is in sync for all players. But what's happening is that the music starts from the beginning for each player as they enter the game. So for example if the first player to enter is at 30" into the music (having started at 0"), the music will continue playing from 30" for the first player but from 0" for the second player. Instead I want the music to be playing at 30" when the second player enters. I've tried every configuration of the Audio Source and Audio Listener components I can think of but can't get the music synced for all players. Thanks for any assistance you can provide!

Comments

DarkJoltGames
2019-11-10 11:16:11

Set a number in a script. Synchronize it with OnSeralizeView, and when a player joins, set the audiosource's seconds to the number in the Start function.

OjosLindos
2019-11-10 17:20:08

Thanks! I'll try this out and post the results.

GameRickster
2022-02-10 17:49:31

OjosLindos 2019-11-10T17:20:08+00:00
Thanks! I'll try this out and post the results. Did you get this to work? I am trying to figure it out.

OjosLindos
2022-02-10 19:25:26

Sorry, I wasn't able to get the solution to work.

Back to top