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
Expo Doctor Diagnostics
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-audiodoesnt have real prealoding (buffering) audio data before playing, that means buffering is starting right after callingplaywhich causes a long init time for preparation and results in large latency.This means
expo-audiodoesnt 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-audiofits 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
downloadFirstwhich have description:which is not related to buffering AT ALL! Because of it only downloads file via
downloadAsyncto temp folder in case if this isAsset, it doesnt do anything related to improve buffering.Situation
expo-audiodid large work to be not universal. I think the proper way to improve latency and make real buffering is to implement underlyingexoplayer's preloading described here:https://developer.android.com/media/media3/exoplayer/preloading-media/preloadmanager
This will make huge improvement into this library.
Environment
Expo Doctor Diagnostics