Skip to content

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

Closed

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!

Activity

  1. mjwilson-google commented on Jan 27, 2025

    @mjwilson-google
    Member

    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.

  2. locked and limited conversation to collaborators on Jan 27, 2025
  3. converted this issue into a discussion #2621 on Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions