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
2.01k stars 845 forks source link

Can't find duckAudio property in AudioPlayer class after upgrade to latest #1841

Closed Mo0Khaled closed 1 month ago

Mo0Khaled commented 2 months ago

Checklist

Current bug behaviour

When we play a music at the background then we open the app we play audio at the starting point of the app but the music at the background stopped.

Expected behaviour

The two sounds should be playing in parallel.

Steps to reproduce

I am using:

Flutter 3.24.1 audioplayers: ^6.1.0

the duck audio was exists on audioplayers: ^0.20.1 inside AudioCache class.

Affected platforms

Android, iOS

AudioPlayers Version

6.1.0

Build mode

debug, release

Mo0Khaled commented 1 month ago

solved it FYI

   final audioContext = AudioContext(
       android: const AudioContextAndroid(
         audioFocus: AndroidAudioFocus.gainTransientMayDuck,
       ),
     );
       _audioPlayer = AudioPlayer();
       await _audioPlayer?.play(
         AssetSource(soundEffectPath),
         mode: PlayerMode.lowLatency,
         ctx: audioContext,