Flame Audio (flame_audio 1.2.0) is not playing the sound effects (wav or mp3) on an android device or emulator. But works fine on ios simulator.
I have tried playing "wav" & mp3 files but no error was shown either.
PFB my pubspect.yml
environment:
sdk: ">=2.17.6 <3.0.0"
dependencies:
flutter:
sdk: flutter
flame: 1.2.1
flame_audio: 1.2.0
cupertino_icons: 1.0.2
shared_preferences: 2.0.15
google_fonts: 3.0.1
logger: 1.1.0
Code I have to run play the audio :
//Inside onLoad(), loading all the files in cache
await FlameAudio.audioCache.loadAll(
['die.wav', 'hit.wav', 'point.wav', 'wing.wav', 'swooshing.wav']);
...
...
...
// In update method on certain events trying to play the sound
FlameAudio.play('hit.wav', volume: 1);
I have not made any changes in gradle files or AndroidManifest.xml, its as it is created by flutter on creating new project. My local flutter version is: 3.0.5
Am I missing something? Any help is appreciated.
Thank you.