From 025fbd2e53dd4733db62def862c0a32e1d52995e Mon Sep 17 00:00:00 2001 From: Marek Malek Date: Thu, 21 May 2026 14:47:38 +0200 Subject: [PATCH] fix: local path resolution --- .../react-native-audio-api/src/core/AudioDecoder.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/react-native-audio-api/src/core/AudioDecoder.ts b/packages/react-native-audio-api/src/core/AudioDecoder.ts index d45e42b89..a5050e674 100644 --- a/packages/react-native-audio-api/src/core/AudioDecoder.ts +++ b/packages/react-native-audio-api/src/core/AudioDecoder.ts @@ -89,9 +89,16 @@ class AudioDecoder { } private resolveLocalFilePath(stringSource: string): string { - return stringSource.startsWith('file://') - ? stringSource.replace('file://', '') + const stripped = stringSource.startsWith('file://') + ? stringSource.slice('file://'.length) : stringSource; + try { + // Unescape percent-encoded tokens. + return decodeURIComponent(stripped); + } catch { + // Fall back to the stripped path if encoding is malformed. + return stripped; + } } private async decodeFromLocalFile(