Version
master
Describe the bug
On Safari (Mac and iOS), if the microphone is being opened without user interactions, Safari will block the access.
Technical details
To detect whether Safari block or not:
async function canOpenMicrophone() {
const audioContext = new AudioContext();
try {
if (audioContext.state === 'suspended') {
return await Promise.race([
audioContext.resume().then(() => true),
new Promise(resolve => setImmediate(resolve)).then(() => false)
]);
}
return true;
} finally {
await audioContext.close();
}
}
Note: the result of this call is asynchronous and code executed after the result will fail user interaction requirement.
To Reproduce
Steps to reproduce the behavior:
- Go to sample 06.c
- Click on microphone
- Say "input hint expected"
- Wait until the bot response completed synthesis
Expected behavior
The microphone will open. Or on Safari, it should never open.
Actual, the microphone is being opened, but Safari blocked access and suspended our code.
[Bug]
Version
masterDescribe the bug
On Safari (Mac and iOS), if the microphone is being opened without user interactions, Safari will block the access.
Technical details
To detect whether Safari block or not:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The microphone will open. Or on Safari, it should never open.
Actual, the microphone is being opened, but Safari blocked access and suspended our code.
[Bug]