naverz / zepeto-studio-kor

48 stars 8 forks source link

[BUG]: No audio after returning to ZEPETO App #1290

Open adamwawrzynkowski opened 1 year ago

adamwawrzynkowski commented 1 year ago

When the player starts Music, Movie, or answers the phone call and then returns to the game, the sound is muted. Even if Music/Video/Call is no longer on playback.

Reproduction:

  1. Leave App (leave it working in Tasks)
  2. Open YouTube/Netflix and play random video
  3. Back to ZEPETO App
  4. Audio is muted

Alternatively you can answear the call while playing the game. After finishing the call back to the game. Audio will be muted.

iOS: Bug occured on 15.6.1, 16.0, 16.1 Beta ZEPETO World Package Version: 1.6.0 ZEPETO App Version: 3.16.000 Development Environment: Mac Studio M1 Max - macOS 12.6 Monterey (same on Ventura 13.0 Beta 9)

We've found an workaround. If you force AudioListener to Resume and set audio to 1.0, bug is no longer occur. Code: Update() { if (this.EnableFix) { AudioListener.pause = false; AudioListener.volume = 1; } }

Zepeto-TechEvangelist commented 1 year ago

Hello, The reproduction method you provided did not cause any problems on our part. Could you please share the more detailed code you used?

adamwawrzynkowski commented 1 year ago

Hello. Of course, here is more information about this bug: The bug most often occurs when we answer a phone call during the game (the same happens when we reject it during the game). At this point, the phone must have audio turned on and not be muted (ringtone must play). We've tested it on iPhone.

We play sounds in game using built in AudioSource, and dynamic sounds are spawned using Object.Instantiate(obj); Here is the code:

This is our Audio Spawn System. We are calling this function from scripts and object with assigned AudioClip will spawn and Play audio:

1

Here are global audio volumes. Our scripts take information from this script and play the sound at the set volume:

2

For example, here is a line of code that perform spawn an audio object and play a fixed audio clip: AudioController.Instance.SpawnAudio(this.transform.position, this.SwooshAudioClip, GlobalAudio.Instance.THROW_VOLUME, Random.Range(0.95, 1.05), false, 0.0, 1.0, 500.0, 2.5);

We've tested this again and bug still occur. If You need additional information, please let me know :)