Niantic Studio: Audio does not work properly

Hello :wave:

I’m using Studio, and I have a mechanic to control the volume up and down by making a face gesture. It works in the editor, but on iOS, it doesn’t work in Chrome or Safari—the volume always stays up. I also tested it on an Android device, and it works as expected.

Here’s my logic:

const onPowerUp = (event) => {
  ecs.Audio.set(world, sfxGame, { volume: 1 });
}

const onDebuff = (event) => {
  ecs.Audio.set(world, sfxGame, { volume: 0.25 });
}

I also have background audio set to play when the game starts, configured in the inspector, but sometimes it doesn’t play.

image

Any help, how can I solve it?
Just to clarify, my iPhone is not in low power mode.

I found this A-Frame Sound documentation

  • Does this also apply to study?
  • A gesture does not count as an interaction?
1 Like

I have the same problem

I’ll take a look to see if I can reproduce the audio volume issue.

Face expressions / events don’t count as interactions on the browser. Browser have implemented security features that prevent pages from using the AudioContext until a user gesture is registered on the page such as a click, swipe, tap, of a button, etc.