expo: Expo AV loadAsync never rejects if a file fails to load

Summary

Howdy! I am having the same issue described in #18627. If Audio.Sound’s loadAsync method is given a uri for a file which does not exist or can’t be played, it never rejects.

I’m only working in iOS, so I’m not sure if this is true for Android or web. I’m seeing it in both sdk version 46 and 47.

I tried the snack in the linked issue, and the reject does not occur on my simulator or when I run through an iOS device in the snack using the Tap to Play. Real devices also have this issue.

What platform(s) does this occur on?

iOS

Environment

  expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 12.6.1
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.0/bin/yarn
      npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
    Managers:
      CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    IDEs:
      Android Studio: 2021.3 AI-213.7172.25.2113.9123335
      Xcode: 14.1/14B47b - /usr/bin/xcodebuild
    npmPackages:
      expo: ~47.0.8 => 47.0.8
      react: 18.1.0 => 18.1.0
      react-native: 0.70.5 => 0.70.5
    npmGlobalPackages:
      expo-cli: 6.0.8
    Expo Workflow: managed

Minimal reproducible example

Here’s a delicious snack

https://snack.expo.dev/@wavy-jeff/load-ye-a-sound

For another example, here’s a public repo

https://github.com/onwavy/sound-loading-example

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 5
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Hello again bot. This issue is still present in sdk 49 with the latest expo-av version.

what’s the file name? I just found out if the file name has spaces it doesn’t work…removing the spacing it started to work, maybe is something related to the encoding of the url? replacing the string with encodeURI(audioUrl) fix all my issues

I just checked, and found out I have the same file name space bug too, Thanks i’ll implement your suggestion, Android works fine with spaces

yeah you are right, it should still throw the error or at least timeout is the url is wrong…I wrote just to give a workaround to who read this post (I’ve just spent the day on this 😂 )

It’s still there in sdk 49…sigh!! Also if internet connectivity drops it keeps trying to load and never throws an error