I'm using the package: audioplayers: ^1.0.1
I'm trying to follow the migration guide of audioplayers found in this link: https://github.com/bluefireteam/audioplayers/blob/main/migration_guide.md
But I can't make it to work.
Here's my pubspec
flutter:
assets:
- assets/sounds/
If I do it like this, it can't load the assets.
final playerSound = AudioPlayer();
await playerSound.setSource(AssetSource('assets/sounds/Pop (1).wav'));
Unhandled Exception: Unable to load asset: assets/assets/sounds/Pop (1).wav
But if I remove the assets, it is trying to find in the cache. I don't get why it is working. Please help to clarify. Thanks!
final playerSound = AudioPlayer();
await playerSound.setSource(AssetSource('sounds/Pop (1).wav'));
java.io.FileNotFoundException: /data/user/0/com.MyName.MyApp/cache/sounds/Pop%20(1).wav: open failed: ENOENT (No such file or directory)