Skip to content

[expo-audio] sound preloading not implemented #42900

@psnet

Description

@psnet

Minimal reproducible example

https://github.com/search?q=repo%3Aexpo%2Fexpo+path%3A%2F%5Epackages%5C%2Fexpo-audio%5C%2F%2F+preload&type=code

Steps to reproduce

As we can see by link:

https://github.com/search?q=repo%3Aexpo%2Fexpo+path%3A%2F%5Epackages%5C%2Fexpo-audio%5C%2F%2F+preload&type=code

expo-audio doesnt have real prealoding (buffering) audio data before playing, that means buffering is starting right after calling play which causes a long init time for preparation and results in large latency.

This means expo-audio doesnt fits for sound effects or UI sound interaction like clicks or other short sound audio which must be played with low latency so user can feel it naturally.

In these situation expo-audio fits only for long playing audio like background music, audio player, but not for UI sfx and games.

This is very sad situation as developers can think it is universal whereas it is not.

Also disorienting property downloadFirst which have description:

This can improve playback performance and reduce buffering, especially for users managing multiple audio players simultaneously.

which is not related to buffering AT ALL! Because of it only downloads file via downloadAsync to temp folder in case if this is Asset, it doesnt do anything related to improve buffering.

Situation

expo-audio did large work to be not universal. I think the proper way to improve latency and make real buffering is to implement underlying exoplayer's preloading described here:

https://developer.android.com/media/media3/exoplayer/preloading-media/preloadmanager

This will make huge improvement into this library.

Environment

SDK 54

Expo Doctor Diagnostics

All ok

Metadata

Metadata

Assignees

Labels

needs reviewIssue is ready to be reviewed by a maintainer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions