From 287881b8153ced5c519b572e367c8ea402674058 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 29 Oct 2023 08:06:56 +1000 Subject: [PATCH] Web Audio: Don't attempt to unlock audio on the touchstart event. Public issue https://github.com/mackron/miniaudio/issues/759 --- CHANGES.md | 1 + miniaudio.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 8746ab3e..ed118a27 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ v0.11.19 - TBD * Documentation fixes. * Remove the use of some deprecated functions. * Improvements to runtime linking on Apple platforms. +* Web / Emscripten: Audio will no longer attempt to unlock in response to the "touchstart" event. This addresses an issue with iOS and Safari. This results in a change of behavior if you were previously depending on starting audio when the user's finger first touches the screen. Audio will now only unlock when the user's finger is lifted. See this discussion for details: https://github.com/mackron/miniaudio/issues/759 * Web / Emscripten: Fix an error when using a sample rate of 0 in the device config. diff --git a/miniaudio.h b/miniaudio.h index ac2da690..5386d0e8 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -40464,7 +40464,7 @@ static ma_result ma_context_init__webaudio(ma_context* pContext, const ma_contex }; miniaudio.unlock_event_types = (function(){ - return ['touchstart', 'touchend', 'click']; + return ['touchend', 'click']; })(); miniaudio.unlock = function() {