Skip to content

Using with Expo - how import file? #879

@Alwox

Description

@Alwox

🪲 Description

I want to use this library with my Expo project but I can't import sound files. Docs says Expo: Compatible with custom development builds (not Expo Go) and I'm using development build.

🪲 What have you tried?

I tried to import it like this with different path combinations but always ends with {"code": -1, "message": "resource not found"}

export const beepSound = new Sound('assets/sounds/beep.mp3', '', error => {
    if (error) {
        console.error('Failed to load beep sound:', error)
    }
})

Is your issue with...

  • iOS
  • Android
  • Windows

Are you using...

  • React Native CLI (e.g. react-native run-android)
  • Expo
  • Other: (please specify)

Which versions are you using?

  • React Native Sound: 0.13.0
  • React Native: 0.81.5
  • Expo: 54.0.23

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions