Interaction Requirement for Enabling Microphone

Hi, I think 8thwall studio is very good, I’m trying out the free license with this code to interact with the microphone of a device.

My problem is that Android devices require physical interaction from the user for the permission to be enabled.

function setAudio() {
const _windows : any = window

if (audioContext) return

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

analyzer = audioContext.createAnalyser()
analyzer.fftSize = 256
dataArray = new Uint8Array(analyser.frequencyBinCount)

// Get access to the microphone
try {
navigator.mediaDevices
.getUserMedia({audio: true})
.then((stream) => {
const source = audioContext.createMediaStreamSource(stream)
source.connect(analyser)

mediaDeviceLoad = true
})
} catch (err) {
console.error(β€˜Error accessing microphone:’, err)
}
}

How can I add this interaction? Currently, when loading the application, the 8thwall logo appears and the user must click on it at that moment to enable the microphone, otherwise, when entering my application (without interacting with the 8thwall logo) the application will no longer obtain the permissions.

On the other hand, I want to know, if I buy the Pro license (month), will the Splash Screen be removed?

You can use any method to capture a user interaction with the page. I’d recommend creating a button or similar UI element to β€œBegin Experience” and then try microphone capture after that button has been clicked.

Regarding the splash screen, read here about disabling the splash screen: Project Settings | 8th Wall