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!
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!