Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to load music from document directory #36

Open
islom9797 opened this issue Jun 21, 2023 · 0 comments
Open

How to load music from document directory #36

islom9797 opened this issue Jun 21, 2023 · 0 comments

Comments

@islom9797
Copy link

Thank you for so amazing package
How to load from document directory.At the moment work just load mp3 files from asset folder but I want to load music from document directory(data/user/0/com.example.moms_life_ekg/app_flutter/record/test_1687338283864.mp3 like this) but
AudioCache.load and AudioCache.loadAsFile does not work and giving error like this
RROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unable to load asset: "assets//data/user/0/com.example.moms_life_ekg/app_flutter/record/test_1687337809743.mp3".
E/flutter (29741): The asset does not exist or has empty data.
E/flutter (29741): #0 PlatformAssetBundle.load. (package:flutter/src/services/asset_bundle.dart:254:9)
E/flutter (29741):
E/flutter (29741): #1 AudioCache.fetchToMemory (package:audioplayers/src/audio_cache.dart:89:22)
E/flutter (29741):
E/flutter (29741): #2 AudioCache.load (package:audioplayers/src/audio_cache.dart:115:31)
E/flutter (29741):
E/flutter (29741):
Please can you explain how to load and play music from document directory thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant