Niantic Studio: Audio not working properly in iPhone Safari

I am building an AR using Niantic studio.
What I want to do is to make a bouncing sound when a physics simulated ball entity collides with another entity.
I would like to know how to get the sound to sound like it does on the iPhone!

In ecs.Audio, you can’t specify the playback start position like play( delay ) in Three.js Audio, right?
So, in order to always set the playback position to 0, I create a new entity for Audio and play it at the timing I want it to sound as follows.

const audioEid = world.createEntity()

      if (Position.has(world, eid)) {
        const blockPos = Position.cursor(world, eid)
        // 2-2. set the same position for the generated entity
        ecs.Position.set(world, audioEid, {
          x: blockPos.x,
          y: blockPos.y, { x: blockPos.x, y: blockPos.y, z: blockPos.z, z: blockPos.z, z: blockPos.z, z: blockPos.z
          z: blockPos.z, }
        })
      }

      ecs.Audio.set(world, audioEid, {
        url: 'assets/ball.mp3', // specify actual sound effect file
        paused: false, // if false, playback starts
        loop: false,
        volume: 1.0, }
      })

      setTimeout(() => {
        world.deleteEntity(audioEid)
      }, 1000)

The sound is normal on the simulator, but when viewed on an iPhone safari, the sound is often not heard.

  • Even when it does, the timing of the sound is abnormally slow compared to the simulator (slow loading?).
  • The first time the sound is played, but not after the second time.
  • There is no error in the console.
  • It often does not sound at all.

I saw inquiries about ecs.Audio

And I tried to make the sound play once with the interaction as shown below, but the above problem is not solved.

      startEventDispatcher = async () => {
    const audioEid = world_.createEntity()
    ecs.Audio.set(world_, audioEid, {
      url: 'assets/button.mp3', paused: false, { startEventDispatcher = async ( => { const audioEid = world_.createEntity()
      paused: false, loop: false, { url: 'assets/button.mp3', url: 'assets/button.mp3', loop: false, loop: false
      loop: false,
      volume: 0.1, }
    })
    world_.events.dispatch(eid_, 'start') // dispatch event when clicked
  }

  // add a click event listener
  uiContent.addEventListener('click', startEventDispatcher)

How can I fix it?
Could you help me?

Hi Ken,

I’d be happy to help you figure out the issues around Audio playback. Could you land your changes and share your project with the support workspace?

Thank you, George!
I shared this with support.
I hope you take a look at it when you have time.

Going to be taking a look at this with the team, I’ll update here with details.

Thank you very much!
Best regards.

Hey Ken,

Looks like this might be a bug in our implementation of audio. Can you confirm if the audio works as expected on another browser like Safari?

Thanks, George!
I can only verify this on my iPhone, but it is the same in safari and chrome.