Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

paulos_ab's avatar

Can't play an remote audio file from an API made with Laravel from a React Native Expo app

I am trying to play an audio file with Expo Audio from an API made with Laravel in a React Native app but it's returning 404 not found

this is the Laravel API code that returns the URL to the file on the server

$audio_url = 'api_link' . Storage::url($filename);

and this is the Audio player code in React Native Expo

sound.current = await Audio.Sound.createAsync( {uri: audioDetails.url}, { shouldPlay: true } );

but I am getting this error

[Unhandled promise rejection: Error: com.google.android.exoplayer2.upstream.v$a: com.google.android.exoplayer2.upstream.v$a: java.io.FileNotFoundException: : open failed: ENOENT (No such file or directory)]

please what can I do, thanks in Advance

0 likes
4 replies
Sinnbeck's avatar

And you can call the url from another computer without any problem?

paulos_ab's avatar

@Sinnbeck wait please lemme try using Web Audio to play the audio with the URL, thanks for your quick response

paulos_ab's avatar

I have fixed it somehow, I am not requesting the file from the api's root url (laravel_api_root/storage/filename.mp3 for example) anymore, it worked when I loaded the file from the symbolic link directory on the remote server and changed the symlink directory permission, thanks @sinnbeck for your reply

Please or to participate in this conversation.