Error creating an expo's Audio.Sound from blob

Viewed 21

I have a backend that can delivers audio or image files (audio/x-m4a or image/jpeg) so I have to show them on my react-native/expo app. So I have something like this:

enter image description here

In line 19 I'm getting a blob from the backend and on line 21 and getting its URI. So when I call this component for two images and one audio I get this:

blob:7E5FD45B-B10F-447B-B37C-D429DBA72871?offset=0&size=96665
blob:0A1BD6A2-C5B0-40C4-BB77-9A5F4A0E52B7?offset=0&size=281234
blob:6E7EB36F-FBC0-4F34-ADAC-864F0F5B75DF?offset=0&size=816812

I'm not sure how URI works on mobile but these URI are pretty weird for me...

Them in line 25 I'm trying to load an expo's Audio.Sound but I get this error:

[Unhandled promise rejection: Error: The AVPlayerItem instance has failed with the error code -1002 and domain "NSURLErrorDomain".]
at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:104:50 in promiseMethodWrapper
at node_modules/expo-modules-core/build/NativeModulesProxy.native.js:27:27 in moduleName.methodInfo.name
at http://192.168.1.33:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:307121:50 in <unknown>
at node_modules/expo-av/build/Audio/Sound.js:136:34 in loadAsync

However I'm able to successfully show the image with line 38.

enter image description here

Any suggestion for the audio sound?

0 Answers
Related