You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web Audio API decodeAudioData Not Working on macOS (Ionic Capacitor App for M1 MacBook) #2620
I’m encountering an issue with the Web Audio API’s decodeAudioData function in my Ionic React app. The function works without any problems on iOS, Android, and in browsers (Safari and Chrome when running on localhost on macOS). However, when the app runs for macOS via Xcode on an M1 MacBook, it fails with the error "decodeAudioData error null"
Details:
Platforms Tested: iOS, Android, macOS (works fine except for macOS via Xcode).
Error: The function throws an error 'decodeAudioData error null' when decoding .mp3 files.
File Format: All audio files are .mp3.
Environment: Tested specifically on an M1 MacBook using Xcode for the macOS build.
Behavior:
Works perfectly in Safari and Chrome when served from localhost on the same M1 MacBook.
Fails only in the macOS app built and run via Capacitor/Xcode.
File Location: Files are stored in the public directory of the app and are accessible via their URLs.
CORS: No cross-origin issues observed, and files load successfully.
Question:
Is this issue specific to how Capacitor handles the Web Audio API on macOS, particularly on M1 machines? Or is there something platform-specific about decodeAudioData on macOS that I should consider?
Has anyone experienced this or have recommendations for debugging or resolving the issue? Any help would be greatly appreciated!
This doesn't look like a spec issue, so I'll move this to the discussion board. There is also the Web Audio Slack which may be helpful for questions like this.
Activity
mjwilson-google commentedon Jan 27, 2025
This doesn't look like a spec issue, so I'll move this to the discussion board. There is also the Web Audio Slack which may be helpful for questions like this.