Skip to content

Web Audio API decodeAudioData Not Working on macOS (Ionic Capacitor App for M1 MacBook) #2620

@nitzanrh

Description

@nitzanrh

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions