Start a new topic

AR view is interfering with html audio on non-wikitude view

SDK 9.2.1 

iOS 14.0.1

I have spacial audio interactive built in a Webview using the resonance audio SDK. I'm finding that the audio isn't playing in the interactive AFTER I have opened a view containing the Wikitude SDK. Something from that seems to be interfering with it.

I know that this because if I go straight to the interactive without going to any Wikitude views beforehand it works fine.


Is there anything in the Wikitude Webkit that might be causing this?


Here's how I'm loading the audio in my interactive outside of Wikitude:


function initAudio() {

  audioContext = new (window.AudioContext || window.webkitAudioContext);


   let audioSources = [

    'crowd_centerleft_v3.mp3',

    'crowd_right_v1.mp3',

    'crowd_back_v1.mp3',

    'crowd_left_v1.mp3',

    'crowd_centerright_v3.mp3',

    'narration.mp3'

  ];

 

  let audioElementSources = [];

  for (let i = 0; i < audioSources.length; i++) {

    audioElements[i] = document.createElement('audio');

    audioElements[i].src = audioSources[i];

    audioElements[i].crossOrigin = 'anonymous';

    audioElements[i].load();

    audioElements[i].loop = true;

    audioElementSources[i] =

      audioContext.createMediaElementSource(audioElements[i]);

  }

  audioElements[5].loop = false;

 

  // Initialize scene and create Source(s).

  scene = new ResonanceAudio(audioContext, {

    ambisonicOrder: 1,

  });

  for (let i = 0; i < audioSources.length; i++) {

    soundSources[i] = scene.createSource();

    audioElementSources[i].connect(soundSources[i].input);

  }

  scene.output.connect(audioContext.destination);

 

  audioReady = true;

}

Login or Signup to post a comment