-
Notifications
You must be signed in to change notification settings - Fork 856
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
cant play local sound #1054
Comments
i'm having the same issue, any update on this? |
You're importing it wrong. |
@mkay-42069 |
@innerk no sorry , if you find the answer please let me know , thank you . |
@shaco75 hey try this one https://pub.dev/packages/just_audio just import your assets and make sure it's the correct path, then use player.setAsset('assets/bird.mp3') or from url and voila |
Sorry for not being clearer. You have to have it in the literal assets folder, because its hardcoded.
|
Thanks a lot guys i will try the both ways ❤️❤️ |
Exactly. |
when i press the sound button it show error :
E/flutter (30513): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Unable to load asset: assets/sound/1.mp3
E/flutter (30513): #0 PlatformAssetBundle.load
package:flutter/…/services/asset_bundle.dart:237
E/flutter (30513):
E/flutter (30513): #1 AudioCache.fetchToMemory
package:audioplayers/src/audio_cache.dart:89
E/flutter (30513):
E/flutter (30513): #2 AudioCache.load
package:audioplayers/src/audio_cache.dart:115
E/flutter (30513):
E/flutter (30513): #3 AudioCache.play
package:audioplayers/src/audio_cache.dart:159
E/flutter (30513):
E/flutter (30513):
and i have been edited the pubspec.yaml already :
flutter:
uses-material-design: true
assets:
- sound/
The text was updated successfully, but these errors were encountered: