bluefireteam / audioplayers

A Flutter package to play multiple audio files simultaneously (Android/iOS/web/Linux/Windows/macOS)
https://pub.dartlang.org/packages/audioplayers
MIT License
1.99k stars 844 forks source link

play multiple times #1762

Open Jorge-Saieg opened 7 months ago

Jorge-Saieg commented 7 months ago

Checklist

Current bug behaviour

I want to play a sound multiple times in a second, and is playing only once and getting: D/AudioManager( 7529): dispatching onAudioFocusChange(-1) to android.media.AudioManager@181a27axyz.luan.audioplayers.player.FocusManager$$ExternalSyntheticLambda0@6459b34 This is the sound: https://github.com/bluefireteam/audioplayers/assets/61739438/8f66177c-bb23-4474-91ff-1242f9922967

Thanks!

Expected behaviour

Play a short sound multiple times in a second

Steps to reproduce

  1. Execute flutter run on the code sample
  2. ...
  3. ...

Code sample

Code sample ```dart void main() { } ```

Affected platforms

Android

Platform details

No response

AudioPlayers Version

main 5.2.1

Build mode

debug

Audio Files/URLs/Sources

https://github.com/bluefireteam/audioplayers/assets/61739438/8f66177c-bb23-4474-91ff-1242f9922967

Screenshots

No response

Logs

my relevant logs
Full Logs ``` my full logs or a link to a gist ``` Flutter doctor: ``` Output of: flutter doctor -v ```

Related issues / more information

No response

Working on PR

no way

Gustl22 commented 6 months ago

Did you try AudioPool? Also not quite sure if, mov is supported, but could be.

geerahdev commented 5 months ago

I ran into the same problem. My issue was fixed when I added player.setReleaseMode(ReleaseMode.stop);

right after setting the source of the player. Unfortunately I cannot see your example code if this might be same for you