Skip to content

Instantly share code, notes, and snippets.

@idlebit1
idlebit1 / gist:c5828bb7ec0006c7aeb92fdc93c7bb0b
Created May 15, 2022 19:47
How to make web audio / tone.js play while iphone is muted.
// This gist copyright IdleBit 2022, MIT License
var isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || isIOS
var isFirefox = /Firefox/i.test(navigator.userAgent)
// call this from first click action
function startSound() {
if (isIOS) {
try{